Skip to reading
Text & Sierra-Style Adventures

25. Unlocking and opening are separate actions

Edition 0.86.3.4

Build a complete text or graphical parser adventure with typed commands, inventory puzzles and press-to-walk controls.

Download PDFView illustrations

Try OPEN DOOR while the door is locked. The reply should point you toward the key. Then use USE KEY ON DOOR. That changes ta_unlocked and awards two points. It does not enter the cabin automatically.

Figure 16. The reply confirms the state change and tells the player the next useful action.

1. Type USE KEY ON DOOR while carrying the key. Expect the unlock reply.

2. Type it again. Expect “already unlocked,” with no extra points.

3. Type NORTH while the door is still closed. You should be stopped.

4. Type OPEN DOOR. The door becomes open.

5. Type NORTH. The player enters the cabin.

The two flags matter. ta_unlocked answers “Does the lock allow opening?” ta_door_open answers “Is the route open right now?” Reusing one flag for both questions makes later CLOSE DOOR behavior awkward.

The room model disappears when this example’s door opens. A finished game can play an opening animation instead, but that animation should follow the same state change.

Page 28 of 68Permalink
Go to page