The following doesn't work (since the "if in darkness" test fails -
presumably because the player has not yet been moved to the special room,
"the dark"):
After switching off the power switch:
now the control room is dark;
now the wormhole is closed; [it's a kind of door]
say "The wormhole disappears";
if in darkness then say ". Unfortunately, it was also lighting the room";
say "."
The "if in darkness" bit is just in case there is another source of light
(the player carrying something lit, etc) - but I don't want to just say "if
the player has something lit or something lit is in the room", because it
may still miss something.
Thanks,
David Fisher
(2) Drop to I6:
To decide whether blackness: (- (~~Offerslight(parent(player))) -).
Then you can say "if blackness...".
No testing has been done. Use at your own risk. ;-)
Excellent, thanks ...
How did you discover the "adjust light" rule, by the way ? The only mention
I can see is in the Standard Rules themselves, not in the documentation
anywhere (or in any of the generated "Index" tabs). Turning on "actions" and
"rules" only produces:
[switching off power switch - succeeded]
[Rule "After deciding the scope of the player" applies.]
It is now pitch dark in here!
- and doesn't mention the "adjust light" rule (or the "turn sequence" rule
which calls it in the Standard Rules).
So how do you locate these kinds of rules (and their documentation) ? Is
their another way to turn on debugging I haven't come across yet ?
David Fisher
That was one of the things I tried, but no luck ... at that point in the
code, the player hasn't yet been placed in "the dark" (a special room) and
the old lighting conditions still apply.
David Fisher
Luck. I remembered seeing (in the section on first and last rules) an
offhand comment that the last turn sequence rule was to check darkness.
So I looked through the standard rules for the turn sequence rules, and
that seemed to be the relevant one.
> So how do you locate these kinds of rules (and their documentation) ? Is
> their another way to turn on debugging I haven't come across yet ?
In general, I have no idea. I would like to know this, too, for better
control of where to insert new rules. Knowing I6 helps a bit, since the
turn sequence is built on the I6 world model, so it could be helpful to
look at the DM4 (somewhere, I forget where, it explains the sequence of
steps during a turn). The appendix on Library Routines can also be
useful if you want to include inline I6 code (things like
"OffersLight()" are discussed there).
It would be nice to have more extensive documentation of the standard
rules; perhaps once I7 has stabilized this will be included or someone
else will write some.
-JDC
Thanks again for that. I guess things can always be traced through the code
...
* Inform7/Extensions/Graham Nelson/Standard Rules:
The last turn sequence rule:
...
consider the adjust light rule
The adjust light rule corresponds to routine TS5_R.
* Searching for this finds Inform7/Extensions/Reserved/Processing.i6:
[ TS5_R; AdjustLight(); rfalse; ];
* Which is defined in the Inform 6 library in Library/Natural/parserm.h:
[ AdjustLight flag i;
i=lightflag;
lightflag=OffersLight(parent(player));
...
OK ! Here it is at last.
At least there is a "last resort" way of finding these things out, then ...
The other place things can be hidden is in the "IN" compiler itself (which
seems closely tied with the Standard Rules file), but it looks like most
stuff is exposed and potentially understandable by reading the library
files.
David Fisher