[I7] PSA: converting entering action to going action

I just discovered this nasty sucker:

Most people know when you use the ENTERING action on a door, it automatically gets converted to a GOING action. What I did not realize until just recently, is that the noun of the action never gets converted at any point into a direction. Instead, ENTER DOOR is simply converted to GO DOOR, and the GOING action handles this by checking the “other side” property of the door and moving the player there.

What this means is that if you have a rule based on the direction the player is going in, the player can bypass that rule entirely by using the ENTER command. Consider these examples:

[code]The Lobby is a room. “Restrooms are to the east and west: women and men, respectively.”

The women’s room door is a scenery door, east of the Lobby and west of the Women’s Room.
The men’s room door is a scenery door, west of the Lobby and east of the Men’s Room.

Instead of going west from the Lobby, say “Why, you can’t go in there! That’s the men’s room!”

Test me with “go west / enter men’s room”.[/code]

[code]The cave mouth is an open, unopenable door, inside from the Ravine, outside from the Cave. “A dark cave mouth beckons.”

Instead of going inside through the cave mouth, say “It’s too dangerous to go spelunking without a light.”

Test me with “in / go in cave”.[/code]

Probably not a huge deal for most people. If you say “A door is to the west,” most players will probably type W rather than ENTER DOOR. But if you’ve hung an important rule on it, you have to word things carefully or else you’re opening yourself up to a headache. When you have dozens of such rules hanging on dozens of doors and your game is, uh, just for the sake of example, a commercial release, it can be a major headache.

By the way, this is easily patched with the following rule:

Rule for setting action variables for going (this is the set direction when converting from entering rule): if the noun is a door: if the location of the player is front side of the noun or the location of the player is the back side of the noun: let D be the direction of the noun from the location of the player; now the noun is D.

Yes, that is sticky.

When you write a door rule, you absolutely want to test both compass directions and ENTER DOOR for all cases.

The manual-suggested way of writing a door rule is

Instead of going through the women's room door, ...

This catches all commands.

…and if your rule hinges on a direction, make sure you specify the room gone from and/or the room gone to as well, because “east through the women’s room door” will fail if the player types ENTER.

Thank you so much for pointing this out. I’m sure I have a number of situations like this.

This took me a second to figure out. You’re talking about the situation where the rule looks like

Instead of going east through the women's room door, ...

Right? To block the door from one side only?

I would write this as

Instead of going from the Lobby through the women's room door, ...

Yeah, that’s basically what I was trying to say.