Levers and Interactable Objects
Jump to navigation
Jump to search
Overview
Interactable objects are defined through a C++ class in bulkobjects/psinteractableactor.cpp , this class is blueprint enabled, so you can see it from the editor. In the editor there are items you can use in Blueprints/InteractableActors.
There are different types of actors like:
- lights (can be turned on and off)
- doors with 2 states (open / close)
- doors with 3 states (open on the outside / closed / open on the inside)
- gates with 2 states (open and close) , you can set the direction to be left/right/up/down. This will determine the direction the door will slide when activated
- levers with 2 states (up and down).
All interactable actors have these properties:
- InteractDistance : player distance required to use the item
- SoundOnToggle : sound played when you use the item
- linkedActors : actors which will be triggered when using this item (must be also interactable actors)
- DisableDirectInteraction : if set to true it prevents the player to use this item. Can be used for gates, which are triggered by a lever, and we dont want the player to be able to open the gate directly.
- linkedActorsToggles : List of actors which toggled this item. We keep track of this to then toggle the final item. Example for a door requiring multiple levers to be opened, you will list here all the levers.
- trapProperties: if trapped, these are the properties, see Traps
- scriptOnToggle: when activated the server will run the named ProgressionScript. The script needs to exist already in the database.
Levers
Levers can toggle other interactable actor, if you list those in "Linked Actors" property.
Levers can be trapped
Levers can trigger other levers
Gates and Doors
We want these to be final items, so avoid using "Linked Actors" property.
A gate can be opened by multiple levers, in this case use "linkedActorsToggles" properties
A gate can be trapped.
A gate can slide up/down/left/right