Native Time Control

version 1 by Tim Pittman

Documentation

This extension allows the author to control time in a fashion that is native to Inform 6 (hence the name). This extension is super small, as it does not create new rules or variables, but uses rules and variables already built into Inform 6. While looking through the documentation of the template layer of Inform 7, I found that the advance time rule is coded so that time (minutes) can pass by at different rates if a variable was set. Graham Nelson also made a comment about how he think this will be used in the future. Well here it is!

In order to change the speed of time, use:

When play begins:
change the speed of time to 2.

This phrase doubles the speed of time. Now, every turn, two minutes will pass. Changing the speed of time to 3 will make 3 minutes pass per turn. To restore the speed of time back to normal, change the speed of time to 1 or use:

restore the speed of time to normal.

Also, if you have a "Timeless Void" you can use the following phrase:

After looking while the location is the Timeless Void:
stop time.

This phrase essentially sets the speed of time to 0. That's speeding up time; now you can put the phrase "time flies when you're having fun" to literal use! Now about the converse of that statement, "time drags when you're bored":

After examining the clock:
say "Time seems to slow as you watch the second hand tick...";
change the speed of time to -2.

This statement, despite looking like it puts time in reverse, actually slows time. Built into the advance time rule is a function that takes a negative number and makes it so that the negative of that number is how many turns passes BEFORE it advances time. In other words, if you say "change the speed of time to -2", you are actually saying "wait 2 turns before advancing time by 1 minute". So when the speed of time is -2, time will advance on the 2nd turn. If the speed of time is -3, time will advance on the 3rd turn. As a result, we can use:

the number of turns before time advances

This variable can only be read. If we are slowing down time, this will tell us how many turns are left before the clock flips to the next minute. If the number of turns before time advances is 1, then the minute will change at the end of that turn (Note: the advance time rule takes place after the action has occurred and when the number of turns reaches 0, the number immediately jumps back up to negative the speed of time.). If the number of turns is ever 0, then time is moving forward at a normal or advanced rate (read, the speed of time is positive).

Note: When the speed of time is -1, then time will move forward just like the speed of time is 1. However, the number of turns before time advances will always be 1 when the speed of time is -1, and the number of turns will always be 0 when the speed of time is 1.

Finally, this extension also creates the following tests to use in if statements:

if time is slow...
if time is fast...
if time is normal...
if time has stopped...

if time is not slow...
if time is not fast...
if time is not normal...
if time has not stopped...

The "not" statements may seem redundant, but they test for different things. The phrase "if time is slow" is not the same as "if time is not fast" because not being fast means that it could be normal or stopped as well as slow. The "not" statements test the opposite of the not "not" statements. (Try saying that five times fast). Also note that "if time is normal" is true if the speed of time is 1 or -1, because either one has the same effect on the clock.