Just as an additional note, it appears that the syntax for the conditions in cases like this has been changed in 1.73.4. Doing a
Code: Select all
hasShipyard = ("score_number greaterthan 1");
will not work anymore. What does work is this:
Code: Select all
hasShipyard = ((1, "score_number greaterthan 1", score_number, 3, ((0, 1))));
It is quite a bit more complex than before, so I will just post here the explanation and comments given in the code as to what the above means.
The source code comments wrote:
Test a script condition sanitized by OOLegacyScriptWhitelist.
A sanitized condition is an array of the form:
(opType, rawString, selector, comparisonType, operandArray).
opType and comparisonType are NSNumbers containing OOOperationType and
OOComparisonType enumerators, respectively.
rawString is the original textual representation of the condition for
display purposes.
selector is a string, either a method selector or a mission/local
variable name.
operandArray is an array of operands. Each operand is itself an array
of two items: a boolean indicating whether it's a method selector
(true) or a string (false), and a string.
The special opType OP_FALSE doesn't require any other elements in the
array. All other valid opTypes require the array to have five elements.
For performance reasons, this method assumes the script condition will
have been generated by OOSanitizeLegacyScriptConditions() and doesn't
perform extensive validity checks.
The enumeration for opType is:
OP_STRING, // 0
OP_NUMBER, // 1
OP_BOOL, // 2
OP_MISSION_VAR, //3
OP_LOCAL_VAR, // 4
OP_FALSE, // 5
The enumeration for comparisonType is:
COMPARISON_EQUAL, // 0
COMPARISON_NOTEQUAL, // 1
COMPARISON_LESSTHAN, // 2
COMPARISON_GREATERTHAN, // 3
COMPARISON_ONEOF, // 4
COMPARISON_UNDEFINED // 5