I7: Timers

If a timer is clucking, is there a way to determine the current status? I have an elevator which takes some time to reach its destination, and I’d like to display the current floor. Could do this manually, but I assume there’s a way to read the current timer status.

Are you asking about a real-time event (Glulx only), or about a turn counter?

–Erik

Sorry - turn counter (“the timer clucks in X turns from now”).

Any idea, anyone?

As far as I know, you can’t read a timer directly. Inform understands references to the time since some past event or scene transition, but not the time until a future event.

You’ll probably have to introduce a new variable or state by hand…and as long as you’re doing this, you might take the opportunity to replace the timer altogether, instead of having two parallel schemes for keeping track of the elevator’s progress. Something like:

every turn when the elevator is ascending:
   increase the floor of the elevator by one;
   if the floor of the elevator is the target floor of the elevator:
      say "Ding!  You feel light for a moment as the elevator comes to a stop.";
      now the elevator is not ascending;
      [Do stuff here to open the door and link it to correct room];

The description of the indicator lights is "The light for floor [floor of the elevator] shines dully."

The extension Phrases for Adaptive Pacing has all sorts of things for timers and related constructs.

It sounds like a scene would be more suitable here. (“If the time since elevator ascension began is 3 minutes…”)