incompatible_with_equipment

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

Moderators: winston, another_commander, Getafix

Post Reply
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:

incompatible_with_equipment

Post by Commander McLane »

This forum is called "Testing and Bug reports", so please understand this more like a test result than a bug report, because everything is working as expected. However, some scripters may have different expectations and thus may be surprised by the actual results:

The wiki (thanks, Eric) informs us about the incompatible_with_equipment-key:
requires_equipment and incompatible_with_equipment can be a single item or a space separated list of items
What I've found out by testing is that, if I use a list of items, they are combined with an AND.

So in case of the requires_equipment the item in whose equipment.plist-entry the requires_equipment-key is found will only be available if all the items from the list are already installed. (And this is what most people would expect, I guess.)

But the same is true in case of the incompatible_with_equipment-key. The item in whose equipment.plist-entry the incompatible_with_equipment-key is found will only be not available if all the items from the list are already installed. So it is incompatible only with all the specified items together.

And this was not what I was expecting in the first place (although it is logical once you think about it). I was expecting an OR-query, so that the equipment I was scripting would be incompatible with any of the items specified in the list, meaning it would not be available if any one item in the list were installed.

In my case I could get around this by a script, but I think all scripters should be aware that the incompatible_with_equipment-key, if used with a list of items, may work counter-intuitive (at least if their intuition is like mine), and the wiki should be amended to explain that.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Hmm, incompatible_with_equipment should be OR.

In fact, as far as I can see both are ORs, but the space-separated list thing is wrong: the keys each take a single string or an array of strings.
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:

Post by Commander McLane »

Oh. Will try that and report the results.

EDIT: Confirmed. An array works with OR.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Oh good. It seems to me, though, that requires_equipment should be AND. Possibly a separate requires_any_equipment?
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:

Post by Commander McLane »

Ahruman wrote:
Oh good. It seems to me, though, that requires_equipment should be AND.
Personally I would expect it to be AND, so I agree.
Possibly a separate requires_any_equipment?
Good solution.
Post Reply