Aego Русский

Loading order

Loading a save rebuilds the game in a fixed order. Knowing the order tells you which values a script already has in Ready and OnLoad.

  1. The scene of the save is loaded fresh.
  2. Scene nodes the save lists as destroyed are destroyed.
  3. Spawned objects are spawned again with their persistent ids.
  4. Transforms, component fields and @persist fields are restored.
  5. Scripts run Ready, then OnLoad.

Fields restored in step 4 are already set when Ready runs. A field that is not marked comes from the scene, as on a fresh start.

References between saved nodes survive: a NodeRef to a scene node is saved by its id, a reference into a spawned object by the object's persistent id and the path inside it.