I was trying to get a for the first time clause to work with a compound condition, like this:
Lab is a room.
the ball is in the lab.
Instead of Jumping:
now turn count is 0;
say "Turn count reset.";
Every turn:
if turn count is 0 and the player carries the ball for the first time:
say "foo";
test me with "take ball/jump/jump".
but no luck. It fires every time I jump. This seems to contradict what WI implies (but doesn’t demonstrate), which is that any condition will work:
if (…condition…) two times…
I trying using parens around the compound action and get a compile error, which also seems wrong.
Is there any way to make this work?
ETA: On second thought, I can see why this wouldn’t work. If the game is tracking when the condition becomes true rather than how many times it passes this gate in the code, it can only track conditions of objects, I imagine.
The compiler just isn’t set up to consider paretheses around conditions.
You can break out the test into a function or other testable adjective. This works:
To decide whether zero-carried-ball:
if the turn count is 0 and the player carries the ball:
yes.
Every turn when zero-carried-ball:
if zero-carried-ball for the first time:
say "foo";