Check if we just went "out" a door?

I have an open, unlocked, scenery door set up between two rooms and the In and Out directions allowing travel through the door. The door is between a hallway and an elevator (room).

When the player exits the elevator with the Out command, I want the elevator to close and lock behind them. I’ve tried this (and many other things) to no avail, and receive Problem halt when I try it:

After going out from the elevator door: say "A moment later, the elevator door closes."; now the elevator door is closed; now the elevator door is locked; continue the action.

It’s the “going out from” line that’s causing the Problem. Using “After exiting” also errors out.

In an attempt to figure this out, I’ve also tried to have something print when the person enters the elevator (door) which works when they issue the command “go in elevator” but not “in” by itself. I wanted this message to print (and some other code to execute–this is just an example) even when the player simply went the “In” direction:

After entering the elevator door: say "Now you're in the elevator." continue the action.

I know I’m missing something crucial in not just my code, but also my understanding (of how interposing doors work).

Please help.

The direction is called “outside”. (“In” can also be a preposition, so the direction became “inside”, so the opposite is “outside”.)

Something that often helps in situations like this is to go back to the most recent version of your game that you can compile successfully, start running it, and type “actions” before you enter your commands.

So:

The elevator is a room. The lobby is a room. Some sliding doors are a door, outside from the elevator and inside from the lobby. 

will give you

which tells you that the action was “going outside.” (“Going” is the name of the action and the direction, “outside,” is the noun.) Then you can write your rules for going outside.

Another thing to keep in mind is that, while the player can often type many different commands to achieve a certain action, there’s usually only one way to refer to them in the source code, and it’s often not the most natural way to refer to it in the game. One that often gets people here is that when you type “put the lime in the coconut” the actual action is “inserting the lime into the coconut.” Again, the “actions” command can help here.

Also also, in this case you’re going to have to type “After going outside through the sliding doors:”. This isn’t any general principle, it’s just the way that the “action variables” for the going action are defined in the Standard Rules–that is, the things you can talk about in the action besides the noun. “From” means the “room gone from,” “through” means the “door gone through.”

Draconis and matt w: Super helpful. Thanks!

Is there a master list of the built-in actions somewhere (perhaps with their grammar, like the “going through”) or is the best bet to just use the “actions” command stated above every time I run into this?

Yes. If you click the “Index” tab, and then click “Actions,” you’ll see all the actions, and you can select them individually to see the commands that lead to them. (You have to have compiled at least once, otherwise it’ll be blank.)

Nice. Thanks!

As bg said, the Index is incredibly useful and covers most of what you want to go, but in this case there is a bit more. If you find the going action and click on the magnifying glass you see something like this (spoilered for excessive length):

The things we’re interested in here are things like the “room gone from” and “door gone through.” But by itself this doesn’t tell you that you can actually write “After going through the elevator door:” or something like that. In order to see that you can do that, you can look in the Standard Rules (go to the “File” menu, find “open installed extension,” and then find the Graham Nelson directory–the Standard Rules are in there; it might be a little different on non-Macs). Here you can find these lines:

The going action has a room called the room gone from (matched as "from"). The going action has an object called the room gone to (matched as "to"). The going action has an object called the door gone through (matched as "through"). The going action has an object called the vehicle gone by (matched as "by"). The going action has an object called the thing gone with (matched as "with").

It’s those “matched as” lines that tell Inform what “going from,” “going to,” “going through,” and so on mean. So when you say “going through the elevator door” it basically means “going when the door gone through is the elevator door.”

Honestly, I think those “matched as” things should certainly show up in the Index too. I’m going to put a suggestion about that in Uservoice.

EDIT: Suggestion posted.

Thanks again matt w. Great info that should help a bunch of us just getting started.