Question on doors automatically being opened

Example 7 in the manual (called Starry Void) gives some code to handle the booth being opened:

Before going through the closed magician's booth: say "(first opening the door of the booth)[command clarification break]"; silently try opening the booth.

However, from what I can see this is the default behavior that happens even without that code in place. Was this something that changed in Inform but was not updated in the manual or am I missing some nuanced aspect of how this is supposed to work?

The only difference I can see is that the text in the example is different from the default. The default parenthetical you get is “(first opening the magician’s booth)” whereas the new text is obviously “(first opening the door of the booth)”. Clearly though the example is trying to show more than just changed text. The wording in the manual is:

“A final nice touch, if we’re so inclined, is to borrow from the Basic Actions chapter and make the player automatically open the booth door before trying to enter:”

That wording makes it seems like this would not happen at all without the rule in place.

Interesting. I didn’t think I7 handled implicit opening of doors (at least without the Implicit Actions extension), but it does.

I imagine it’s a 6L02 feature that hasn’t been added to the manual yet.

I looked at the release notes here: inform7.com/learn/logs/6L02.txt

I didn’t see anything specific about this, although there are some of notes about door handling and a bit on implicit actions, although it seems mostly for taking.

This actually was already in 6G60 (and I think that was the first time it was in there); the 6G60 can’t go through closed doors rule looks like this:

Check an actor going (this is the can't go through closed doors rule): if the door gone through is not nothing and the door gone through is closed: issue library message going action number 28 for the door gone through; [that's "(first opening the door or whatever)"] silently try the actor opening the door gone through; if the door gone through is open, continue the action; stop the action.

I think the Starry Void code does change the message slightly; if not for that rule it would say “(first opening the magician’s booth),” since “the magician’s booth” is the name of the door. But you’re right that this is confusing. It should be filed as a documentation bug.

In fact it was new in 6E59 (naturally, since 6G60 was a bugfix release for 6E59 if I remember correctly); this is from the release notes for 6E59:

I know this is an ancient thread, but I’ve searched and searched and searched and I cannot figure out how to suppress this behavior. I’m brand new to Inform and struggling. If the player tried to go through a closed door, I just want it to say “The door is closed.” and stop the action. I don’t want the game to automatically open or unlock doors, etc. How can I instruct it to do this?

[EDIT: My suggestion doesn’t work for doors, but is about rule-overriding in general; see @DeusIrae 's reply for the actual answer]

I don’t have Inform 7 installed at the moment, so I can’t test, but…

Run the game in the IDE and type RULES to turn rule tracking on. Then try opening the door and looking at the rules it lists. There will probably be something that applies like
“the implicitly open closed door rule applies” (something like that, it’s been a while!)

You can quash that globally with a line naming that rule like

The implicitly open closed door rule does nothing.

or specifically with

The implicitly open closed door rule does nothing when the noun is the red door.
(or it might be)
The implicitly open closed door rule does nothing when the door understood is the red door.

(This is an example, I don’t know the exact rule name which is what the RULES command is for!)

You may have to search the index to determine which rule, but most default rules in Inform 7 are well-described purposefully for this reason.

(This is why authors are encouraged to name specific new rules created in complicated games like “This is the can’t fly while carrying a boulder rule”…otherwise that rule would just be listed as “The check flying rule” of which there could be multiples.)

1 Like

Sadly it’s a little more complex in this case, because the relevant rule (the can’t go through closed doors rule) doesn’t just handle the implicit open action, it also, per its name, blocks movement through closed doors. So if you disable the rule, the player will be able to walk through closed doors. It’s an easy fix to just swap the standard version of the rule for a simple one that just blocks the movement, though:

The revised can't go through closed doors rule is listed instead of the can't go through closed doors rule in the check going rulebook.

Check an actor going (this is the revised can't go through closed doors rule):
	if the door gone through is not nothing and the door gone through is closed:
		Say "The door is closed.";
		stop the action.

2 Likes

What Mike said. Sorry I don’t have I7 available or I would have checked. Simpler rules can be overridden like I described but this one is more complicated.

Thanks @DeusIrae !

1 Like

I must be doing something wrong.
I copy/pasted all of that into my source, but I notice no change.

Here’s all of my code (just playing, trying to learn):

"ASH2020"

Include Vorple by Juhana Leinonen.
Include Vorple Notifications by Juhana Leinonen.
Include Hiding Under by Eric Eve.
[Include Implicit Actions by Eric Eve.]

Include Locksmith by Emily Short.
Include Basic Help Menu by Emily Short.
Use American dialect.
Use the serial comma.
Use scoring.
Use undo prevention.

The story title is "ASH2020".
The story author is "AmmoSeek.com".
The story headline is "A game".
The story genre is "".
The release number is 0.
The story creation year is 2020.

Release along with an interpreter.

The display banner rule is not listed in the startup rulebook.

The revised can't go through closed doors rule is listed instead of the can't go through closed doors rule in the check going rulebook.

Check an actor going (this is the revised can't go through closed doors rule):
	if the door gone through is not nothing and the door gone through is closed:
		Say "The door is closed.";
		stop the action.

Front Porch is a room.  "You're standing on the front porch of a single-family home.  The house has a brick facade, windows with black shutters, and an attractive red door with a wrought iron handle. Behind you, to the east, is the front yard which slopes down into the street."

door mat is in front porch.  the description of door mat is "It's a standard black rubber mat for wiping your feet off."

the door key is a thing.
The door key is hidden under the door mat.

The front door is a door.  The description of front door is "The front door appears to be freshly painted red."

Front door is closed and locked. Front door is west of Front porch.


The foyer is west of the front door.

and here is the output:

Front Porch

You're standing on the front porch of a single-family home. The house has a brick facade, windows with black shutters, and an attractive red door with a wrought iron handle. Behind you, to the east, is the front yard which slopes down into the street.

You can see a front door and door mat here.

> w

(first opening the front door)

(first unlocking the front door)

You lack a key that fits the front door.

>

Oh, that’s because you’re using the Locksmith extension, which already changes a bunch of the standard rules. I’ll try to look at the documentation later to see how you’d make this tweak to that extension if no one else has sorted it in the meantime.

Thanks, Mike, that gives me a clue to go investigate the docs for that extension. Appreciated.

Ok, simply commenting out that extension did the trick. Now I need to remember why I included that extension, if I really need it (and if so, how to get the behavior I want out of it without the implicit actions).

Many thanks for the pointer!

-Mike

1 Like

Just to close the loop on this, the process Hanon describes works perfectly for IDing and disabling the rule in Locksmith that implicitly opens closed doors – you can just add this line:

The opening doors before entering rule does nothing.

(You’d also need to include the code I mentioned above to get rid of the standard rules’ implicit open – I’m guessing the awkwardness here is because, per the thread above, it looks like the implicit open was added to the standard rules later on in the life of Inform).

Glad this has been helpful!

1 Like