Global Class "EntitySaveStateManager"⚓︎
Info
You can get this class by using the EntitySaveStateManager global table.
Note that to call these functions, you must use a . (period) instead of a : (colon)!
Example Code
1 | |
Info
All data tracked by this class is saved and restored automatically.
Functions⚓︎
GetEntityData ()⚓︎
table, boolean GetEntityData ( ModReference mod, Entity entity )⚓︎
Returns a Lua table containing mod-related data associated with the entity. Additionally returns whether or not the table is newly created or pre-existing.
GetEntitySaveStateData ()⚓︎
table, boolean GetEntitySaveStateData ( ModReference mod, EntitiesSaveState saveState )⚓︎
Returns a Lua table containing mod-related data associated with the entity save state. Additionally returns whether or not the table is newly created or pre-existing.
TryGetEntityData ()⚓︎
table? TryGetEntityData ( ModReference mod, Entity entity )⚓︎
Like GetEntityData but only returns a table if it already exists.
TryGetEntitySaveStateData ()⚓︎
table? TryGetEntitySaveStateData ( ModReference mod, EntitiesSaveState saveState )⚓︎
Like GetEntitySaveStateData but does only returns a table if it already exists.