Still learning-on-the-go with Inform7. I am now building a “timed puzzle” where the player has to complete the puzzle in a certain number of steps. Now the start (and also the time limit) are signaled to the player, with, say a bell ringing. Would it be logical to use the “wait” / “z” command to instead of waiting 1 turn waiting for an “interesting thing to happen”? (In case of this particular puzzle, the bell ringing so the player can make another attempt.)
Imagine for example a race track the player needs to run (to make the example more concrete). When the player arrives at the race track, no doubt they would want to spend a few turns doing something else (looking at certain very experienced testers here who might no doubt try to lick the bell), so then starting the race would need some trigger.
I considered “stepping onto the track”, but then people might step in / out / in / out and have their ears ringing from the bell clanging each time they start the race.
So to me it sounds more logical to use “wait” / “z” instead. Then when the signal is given, the player can start running. That would also allow the player to abort halfway (imagine they “run out of breath” and want to try from the beginning), and use the same “wait / z” to start afresh or do something else (more bell licking?).
Does this sound like a good way to handle a timed event? Are there other (possibly more “logical”) options I may consider?
In my game The Magpie Takes the Train, the train goes through a tunnel every 9 turns or so and stays dark for two turns.
I added a ‘skip’ command that lets time skip forward. Here’s the code I ended up with (I’ve since transitioned to using true/false variables in my coding instead of 0/1 variables):
Section 3 - Darkness Transitions
DarkCounter is a number that varies. DarkCounter is 0.
TunnelTime is a recurring scene. Tunneltime begins when DarkCounter > 8.
if the player is in Observation Car:
if TunnelTime is not happening:
now DarkCounter is DarkCounter plus one;
When TunnelTime begins:
now Observation Car is dark;
say "The train passes under a tunnel, plunging the room into darkness[first time].[paragraph break]Cornelia tuts. 'We really ought to get better lighting in here,' she says[only].";
now DarkCounter is 0;
TunnelTime ends normally when the time since TunnelTime began is 2 minutes;
SkipFlag is a number that varies. SkipFlag is 0;
TunnelTime ends abruptly when SkipFlag is 1;
TunnelFlag is a number that varies. TunnelFlag is 0.
When TunnelTime ends:
now TunnelFlag is 1;
now SkipFlag is 0;
now Observation Car is not dark;
say "The train exits the tunnel, and sunlight [if the shades are not drawn]streams in once more.[otherwise]filters weakly through the shades.[end if]";
trigger the count's notice;
if TunnelFlag is 1:
now TunnelFlag is 0 instead;
Understand the command "skip" as something new.
TimeSkipping is an action applying to nothing. Understand "skip" as TimeSkipping.
Carry out TimeSkipping:
if the player is not in observation car:
say "There's nothing to skip out here!";
stop the action;
if in darkness:
say "You wait for the train to leave the tunnel.";
now SkipFlag is 1;
say "You wait for a tunnel to darken the car.";
now DarkCounter is 9;
This was suggested by testers, and it sounds similar to what you’re describing here.
(‘TunnelFlag’ is only there to keep Inform from automatically listing the room description again when you come out of the tunnel).
Thank you both. I will go for a combination of these ideas. Add a custom command for spending some time until the player gets interrupted by something happening (“the bell ringing”). And yes I definitely want to exclude some commands from impacting the time limit (e.g. looking, examining things I can make “free”. I will check what else I need to make free, or maybe flip things around and only make “puzzle actions” not free.)
Edit: And then I find out I cannot mark both posts as the “solution”, so then I’ll mark this “combined post”.