Skip to reading
The Variable Designer

6. Blank, empty, False and zero

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView illustrations

Sometimes a question has not been answered yet. A clue-selection variable is a good example: the player has not picked a clue, so there is no selected ID to store. Leave Blank At Start represents that state with null.

1. Add last_choice, Name Last Choice, and choose String.

2. Tick Leave Blank At Start. The initial String field disappears.

3. Apply and save. The record still has type String, but its starting value is null.

Figure 6. Last Choice starts blank. The declared type stays String while the starting value is null.

Source table from 6. Blank, empty, False and zero, page 10
ValueMeaning in your design
FalseA Boolean answer: no, this has not happened.
0A Number: none of this amount.
""An empty String: text exists, but contains no characters.
[]An empty Array: a list with no members.
nullNo value has been supplied yet.

Untick Leave Blank At Start and leave Initial String Value empty if you want an empty String instead. Do not use the word null in the String starting field to mean blank; that stores four letters.

During play, visual Set Variable nodes have a Blank / null option, and GDScript can supply null directly. In this release, typing null into an ordinary action-list Value text field does not reliably create null. Use the explicit blank option or code for that case.

Page 10 of 37Permalink
Go to page