Skip to reading
Visual Scripting in Depth

22. Build the key pickup

Edition 0.86.4.3

0.86.4.3 edition with revised lessons, updated cross-references and new cinematic/camera-safety supplements. Earlier examples, screenshots and registry figures retain their stated edition context.

Download PDFView illustrations

Figure 15. The pickup adds an inventory item, then remembers that the reward was collected.

Source table from 22. Build the key pickup, page 26
Node roleType and settings
StartOn Interact; verb take.
Check TakenIf Variable; key_taken equals true.
Already TakenShow Message: I already have the key.
Give ItemAdd Inventory; brass_key_item; count 1.
RememberSet Variable; key_taken = true.
Hide Scene KeyHide / Unhide Object; room lab; object brass_key or this; Visible false.
AwardAdd Score; amount 5.
Found MessageShow 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.

Page 26 of 93Permalink
Go to page