Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[I7] About to be in the dark

0 views
Skip to first unread message

David Fisher

unread,
May 23, 2006, 3:41:26 AM5/23/06
to
How do you detect if the player is about to be plunged into darkness ?

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


JDC

unread,
May 23, 2006, 4:22:23 AM5/23/06
to
Two ways I can see:
(1) You can "consider the adjust light rule". This will print the
message "It is now pitch dark in here!" by default (when it is dark),
but you can could change this with a rule for printing the announcement
of darkness. After that, "if in darkness" should be correct.

(2) Drop to I6:
To decide whether blackness: (- (~~Offerslight(parent(player))) -).

Then you can say "if blackness...".

constantl...@gmail.com

unread,
May 23, 2006, 5:00:11 AM5/23/06
to
Here is a condition that I believe might work:
if the player can see something lit ...

No testing has been done. Use at your own risk. ;-)

David Fisher

unread,
May 23, 2006, 7:51:07 PM5/23/06
to

"JDC" <jd...@psu.edu> wrote in message
news:1148372543....@j73g2000cwa.googlegroups.com...

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


David Fisher

unread,
May 23, 2006, 8:26:09 PM5/23/06
to
<constantl...@gmail.com> wrote in message
news:1148374811.8...@j33g2000cwa.googlegroups.com...

> Here is a condition that I believe might work:
> if the player can see something lit ...
>
> No testing has been done. Use at your own risk. ;-)

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


JDC

unread,
May 23, 2006, 8:41:07 PM5/23/06
to

David Fisher wrote:
>
> 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).

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

David Fisher

unread,
May 23, 2006, 9:15:00 PM5/23/06
to
"JDC" <jd...@psu.edu> wrote in message
news:1148431267.3...@i40g2000cwc.googlegroups.com...

>
> David Fisher wrote:
>>
>> 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).
>
> 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.

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


0 new messages