Static Entities lets staff make entities persistent, so that they are saved with the map
and spawned again when it loads.
Entities are made static or unstatic with the static add and static remove commands or
with the Static Add/Remove tool, which all go through the PlayerMakeStatic hook. Only
whitelisted classes can be made static: props, ragdolls, lights and lamps by default, and
whatever plugins add with StaticEnts:whitelist_ent. The plugin turns Sandbox's own
persistence off and saves and loads through the PersistenceSave and PersistenceLoad
hooks instead. The fl_persistence_backup console command writes a copy of all persistent
entities to the data folder.
Summary
Hooks
Methods
Hooks
Runs the PersistenceLoad hook once the map's entities have been created.
Implements hook PersistenceLoad
Loads the saved static entities of every whitelisted class.
Implements hook PersistenceSave
Saves every persistent entity to the plugin data of the current schema and map, one 'static/<class>' entry per entity class. Runs the PrePersistenceSave hook first and the PostPersistenceSave hook once everything has been saved.
Implements hook PlayerMakeStatic
Makes the entity the player is looking at static, or removes its static status, and notifies the player about the outcome. The entity's class has to be whitelisted and the player needs the 'static' permission.
Parameters
- actor Player
- is_static Boolean true to make the entity static, false to make it unstatic
Implements hook RegisterPermissions
Registers the 'static_tool' permission.
Implements hook SaveData
Runs the PersistenceSave hook whenever the framework saves its data.
Runs the PersistenceSave hook when the server shuts down.
Methods
Spawns the saved static entities of one class and marks them as persistent. Does nothing if there is no usable save for that class. Serverside only.
Parameters
- ent_class String entity class, e.g. 'prop_physics'
Allows entities of a class to be made static and to be loaded from the saves. Serverside only.
Parameters
- ent_class String entity class