Skip to reading
Eight Adventure Interface Workshops

Call a memory function from a normal event

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

For a Remember Window Button or an object’s Remember result, selecting memory_tools as the ordinary script runs its default example. For another clue, make a small wrapper record like this:

Code example
extends "res://scripts/runtime/script_base.gd"
Code example
func run(_context: Dictionary = {}) -> Variant:
    await CallScript("memory_tools", "remember",
        ["signal", "The missing signal", true])
    return true

If you already use Functions as Nodes, expose the same remember function with topic, caption and long_term parameters through your function definitions. That changes how the action is authored; it does not change the saved memory format.

The following ordinary wrapper changes the player and refreshes the displayed lists. Record ID: memory_switch; Global Script: off.

Code example
extends "res://scripts/runtime/script_base.gd"
Code example
func run(_context: Dictionary = {}) -> Variant:
    await Runtime.call("switch_player_character", "assistant")
    await CallScript("memory_tools", "refresh")
    return true

With the global player-changed hook enabled, the explicit refresh is harmless but redundant. Keeping it in a first test makes the order of operations easy to follow.

Page 103 of 119Permalink
Go to page