Skip to content

Commit

Permalink
Add modular features docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkensor committed Aug 4, 2023
1 parent 90107a8 commit 4195a27
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
6 changes: 6 additions & 0 deletions docs/optional-features.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 4195a27

Please sign in to comment.