Skip to reading
Visual Scripting in Depth

17. Ask a simple yes-or-no question

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 13. If Variable compares one runtime variable with its Equals value.

1. Add If Variable after the event entry.

2. Select key_taken.

3. For a Boolean variable, clear Blank / null and choose True for Equals.

4. Connect TRUE to the already-collected response.

5. Connect FALSE to the pickup actions.

6. Test once with the flag false and again after the pickup has made it true.

The graph takes exactly one of those outputs. It does not run both responses. An unconnected chosen output ends that route, which can be useful when nothing should happen on the false branch.

Source table from 17. Ask a simple yes-or-no question, page 21
Stored valueEqualsExpected route
Boolean falseBoolean trueFALSE
Boolean trueBoolean trueTRUE
Text "true"Boolean trueDifferent value types; correct the input.
null / missingBoolean falseA missing flag is not a deliberate false default.

If the typed Equals editor changes unexpectedly when you choose a different variable, check the new variable’s declared type and default. Do not keep the old value by habit.

Page 21 of 93Permalink
Go to page