Skip to reading
PCA Script Programming

OnSaveLoaded

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

Earlier edition reference / Current 0.86.4.0 property paths > p. 329

Code example
when save loads
    log(to_json(event))
end

A save has successfully restored game state.

Source table from OnSaveLoaded, page 297
Common context keysUse and limits
slot, sceneId, playerIdRefresh presentation from restored variables. Do not award a pickup again merely because its saved state was loaded. This is a successful-load hook; a missing or invalid save should not be treated as a completed restore.

OnCustomEvent#

Code example
when event OnCustomEvent
    log(to_json(event))
end

A script or Emit Event graph node explicitly emits this event name.

Source table from OnSaveLoaded, page 297
Common context keysUse and limits
Whatever keys the emitter sends; eventName is added for the listenerUse a reason key, such as signal_powered, to distinguish several messages sharing OnCustomEvent. It is not automatically emitted by every button or variable edit. The graph form uses its Context JSON; the GDScript helper merges its current caller context before emitting.

For your own exact name, emit_event("signal_powered", {...}) pairs with when event signal_powered. To use the standard OnCustomEvent hook, emit that exact hook name and put your discriminator in the data dictionary.

Page 297 of 357Permalink
Go to page