Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

Problems with 'effectiveTechLevel'

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: another_commander, winston

User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Problems with 'effectiveTechLevel'

Post by Smivs »

Hi all,
I'm working with a bit of high-tech kit which has an initial TL of 99 which I want to make repairable at TL15 only, and I can't! It also becomes repairable at TL14.
To make sure it's not buyable, I've scripted it so that the TL reduction kicks in only when the player docks with a damaged item, thus.

Code: Select all

this.shipDockedWithStation = function (station)
{
 if(player.ship.equipmentStatus ("EQ_HIGHTECH_DEVICE") == "EQUIPMENT_DAMAGED")
  {
   EquipmentInfo.infoForKey("EQ_HIGHTECH_DEVICE").effectiveTechLevel = 14;
  }
}
This might seem a strange way to do this, but I have my reasons. :wink:
I have also tried setting effectiveTechLevel to both 15 and 16, with the same result...namely the repair is offered at TL14.
I've checked there are no missionvariables in the save file which could be causing this.
Every other element of this WIP is working fine and as expected, except this bit.
Is TL14 some sort of default maximum...the game rounds-down anything higher?
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Problems with 'effectiveTechLevel'

Post by Eric Walch »

Smivs wrote:
I have also tried setting effectiveTechLevel to both 15 and 16, with the same result...namely the repair is offered at TL14.
I've checked there are no missionvariables in the save file which could be causing this.
Every other element of this WIP is working fine and as expected, except this bit.
Is TL14 some sort of default maximum...?
yes, it is hardcoded that 14 is the maximum. In my opinion that is a bug because TL15 is also very useful as you realised:
With a value of effectiveTechLevel=15, Equipment becomes only buyable at techlevel 16 (none-existing) but reparable at techlevel 15

Code: Select all

Level 15 systems only exist in G1 (1x), G2 (1x), G5 (1x), G6 (1x) and G7 (2x) 
That makes that the player can repair such stuff, but not in every galaxy :wink:

The current limit is not mentioned in the wiki and I just found out in a similar way as you now did: wondering why things in the oxp didn't work as I programmed.

I already had in mind to add this change to trunk in the near future.
User avatar
SandJ
---- E L I T E ----
---- E L I T E ----
Posts: 1048
Joined: Fri Nov 26, 2010 9:08 pm
Location: Help! I'm stranded down here on Earth!

Re: Problems with 'effectiveTechLevel'

Post by SandJ »

Eric Walch wrote:
In my opinion that is a bug because TL15 is also very useful as you realised: With a value of effectiveTechLevel=15, Equipment becomes only buyable at techlevel 16 (none-existing) but reparable at techlevel 15

I already had in mind to add this change to trunk in the near future.
Is there any mileage in making the cloaking device repairable at TL15 at the same time?
Flying a Cobra Mk I Cobbie 3 with nothing but Explorers Club.OXP and a beam laser 4 proper lasers for company :D
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Problems with 'effectiveTechLevel'

Post by Smivs »

Eric Walch wrote:
yes, it is hardcoded that 14 is the maximum. In my opinion that is a bug.....
I already had in mind to add this change to trunk in the near future.
<Smivs nods in agreement> :)
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Problems with 'effectiveTechLevel'

Post by Eric Walch »

SandJ wrote:
Is there any mileage in making the cloaking device repairable at TL15 at the same time?
That was the reason I ran into that 'bug/feature'. In my opinion it should become reparable. And with that techlevel there are only 6 systems in the whole of 8 galaxys were you could do it.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16063
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Problems with 'effectiveTechLevel'

Post by Cody »

Eric Walch wrote:
SandJ wrote:
Is there any mileage in making the cloaking device repairable at TL15 at the same time?
That was the reason I ran into that 'bug/feature'. In my opinion it should become reparable. And with that techlevel there are only 6 systems in the whole of 8 galaxys were you could do it.
Music to my ears! At what price... the same as the NEU? Or substantially more?
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Problems with 'effectiveTechLevel'

Post by Smivs »

<Smivs quietly bins his CloakRepair OXP>
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Problems with 'effectiveTechLevel'

Post by Eric Walch »

El Viejo wrote:
Music to my ears! At what price... the same as the NEU? Or substantially more?
Currently its only my personal opinion, but in the code is already commented a suggestion for a long time, to make it repairable. In my opinion it makes oolite more challenging. Without the option for repair, is damaging the cloak, the same as being killed. Whenever it happens to me, I have to kill myself to continue with a game were I still have a cloak. So, I am never in the situation were I have no cloak at all.

When the cloak can be repaired, I am more likely to accept the loss and continue playing without cloak. In the worse case it can take 2 galactic jumps to enter a galaxy that has repair facilities for it. That probably means playing without cloak for several days/weeks. Adds a new challenge for those that were hooked to the cloak.

The current purchase price has always been set at 50000. That is 5% higher than the NEU, but that was more because there had to be a value filled in. I think the price could be upped so that repair itself costs 50 grand.
User avatar
Gimi
---- E L I T E ----
---- E L I T E ----
Posts: 2073
Joined: Tue Aug 29, 2006 5:02 pm
Location: Norway

Re: Problems with 'effectiveTechLevel'

Post by Gimi »

Eric Walch wrote:
When the cloak can be repaired, I am more likely to accept the loss and continue playing without cloak. In the worse case it can take 2 galactic jumps to enter a galaxy that has repair facilities for it.
The current purchase price has always been set at 50000. That is 5% higher than the NEU, but that was more because there had to be a value filled in. I think the price could be upped so that repair itself costs 50 grand.
I agree with this, it should be repairable. It would probably make the game harder in the long run, as the player would have more encounters without the cloak (waiting for repair). Just remember to make sure that the repair bots can't fix it.
"A brilliant game of blasting and trading... Truly a mega-game... The game of a lifetime."
(Gold Medal Award, Zzap!64 May 1985).
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16063
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Problems with 'effectiveTechLevel'

Post by Cody »

Eric Walch wrote:
I think the price could be upped so that repair itself costs 50 grand.
That's exactly how I had it set for ages. But I reckon the NEU is by far the more valuable kit, combat-wise, so I recently reduced it to match the NEU price.
However, if it was to go into the core game, 50k for repair is a cool number.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2412
Joined: Mon May 31, 2010 11:11 pm

Re: Problems with 'effectiveTechLevel'

Post by Switeck »

Smivs wrote:
I'm working with a bit of high-tech kit which has an initial TL of 99 which I want to make repairable at TL15 only, and I can't! It also becomes repairable at TL14.
To make sure it's not buyable, I've scripted it so that the TL reduction kicks in only when the player docks with a damaged item, thus.

Code: Select all

this.shipDockedWithStation = function (station)
{
 if(player.ship.equipmentStatus ("EQ_HIGHTECH_DEVICE") == "EQUIPMENT_DAMAGED")
  {
   EquipmentInfo.infoForKey("EQ_HIGHTECH_DEVICE").effectiveTechLevel = 14;
  }
}
Simple solution: check what TL the system you're in is...and make the item repairable via effectiveTechLevel *IF* it's a TL15 system.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Re: Problems with 'effectiveTechLevel'

Post by Thargoid »

Gimi wrote:
Just remember to make sure that the repair bots can't fix it.
The repair bots (and repair system) can fix a cloak, but the chance is low. Lvl 99 tech currently has a 10% chance of fixing, and items with a tech level between 9 and 17 have a diminishing chance (90% at TL9, dropping by 10% per TL).

That has been in there from the beginning, and will remain in there. Personally I also don't like the concept of unfixable technology, so in lieu of any other solution I worked around it. Especially as other OXPs introduce a few cloaked ships, hence narratively it's not quite the one-off item it perhaps used to be.

But making it unrepairable on a per-user basis is simple, by just adding the repair chance equipmentInfo tag to the cloak's entry, as detailed in the OXP itself.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Problems with 'effectiveTechLevel'

Post by Commander McLane »

For completeness I'd like to add that also the Hackers on a Hacker Outpost have the technology to repair the cloaking device, if you have Anarchies.oxp installed. This has been the case for quite a long time.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Problems with 'effectiveTechLevel'

Post by Eric Walch »

Commander McLane wrote:
For completeness I'd like to add that also the Hackers on a Hacker Outpost have the technology to repair the cloaking device, if you have Anarchies.oxp installed. This has been the case for quite a long time.
I see. But currently you are always making it non-buyable after a launch from a hackers Outpost:

Code: Select all

this.shipWillLaunchFromStation = function(station)
{
	if(station.name === "Hacker Outpost") delete missionVariables.TL_FOR_EQ_CLOAKING_DEVICE;
That would mean that when officially making it repairable on a level 15 system, this code would revert it to the current, not-repairable, situation. Better add a check in it to revert it to the original value of EquipmentInfo.infoForKey("EQ_CLOAKING_DEVICE").effectiveTechLevel on docking an Outpost. :lol:

It is not even needed to do these level settings in the worldScript. It could also be done in the station script itself when it detects a launch/docking of a player.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Problems with 'effectiveTechLevel'

Post by Commander McLane »

Good call. When I included the repairability of cloaking devices to Anarchies.oxp, there was no other script that tried to do the same, therefore I took it for granted that the device's TL would stay at 99, and I only needed to change it on docking.

This will of course interfere with other OXPs trying to reset its TL more permanently.

Although other OXP authors could of course easily assume the same thing and also change the TL only temporarily. If everybody sticks to it, there won't be any interference and any override.

Anyway, for the benefit of a changing policy for vanilla Oolite (and OXPs which may be more careless) I'm going to change it along your suggestion for the next release of Anarchies.
Post Reply