22. Build the key pickup
Figure 15. The pickup adds an inventory item, then remembers that the reward was collected.
| Node role | Type and settings |
|---|---|
| Start | On Interact; verb take. |
| Check Taken | If Variable; key_taken equals true. |
| Already Taken | Show Message: I already have the key. |
| Give Item | Add Inventory; brass_key_item; count 1. |
| Remember | Set Variable; key_taken = true. |
| Hide Scene Key | Hide / Unhide Object; room lab; object brass_key or this; Visible false. |
| Award | Add Score; amount 5. |
| Found Message | Show Message: A key. Now, that door... |
Wire Start to Check Taken. TRUE goes to Already Taken. FALSE goes to Give Item, then Remember, Hide Scene Key, Award and Found Message. The item definition must already exist in Inventory Designer.
The scene object and carried item have different IDs here. Add Inventory uses brass_key_item. Hiding the scene object uses brass_key. Mixing them up is a common reason a pickup appears half-finished.
