Function: schemaFromSaveFile()
schemaFromSaveFile(
bytes,gameId,gameVersion?):SaveSchema
Defined in: artifacts.ts:95
Derives a schema from an exported .sx save file.
Parameters
bytes
Uint8Array
Raw contents of the .sx file
gameId
string
The game's gameId, which the file is encrypted with
gameVersion?
string
Required only when the file mixes several versions
Returns
The derived schema
Remarks
Useful for recovering a baseline from a game that is already in production: a real save is a faithful record of the shape its version wrote, and its populated collections reveal element types that empty defaults hide.
Throws
Error if the file cannot be decrypted or holds no usable save