I’ve got an ice cube. I want it to melt, but not right away. The player needs to put it on the windowsill, then the ice melts in five turns. Here’s a small snippet of what I have, though I don’t know if there’s a simpler way to go about it:
A cubecount is a number that changes. Cubecount is 5.
Place is a room.
An ice cube is in Place.
A windowsill is a supporter in Place.
Every turn when the cube is on the windowsill:
now cubecount is cubecount - 1.
I know that if I do this, the cubecount will eventually go into negative numbers, which is not something I want. I want the cubecount to stay at 0 once it gets there. And of course, I’d need some sort of notification once the cubecount hits 0 to let the player know that the cube has melted.
I also have a similar issue where after the player performs a specific action, they only have a limited number of turns to complete another action in order to keep from dying.
Cubecount is a number that varies. Cubecount is 5.
Place is a room.
A windowsill is a supporter in Place.
An ice cube is on the windowsill.
Every turn when the ice cube is on the windowsill and cubecount > 0:
now cubecount is cubecount - 1.
This sounds like a good use case for timed events! Optionally with Cleared Events since I usually end up needing it when I use timed events.
[code]The windowsill is a supporter.
After putting the ice cube on the windowsill:
say “It heats up and begins to melt; it will be nothing but water soon.”;
the ice cube melts in five turns from now.
At the time when the ice cube melts:
say “The ice cube melts away into water.”;
remove the ice cube from play.
[ To be able to cancel the melting, you can change the remaining time with “the ice cube melts never”… ]
Include Cleared Events by Daniel Stelzer.
The freezer is a container.
After inserting the ice cube into the freezer:
say “It solidifies again into a hard piece of ice.”;
the ice cube melts never.[/code]
Another thing that usually works for me is right-clicking on the “Raw” button and choosing “Save File As…” (or whatever it is on that browser and OS). That seems to automatically save it as an .i7x.