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

incompatible_with_equipment BUG

For test results, bug reports, announcements of new builds etc.

Moderators: another_commander, winston, Getafix

Post Reply
User avatar
Eldon
Dangerous
Dangerous
Posts: 68
Joined: Tue Jan 26, 2010 1:38 pm

incompatible_with_equipment BUG

Post by Eldon »

I've just been doing a bit of testing on this equipment.plist key.

It seems it works a little different to the way I imagined.

I set up a couple of pieces of equipment, "equip" and "no equip". I set "no equip" up with an "incompatible_with_equipment" for "equip".

First test was trying to set a ship up that has both of these by default. Results: the ship always has "equip", never "no equip"; you never get the equipment with the "incompatible_with_equipment" tag.

Second test was buying both from the market. If "equip" was bought first, "no equip" was not available. So far so good. If "no equip" was bought first though, "equip" was still available. So you could have both on the same ship, which seems a little odd to me.

All the best,
Eldon
User avatar
Eldon
Dangerous
Dangerous
Posts: 68
Joined: Tue Jan 26, 2010 1:38 pm

Re: incompatible_with_equipment BUG

Post by Eldon »

After some inspiration from Wildeblood over in the Cabins thread I've checked out saving and loading; if you managed to get both "equip" and "no equip" on your ship, after reloading a saved game you end up with just "equip". On loading "no equip" is removed.

From this I'm guessing that incompatible_with_equipment should work totally if it's in just one piece of equipment's data, at the moment it needs to be in both to work properly.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: incompatible_with_equipment BUG

Post by Kaks »

For flexibility's sake equipment incompatibility only works 'in one direction': a can still be compatible with b even though b is not compatible with a. Some non-oxp equipment (naval/extra energy units) does rely on this arguably quirky behaviour to allow switching from one type of equipment to the other, but not the other way round... (Edit: aka a simple way of implementing upgrade paths for pieces of equipment)

In other words the behaviour you noticed - if you want a and b to be mutually incompatible with each other you need to explicitly write incompatible_with for both pieces of equipment - is there very much by design.
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Eldon
Dangerous
Dangerous
Posts: 68
Joined: Tue Jan 26, 2010 1:38 pm

Re: incompatible_with_equipment BUG

Post by Eldon »

I thought it might be a feature rather than a bug, but all the evidence started pointing in the wrong direction. :?
So is there a way of adding the incompatible tag to equipment from outside an oxp? Say I want my equipment to be incompatible with passenger berth removal, but I don't want to mess up other potential oxps that also want to be incompatible with the same thing, is that possible?

For an upgrade path, would it not be as easy to create a piece of equipment that removed itself and installed the naval energy unit when bought?

Ah well if it's not a bug I guess I'm going to have to wait till the feature freeze thaws a bit. :D
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: incompatible_with_equipment BUG

Post by Kaks »

The most noticeable effect of incompatible_with is that the incompatible equipment won't even be offered for sale to begin with...

Using js you can always detect when a piece of equipment is being bought (http://wiki.alioth.net/index.php/Oolite ... tEquipment), and add/remove the incompatible bit depending on which ship the player is using. You might have to use a missionScreen to explain to the player what's happening and why...

However it might be a bit trickier when you're buying a ship, though you can still use .playerBoughtNewShip plus a mission screen to explain that 'this particular piece of equipment was erroneusly installed on your new ship, and as we all know this means instant death for the pilot. Regulation so-and-so requires us to remove it before giving you the keys to the ship' - or something to that effect.
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
Post Reply