If you want the rule to fire for the player and for NPCs, you should write “After an actor entering the box.” (And you’ll want to make that “have” adaptive so it doesn’t print “You has entered the box.”)
The rule that prints that message is actually pretty easy to adapt for your case:
Report an actor opening (this is the reveal any newly visible interior rule):
if the actor is the player and
the noun is an opaque container and
the first thing held by the noun is not nothing and
the noun does not enclose the actor:
if the action is not silent:
if the actor is the player:
say "[We] [open] [the noun], revealing " (A);
list the contents of the noun, as a sentence, tersely, not listing
concealed items;
say ".";
stop the action.
Just replace the first “if the actor with the player” with “if the noun is visible” and put an “otherwise” clause in the innermost if to print a third-person message and you should be good to go.
[code]Report an actor opening (this is the new reveal any newly visible interior rule):
if the actor is the player and
the noun is an opaque container and
the first thing held by the noun is not nothing and
the noun does not enclose the actor:
if the action is not silent:
if the noun is visible:
say "[if the actor is player][We] [open][otherwise][actor] opens[end if] [the noun], revealing " (A);
list the contents of the noun, as a sentence, tersely, not listing
concealed items;
say “.”;
stop the action.
The new reveal any newly visible interior rule is listed instead of the reveal any newly visible interior rule in the report opening rules.[/code]
This doesn’t seem to work, it gives me problems along the lines of:
I suppose it could be worked around if I edited the actual default rulebook itself, but that’s a bit of an ugly solution if I want to share my source for example. Any solutions?
No problem doing this with 6G60, anyway. Just find the “reveal any newly visible exterior” rule in the 6G60 Standard Rules (just go to Open Extension and the Standard Rules should be listed under Graham Nelson), copy that rule out, modify it as you want, and substitute it in. The way you do that is you label your new rule “(this the the reveal any newly visible exterior for anyone rule)” or something like that and then write “The reveal any newly visible exterior for anyone rule is listed instead of the reveal any newly visible exterior rule in the report opening rulebook.” (I think; haven’t checked the syntax.)
Report an actor opening (this is the reveal any newly visible interior rule):
if the actor is the player and
the noun is an opaque container and
the first thing held by the noun is not nothing and
the noun does not enclose the actor,
stop the action with library message opening action number 4 for the noun.
That last line is giving me a bit fo trouble, though. I suppose I should go about editing the “library message opening action number 4”?
Well, you could use one of Ron Newcomb’s extensions (Default Messages or Custom Library Messages), but if you’re rewriting the rule for your own project it’s just as simple to write your own message – you can see what it looks like in the 6L02 rule, but you have to put in “You” for “[We]” (or in the case where the actor isn’t the player, you write “[The person asked]”).
How do I make it so that a room is dark to only a specific person? Let’s say they’re wearing a blindfold for instance. I don’t quite grasp how to mess with the visibility rules.
I think it’s probably okay if it’s just the player. I’ve got some AI behaviour depending on them seeing things, but it’s very simple to work around that without messing with their visibility rules.
Oh well that’s hard. I don’t think the visibility rules actually get checked for NPC actions, so you have to do something else that just interrupts the action when the NPC is blindfolded, and you can write a visibility rule (see 12.19) for the player. There will be a lot of stuff to deal with, though. Here is an example:
[code]Lab is a room. Jane is a woman in Lab. Alice is a woman in Lab. The player is Alice. Alice wears a blindfold.
Persuasion rule: persuasion succeeds.
Definition: a person is blindfolded if it wears the blindfold.
Visibility rule when the player is blindfolded:
there is insufficient light.
After deciding the scope of the player: place Jane in scope.
Report Jane examining the player: say “Oh my.”
Before a blindfolded person doing something when action requires light (this is the blindfolded people can’t see rule): say “[The person asked] is blindfolded and can’t see!” instead.
Test me with “look/x jane/jump/jane, x me/remove blindfold/look/jane, x me/jane, jump/drop blindfold/jane, wear blindfold/jane, x me/jane, jump”.
Unsuccessful attempt by Jane doing something: say “[The person asked] was unable to do that because of [the reason the action failed].”[/code]
Output:
Note that, as discussed in 12.19, changing the visibility doesn’t actually affect looking–you’d need a special case for that. Also, the report rules for Jane’s actions will run even if you’re wearing the blindfold. But the rules for Jane wearing the blindfold prevent her from doing the stuff that requires light and not the stuff that doesn’t–the key here is the phrase “action requires light.” (I’m not sure why “Procedural rulebook” is listed as the reason the action failed.)
BTW you can probably post these as separate threads and you’ll get more response – you can tag them “6G60” in the subject heading.