Delayed actions

Is there a way to tell Inform to do something only when something has been in a certain state for a certain number of turns? Like “When Crackers has been adoptable for three turns/minutes if…begin, etc” (which doesn’t work)? Instead of “Every turn when Crackers is adoptable” (with “change Crackers to unadoptable” at the end of the action) which is how I have it now, but that means it happens in the same turn Crackers becomes adoptable and I’d rather there was a delay.

I saw the example in the documentation about starvation (“MRE”) but I’m wondering if there’s a way to tell Inform to just delay an action for a set number of turns, with the player able to perform actions in the meantime. Thanks. :slight_smile:

I’m not sure what you mean. The example you site does have a delay (starvation doesn’t occur until three minutes after hunger resumes). Here are two more stripped down examples, with slightly differing effects. If you want something to happen if something has been in a particular state for a certain amount of time (as you initially stated):[code]The Lab is a room.
The timer is a device in the lab.

Every turn:
if the timer has been switched on for three turns:
end the game saying “Boom!”.

test me with “turn timer on / z / turn timer off / z / turn timer on / z / z / z”.[/code]In this case the timer must be continuously on for three turns to set off the “boom.” Note that I just used a device because it already has the “switched on/off” property built in (as well as automatically responding to the corresponding action). You could adapt this for any property.

If you just want a timing delay which is unaffected by the player’s subsequent actions:[code]The Lab is a room.
The timer is a device in the lab.

After switching on the timer:
the boom occurs in three turns from now;
continue the action.

At the time when the boom occurs:
end the game saying “Boom!”.

test me with “turn timer on / z / turn timer off / z”.
[/code]HTH :slight_smile:

Got it, thanks! :mrgreen: