How does SugarCube 2 define what a save contains, what happens when a save from an older story version is loaded, and how can saves be versioned and upgraded?
SugarCube 2 (docs at ba17b123) saves the state as of the last moment, which is created only on passage navigation; loading a save replaces the current state, so variables introduced in StoryInit after the save are undefined; save versioning is opt-in via Config.saves.version (no default) and is only useful with Save.onLoad upgrade handlers.
SugarCube 2 (docs at ba17b123) saves the state as of the last moment, which is created only on passage navigation; loading a save replaces the current state, so variables introduced in StoryInit after the save are undefined; save versioning is opt-in via Config.saves.version (no default) and is only useful with Save.onLoad upgrade handlers.
Curator qualifications: Save API version property and onLoad.add lines (S11, E4) not re-read; setup.* re-run statement not re-read. Documentation reading only; no story or game run.
Limitations: Documentation, not runtime-tested.
Evidence status: statements located in the cited sources by a correlated desk review (Claude); not executed; not independently reviewed.
Structured fields
{
"citations": [
{
"url": "https://github.com/tmedwards/sugarcube-2/blob/ba17b12343728d191b5cc6a82e4dc5713379863d/docs/api/api-config.md",
"note": "docs/guides/guide-state-sessions-and-saving.md lines 7, 15, 63-81 at ba17b123; docs/api/api-config.md lines ~905-920"
},
{
"url": "https://github.com/tmedwards/sugarcube-2/blob/ba17b12343728d191b5cc6a82e4dc5713379863d/docs/api/api-save.md",
"note": "docs/guides/guide-state-sessions-and-saving.md lines 7, 15, 63-81 at ba17b123; docs/api/api-config.md lines ~905-920"
},
{
"url": "https://github.com/tmedwards/sugarcube-2/blob/ba17b12343728d191b5cc6a82e4dc5713379863d/docs/guides/guide-state-sessions-and-saving.md",
"note": "docs/guides/guide-state-sessions-and-saving.md lines 7, 15, 63-81 at ba17b123; docs/api/api-config.md lines ~905-920"
}
]
}Evidence claims
- [sourced_fact] SugarCube 2 (docs at ba17b123) saves the state as of the last moment, which is created only on passage navigation; loading a save replaces the current state, so variables introduced in StoryInit after the save are undefined; save versioning is opt-in via Config.saves.version (no default) and is only useful with Save.onLoad upgrade handlers. · locator: docs/guides/guide-state-sessions-and-saving.md lines 7, 15, 63-81 at ba17b123; docs/api/api-config.md lines ~905-920 source
Rights
| component | license | hosting | redistribution | modification | training | Evidence and notes |
|---|---|---|---|---|---|---|
| documentation | unknown | permitted | permitted | unknown | unknown | Applies to this original summary only, not to the cited sources. |
Linked records
- cites → https://github.com/tmedwards/sugarcube-2/blob/ba17b12343728d191b5cc6a82e4dc5713379863d/docs/api/api-config.md
- cites → https://github.com/tmedwards/sugarcube-2/blob/ba17b12343728d191b5cc6a82e4dc5713379863d/docs/api/api-save.md
- cites → https://github.com/tmedwards/sugarcube-2/blob/ba17b12343728d191b5cc6a82e4dc5713379863d/docs/guides/guide-state-sessions-and-saving.md