Using time to change an items status

Am creating my first story and have read through the whole documentation and tried every example i could find but am still having issues.

Instead of touching button: say "You push the button, and the light turns on."; change light to on.

What I am trying to do is set a time limit so the light turns back off after say 3 minutes / turns (‘change light to off’). No matter what i try it either errors out, or the one attempt that didn’t it never reset it back to off unless the player touched the button again.

Seems like this should be something easy, but thought I would ask.

Thanks for any help!

Hey Grower, welcome!

Depending upon what you want to achieve, there are at least a few different ways to do it. Here’s one (see ch 9.11. Future events):

[code]The Lab is a room. The flashlight is a device in the lab. The flashlight can be dead or good.

Check switching on the flashlight:
if the noun is dead,
say “The battery is dead!” instead.

After switching on the flashlight:
the battery dies in three turns from now;
continue the action.

At the time when the battery dies:
say “The flashlight flickers out. I guess the battery died.”;
now the flashlight is dead;
now the flashlight is switched off.

test me with “get flashlight / turn it on / z / z / z / turn it on / turn the flashlight off”.[/code]

Thanks, i had read the doc example, but I guess I was trying to combine the naming of the action and the definition of the action into one. “change the light in three turns from now;” is what I had been trying before.

Thanks so much! I may be back, but so far I have figured all my issues I have come across out. :slight_smile: