I'd like to be able to set up a playership to auto-omni any single-slot, non-multi-slot weapon. This is currently not possible with device slot criteria. Being able to specify locations and enhancements (or lack thereof) for heavy weapons gives significant flexibility to ship designs.

the_shrike 12 Oct 2018:

(Making this more general would also allow things like excluding two-slot howitzers from an autoloader, or making something that specifically improves heavy weapons)

the_shrike 2 Nov 2018:

Bumping as per request on stream: this is required for my implementation of the Sotho-class as a playership in Elemental Shift.

assumedpseudonym 2 Nov 2018:

 Minor addendum: Being able to check for any property with something other than a true|nil value — +property:deviceSlots:1 or even something like +property:speed:100 or the like — would be nice, too (although at that point, you probably need to start being able to check for numeric ranges).

nms 2 Nov 2018:

For flexibility, maybe criteria strings could specify a lambda function that will be called on the items/objects/types being checked (after they pass the other checks for performance reasons). This would allow for Boolean logic and checking non-Boolean properties like this one.

E.g.:

<DeviceSlot criteria="w +lambda:myFunction;"/>

<Globals>
	(setq myFunction (lambda (theItem)
		(leq (itmGetProperty theItem 'deviceSlots) 1)
		))
</Globals>
george moromisato 9 Dec 2018:

@AP and @NMS: I'm torn: On the one hand adding lambdas to criteria could unblock a lot of use-cases. On the other hand, something like AP's suggestion would execute faster and would be more intuitive for simple cases (like this request).

For example, I imagine something like:

criteria="w +property:deviceSlots=1"
criteria="w +property:deviceSlots>1"
criteria="w +property:deviceSlots<=2"
etc

[Of course, the fact that this is embedded in XML means we'd have to escape the greater/less-than operators.]

In contrast, using lambdas—even if embedded—would be more verbose:

criteria="w +lambda:(lambda (theItem) (gr (itmGetProperty theItem 'deviceSlots) 1));"

I'll probably try implementing the first and later allow lambdas.

george moromisato 10 Dec 2018:

In 1.8 Beta 4 I added the syntax described above. NOTE: Do not add spaces around the operators and make sure you use &gt; and &lt; as appropriate.