Skip to content

Save, load, and rollback ​

This page is part of the GenPy Ren'Py learning path. It focuses on practical Ren'Py 8.x production and links each concept back to the GenPy workflow.

Learning goals ​

  • Know what belongs in save-state variables.
  • Avoid side effects that rollback cannot handle cleanly.
  • Test save/load around important route changes.

Core syntax ​

  • save
  • load
  • rollback
  • default
  • config.rollback_enabled

Runnable example ​

text
label after_load:
    $ rebuild_runtime_caches()
    return

Study outline ​

  • Start with the smallest example for save, load, and rollback.
  • Test the key terms in a clean Ren'Py project: save, load, rollback, default.
  • Move the pattern back into your real project only after the example runs.
  • Use GenPy docs and validation to keep the feature connected to story, assets, and export readiness.

Common pitfalls ​

  • Test the smallest working script before layering on visual or UI complexity.
  • Run Ren'Py Lint before release builds, even when the script appears to run locally.
  • Keep examples in standard .rpy files so they remain editable outside GenPy.

Official references ​

How this fits in GenPy ​

  • Use Variables and State Registry to reason about save-state data.
  • Use Validation and manual preview before release.

Recommended GenPy docs:

Built for GenPy creators.