diff --git a/docs/index.md b/docs/index.md index 67b1c23..96f1682 100644 --- a/docs/index.md +++ b/docs/index.md @@ -37,5 +37,8 @@ Tips and considerations for the integration into a custom respawn system. ### 12. [Query builder](query-builder.md) Persistence specific db query builder utlity. -### 12. [Debugging and metrics](debugging.md) +### 13. [Optional features](optional-features.md) +Modular persistence extensions such as door or destruction management. + +### 14. [Debugging and metrics](debugging.md) Optional debug steps and peformance metrics. diff --git a/docs/optional-features.md b/docs/optional-features.md new file mode 100644 index 0000000..c6d6a21 --- /dev/null +++ b/docs/optional-features.md @@ -0,0 +1,6 @@ +# Optional features +Optional persistence features can be added as child components of type [`EPF_PersistenceManagerExtensionBaseComponent`](https://enfusionengine.com/api/redirect?to=enfusion://ScriptEditor/Scripts/Game/EPF_PersistenceManagerExtensionBaseComponent.c;6) to the [`EPF_PersistenceManagerComponent`](https://enfusionengine.com/api/redirect?to=enfusion://ScriptEditor/Scripts/Game/EPF_PersistenceManagerComponent.c;28). They provide an easy way to hook into the persistence world setup process to prepare/restore additional features that might not be needed for all game modes. + +## [`EPF_PersistentDoorStateManagerComponent`](https://enfusionengine.com/api/redirect?to=enfusion://ScriptEditor/Scripts/Game/DoorManager/EPF_PersistentDoorStateManagerComponent.c;8) +The persistent door state manager allows to persist the open/close state of doors on the map. By default all doors from all buildings are saved if they are not in default position (closed). Optionally a [`EPF_PersistentDoorStateFilter`](https://enfusionengine.com/api/redirect?to=enfusion://ScriptEditor/Scripts/Game/DoorManager/EPF_PersistentDoorStateFilter.c;2) can be configured in the attributes to e.g. only track doors that are near a base building territory or certain villages on the map. +The door states are tracked through the [`SCR_DoorUserAction`](https://enfusionengine.com/api/redirect?to=enfusion://ScriptEditor/Scripts/Game/DoorManager/SCR_DoorUserAction.c;7). If you have custom scripted mechanisms to open and close doors, consider adding a call to `EPF_PersistentDoorStateManager.UpdateDoorState` as demonstrated in the modded action.