7. Store a list in an Array
An Array is an ordered list stored in one variable. It is useful for discovered clues, a sequence entered into a puzzle or choices collected during a conversation. Each entry is a separate member of the list.
1. Add clues, Name Clue List, with Value Type Array.
2. Keep Leave Blank At Start off.
3. Enter ["clock diagram"] in Initial Array Value.
4. Apply and save. Use [] instead if the player should begin with no clues.
Figure 7. The list begins with one String member: clock diagram. Square brackets identify a JSON array.
Add one clue during play#
Use Change Variable, choose clues, set Operation to append, and supply "winding socket" as the Value in the action-list editor. The resulting list is ["clock diagram", "winding socket"]. You are adding one new member, rather than replacing the whole list.
| Operation | Result |
|---|---|
| Set to [] | Clears the list. |
| Append "winding socket" | Adds that one String to the end. |
| Append the same clue again | Adds another copy; duplicates are allowed. |
| Append ["note", "key"] | Adds one nested Array, not two separate members. |
A clue name in this list is just data. It does not create an inventory item. Use the inventory actions when the player should actually receive or lose something.
