I am attempting to use the following code as part of a larger story but it seems that inform is unable to understand At with a time that varies.
Sunrise is a time that varies. Sunrise is 9 AM.
At Sunrise:
say "The first rays of sun shine over the horizon."
However I get the following error message as it seems inform does not recognize sunrise as a description of a time.
Problem. You wrote āAt sunriseā (line 153): but āatā what time? No description of a time is given, which means that this rule can never have effect. (The convention is that any rule beginning āAtā is a timed one. The time can either be a fixed time, as in āAt 11:10 AM: ā¦ā, or the time when some named event takes place, as in āAt the time when the clock chimes: ā¦ā.)
What I am trying to accomplish is to have a variable sunrise that I can change each season or even each day to change when outdoor rooms are provided light from the sun (by moving the sun backdrop which is lighted to all outdoors rooms), so I donāt just want it to be At 9AM:.
Is it simply impossible to use At with a time that varies (that isnāt a scene) or is there something Iām missing with the syntax? If it isnāt possible is a scene the only work around or what other ways could I achieve this?
The compiler doesnāt seem to want to accept a variable in that place. One workaround would be:
"Sunrise"
Place is a room.
Sunrise is a time that varies. Sunrise is 9 AM.
When play begins:
sunrise occurs at sunrise.
At the time when sunrise occurs:
say "The first rays of sun shine over the horizon."
See WWI 9.11 Future Events for more. As described there, timed events can be rescheduled at will during story execution. For example:
"Sunrise"
Place is a room.
Sunrise is a time that varies. Sunrise is 9 AM.
When play begins:
sunrise occurs at sunrise.
At the time when sunrise occurs:
say "The first rays of sun shine over the horizon."
After waving hands:
now sunrise is the time of day plus one minute;
sunrise occurs at sunrise.
Test me with "z / z / z / wave / z / z / wave / z".
Note also that the āAt ā¦ā event system isnāt really set up for recurring events like you seem to be writing. It also canāt set up events more than 24 hours into the future (since you canāt specify ātomorrowā or anything like that). Itās probably more versatile to use a rule like this:
Sunrise is a time that varies. Sunrise is at 9:05 AM.
Currently-Daytime is a truth state that varies. Currently-Daytime is initially false.
Every turn when the time of day is after Sunrise and Currently-Daytime is false:
say "Rise and shine";
now Currently-Daytime is true.