32. Save state, instance state and project settings
var visit_counter: int = 0func run() -> int:
visit_counter += 1
Log("Calls this session: " + str(visit_counter))
Variable.powered.value = true
return visit_counter| Store | Lifetime / purpose |
|---|---|
| Local variable | One function call |
| Member on ordinary native record | One temporary script instance/call |
| Member on global native record | Current session until reload, invalidation or shutdown |
| Variable registry / game variables | Game state managed by PCA save/load |
| Included-variable store | Router-owned shared session/cache state |
| user:// custom file | Your explicit persistence format |
| Runtime project/record data | Configuration and live state; persistence depends on the specific route |
GetSetting/SetSetting and GetProjectProperty/SetProjectProperty address the running project. They do not save the editor document to disk. For a live feature with a dedicated action, use that action when immediate reconfiguration matters.
