Doors open automatically

One last question: How do I make a closed door not open automatically when someone tries to go in that direction? In the game I’m working on, going through said door ends the game, and I wouldn’t want the player to get mad because he didn’t notice it was closed.

You’ll want to change the “can’t go through closed doors” rule; that’s the rule that tries to open the door if it’s closed. I think this should work:

[code]Check an actor going (this is the old-school 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 gone through] is closed.”;
stop the action.

The old-school can’t go through closed doors rule is listed instead of the can’t go through closed doors rule in the check going rulebook.[/code]

(I’m not entirely clear on your rationale, though; if the players want to go through and the door can be opened, why would they be annoyed because they hadn’t noticed that it was closed? Is it something like, when you open the door you see that outside is boiling hot lava, so you don’t want them to be able to go through the door without first getting the warning that comes when they open it?)

Well, if you must know, I’m actually making this game for my sister. She hasn’t played any IF before, and she might not notice the “there is a door here, which is closed”.

Comedy is when a person expects a door to open for them, and it doesn’t, and they walk into the door. At least for onlookers.

This might be a good case for an Instead rule, which you could apply just to the relevant case without messing around with the standard check rules:

[code]Warm Place is a room. The basalt door is a door. It is west of Warm Place and east of Lava Pit.

Instead of going from Warm Place to Lava Pit when the basalt door is closed:
say “The door feels hot. You might want to open it and see what’s on the other side before you walk right through.”;

Every turn when the location is Lava Pit:
say “You slide into the molten lava!”;
end the story saying “You have been burned up.”;

Test me with “w/open door/w”[/code]

Which reminds me: I played Leather Goddesses of Phobos a dozen times before accidentally typing WEST while in the Observation Room.

Having grown up in the days when you had to open all doors manually (after trudging six miles through the snow barefoot, etc.), I had totally forgotten about the “open doors automatically” rule and as a result almost missed a major bug in my Code. I have a room which can only be entered via an (intially closed) door from a corridor. The room contains an NPC, and my intention was that if the player enters the room while the NPC is there, the NPC kills him. (This takes place inside what the player knows to be the enemy stronghold, and he has been put on notice to tread carefully, so I don’t view the insta-kill as unfair in this context). The “correct” way to play it (i.e., the way which keeps the player alive) is to open the door first, whereupon you see the NPC; if you then keep watching for a few turns he leaves the room and the player can safely enter.

Having written the code for this, I tested it both with the player entering while the NPC was there (in which case he died) and with the player waiting for the NPC to leave. However, in both cases I only entered after manually opening the door. When a friend was doing some quick-and-dirty playtesting, he tried entering the room with the door closed, so the auto-open rule kicked in. It turned out that when you did that, it let you into the room without having the NPC kill you! When it was pointed out to me I fixed it, but the habit of opening doors manually was so ingrained that I never even thought of trying to go through a door that I was told was closed.