Skip to content

Kiln API / kiln / SaveOptions

Interface: SaveOptions ​

Properties ​

PropertyTypeDescription
resources?Resource<any>[]Resources written to save slots (game progress: level, score, inventory).
traits?(Trait | Relation<any>)[]Entities to save: every entity with at least one of these traits, with these traits' values. Loading replaces those entities. Non-JSON traits (MeshRef) can't be saved: rebuild visuals on Loaded, or with a system over [IsCoin, Not(MeshRef)]. Relations listed here are relinked between saved entities.
persist?Resource<any>[]Resources kept across sessions automatically (settings, high scores): loaded at startup, saved when they change.
key?stringStorage key prefix, so games on one origin don't collide. Default 'kiln'.
storage?SaveStorageDefault: localStorage in the browser, memory elsewhere.