Skip to reading
Eight Adventure Interface Workshops

Create persistent memory stores

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 PDF page

1. Create array variables named stm_tester and ltm_tester for the first character. Give them empty arrays as their starting values.

2. Create a short- and long-term array for each other playable character, using that character’s actual ID after the underscore.

3. Create the display arrays memory_stm_active and memory_ltm_active.

4. Create the string variable memory_topic for the currently chosen topic.

5. Add memory_tools from Chapter 12. Its remember function stores an ID and caption once, under the active character’s memory key.

6. Call its refresh function after a character switch and after restoring a saved game, so the visible lists match the active owner.

Source table from Create persistent memory stores, page 80
StoreMeaning
stm_ + character IDShort-term observations deliberately remembered by that character.
ltm_ + character IDLonger-term story events learned by that character.
memory_stm_active / memory_ltm_activeDisplay copies for the currently controlled character.
memory_topicThe selected topic ID, not a piece of physical inventory.

The sample short-term list keeps the most recent ten entries by dropping the oldest. That is a simple workshop policy. Use an explicit replacement choice if your puzzle needs the player to decide what to forget.

Page 80 of 119Permalink
Go to page