“Action arguments” are the parameters passed to commands. They’re defined in the same place as conditions: when you have put players throneroom
, that actually compiles as a single opcode “put”, which is interpreted as “put the first thing referenced in a condition, into the second thing referenced in a condition”.
Since your condition is here players and flag 5 and present script
, the first thing referenced is the players, the second thing referenced is the number five, and the third thing referenced is the script. So it gets compiled into here players and NOP throneroom and…
, where NOP
is a condition that does nothing and always succeeds.
This is why adding the “continue” fixes things! Your original code:
action give script when here players and flag 5 and present script
print "message here"
put players throneroom
put script throneroom
needs to compile into something like this:
…when
here players and NOP throneroom
and present script and NOP throneroom
and flag 5
because it needs the first four parameters to be “players, throneroom, script, throneroom” in that order. From the error messages you mention, I’m guessing ScottKit is going about it an even simpler way, which gives seven conditions:
…when
NOP players and NOP throneroom
and NOP script and NOP throneroom
and here players and present script and flag 5
And this is just too many for the format to support on a single action.
When you break it up with a continue
, though, things get better!
…when here players and present script and flag 5
print message [whatever number]
continue
continuation when NOP players and NOP throneroom and NOP script and NOP throneroom
put
put
In this case, there are only four parameters involved in a single action, which is fine.
Now, this does suggest another enhancement for the compiler—it should be able to reorder conditions in order to repurpose their parameters. This would let this compile without a continue
at all, since the format supports five conditions, and here players and NOP throneroom and present script and NOP throneroom and flag 5
is five. But the details might be unpleasant; I might poke at the source and see how difficult it would be later.