Register Save Handler
Signature
bool registerSaveHandler(string id, function callback)Description
Registers a save handler for a specific identifier that stores additional information for a save game.
Each identifier is saved as a separate JSON file ({id}.json}) and stored in a directory named after the save game (e.g. FFXII_000.dir).
Returns whether the operation was successful (true) or not (false).
Arguments
Identifier
The unique identifier of the save data.
Callback
The Callback function that is executed when save data is saved.
Example File Structure
saves/
βββ FFXII_000.dir/
β βββ mymod-stats.json
β βββ mymod-inventory.json
β βββ mymod-settings.json
βββ FFXII_000Notes
It is recommended to use a unique, mod-specific prefix for identifiers to avoid collisions with other scripts that may define similar names.
The first script to register a save handler for an identifier owns it.
Trying to register a save handler for an identifier owned by another script will throw a warning and then be ignored.
Last updated