Skip to reading
Visual Scripting in Depth

24. Build a locked-door puzzle

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 16. Has Inventory asks whether the active inventory contains the required item.

Source table from 24. Build a locked-door puzzle, page 28
FromOutputTo
On Interact: useNEXTIf Variable: door_open == true
Door already open?TRUEAlready-unlocked message
Door already open?FALSEHas Inventory: brass_key_item
Has key?FALSELocked / need-key message
Has key?TRUESet door_open true
Set flagNEXTDisable door → hide door → add 10 points → success message

Assign this graph to the door’s Use verb. A plain Use interaction tests possession of the key. It does not require the player to select the key and use it with the door; that more specific input needs the appropriate inventory/preposition response to call the same puzzle logic.

Keep the key unless the story says it should be consumed. To consume it, insert Remove Inventory only on the success path after the possession check. Do not remove it on the locked response.

The already-open guard comes before the reward. Otherwise a repeat call can award another ten points even if the door is no longer visible.

Page 28 of 93Permalink
Go to page