Doors and World Interactables
This document explains door types, door interaction logic, and
specialized world interactable actors in RPG Engine v6.
Trading, inventory, and generic interaction flow are described in
separate system docs.
Door Framework Overview
All doors share a common base and interface:
- Base class:
BP_Interact_Door_Master- Inherits from
BP_Inter_Buildable(doors can be placed by the building system).
- Inherits from
- Interface:
BPI_InteractDoor - Saved via:
BPI_SaveSystem(Door Save Data→S_IA_DoorSave).
BPI_InteractDoor
BPI_InteractDoor defines the common interaction contract
for all doors:
InteractComponentHasBeenChanged
Notifies the door that the interaction source changed (another character started/stopped interacting).DoorActionNext
“Next” action during door interaction (e.g. scroll wheel up for changing code digits or rotating a part).DoorActionPrevious
“Previous” action (e.g. scroll wheel down).Door ForceCancelLockState
Called when unlocking/interaction must be aborted instantly (player died, left range, state canceled).InputValueFloat
Generic float input hook for door/puzzle logic (can be used by custom door types).
BP_InteractComponent routes IA_Interact,
mouse wheel, and other inputs to these methods depending on the door
type and current state.
Common door parameters (BP_Interact_Door_Master)
BP_Interact_Door_Master exposes core door state
parameters:
OpenDoor_Rotation(Rotator)
Rotation for the open state.CloseDoor_Rotation(Rotator)
Rotation for the closed state.State(E_DoorState)
Lock state:Locked/Unlocked.Can door by locked again(bool)
Whether the door can be locked again after being opened/unlocked.Door_OpenClose(E_DoorOpenClose)
Open/closed state used by animation and save system.
Doors also participate in the global save system:
Door Save Data(S_IA_DoorSave) stores:OpenClose(E_DoorOpenClose)DoorState(E_DoorState)DoorCode(int[]) – current code for code doors
On load, all BPI_SaveSystem actors are removed and
re-spawned using saved S_SaveContainer data, restoring door
rotation, lock state, and codes.
Door Types
Regular Door
Class: BP_Interact_Door
Basic behavior:
- Aim at the door and press
IA_Interact(defaultF) to toggle open/close. - Uses:
OpenDoor_Rotation/CloseDoor_RotationDoor_OpenClosefor current open/closed stateStatefor lock logic if needed (can be configured as always unlocked).
No mini-games, codes, or key requirements.
Code-Locked Door
Class: BP_Interact_Door_Code
This door is opened by entering the correct numeric code using a 3D “lock wheel”.
Parameters
True_Code(Integer[])
The correct code sequence (e.g.[1, 5, 3, 7]).Max Camera Position(int)
Code length; must match the length ofTrue_Code. Also used for indexing digit positions.Wheelscomponent with Arrow children (1,2,3,4, …)
Each Arrow defines the location/axis for a digit wheel. When increasing code length, you must add more Arrow components accordingly.
Behavior
- When the player looks at the lock and presses
IA_Interact:- The camera blends to a dedicated door camera (lock view).
- Interaction mode switches to “code input”.
- Controls:
IA_Interact:- Enter code input mode.
- When pressed again, exits code input mode (confirm/cancel).
- Mouse wheel:
- Scroll up →
DoorActionNext(increment current digit). - Scroll down →
DoorActionPrevious(decrement current digit).
- Scroll up →
E(bound in input):- Switch to the next digit position (index from
0toMax Camera Position - 1).
- Switch to the next digit position (index from
- When the player moves away or the state
CharacterStates.Effects.DoorUnlockingis deactivated:Door ForceCancelLockStateis called to reset lock interaction.
- When the entered code matches
True_Code:StatebecomesUnlocked.Door_OpenClosechanges to “Open”.- The door rotates to
OpenDoor_Rotationand physically opens. - The code and state are saved via
S_IA_DoorSave.
Players can also change the access code after opening:
- Close the door.
- Interact with the lock again to enter “set new code” mode.
- Input a new sequence and confirm with
IA_Interact.
Door with Rotating Latch
Class: BP_Interact_Door_Latch
Door with a simple mechanical latch that must be rotated to unlock.
Parameters
Latch_UnlockedRotation(Rotator)
Rotation of the latch when unlocked.Latch_LockedRotation(Rotator)
Rotation of the latch when locked.
Behavior
- Player finds the rotating latch component on the door.
- Aims at the latch and presses and holds
IA_Interact(e.g.F). - While held, the latch slowly rotates toward
Latch_UnlockedRotation. - Once the latch reaches the unlocked state:
- The door is considered unlocked.
- The door opens automatically (changes
Door_OpenCloseand rotation).
- Re-locking behavior depends on
Can door by locked again.
This door type is intentionally “simple but slow” to open.
Door Requiring Wiring Puzzle
Class: BP_Interact_Door_Wiring
Door that opens after solving a 2D wiring mini-game (connect wires of the same color, similar to Among Us).
Parameters
Puzzle Widget(UserWidgetclass)
UMG widget implementing the wiring mini-game. It must define anOnFinished(bool bSuccess)event.
Behavior
- On interaction:
- The door opens
Puzzle Widgeton the player.
- The door opens
- The widget:
- Runs the wiring puzzle.
- Calls
OnFinished(true)when solved andOnFinished(false)on failure/cancel.
- Inside
BP_Interact_Door_Wiring:- A handler is bound to the widget’s
OnFinished. - If
bSuccess == true:- The door is set to
Unlocked. - The door opens (
Door_OpenCloseand rotation).
- The door is set to
- If
bSuccess == false:- The door remains closed.
- A handler is bound to the widget’s
You can replace the wiring mini-game by assigning a different widget
class in Puzzle Widget, as long as it exposes the same
OnFinished(bool) contract.
Key-Locked Door
Class: BP_Interact_Door_Key
Door that requires a specific key item in the player’s inventory.
Parameters
Key Info—BP_ItemData
Item data of the key required to open this door.
Behavior
- On interaction:
- The door checks inventory for
Key InfoviaBP_EquipmentComponent.
- The door checks inventory for
- If the key is present:
- One instance of that key item is removed from the inventory.
- The door becomes unlocked (
State = Unlocked). - The door opens (changes
Door_OpenCloseand rotation). - The key is consumed permanently (not returned on closing).
- If the key is absent:
- The door remains locked and doesn’t open.
Whether the door can be locked again depends on
Can door by locked again.
The key is only required for the first successful unlock.
World Interactables (Non-Door)
This section covers specialized interactable actors that are not NPCs and not pure loot.
Wardrobe Point (Equipment Station)
Actor: BP_EquipmentPoint
Purpose:
- In-world wardrobe and equipment customization station.
Interaction flow:
- When the player interacts with
BP_EquipmentPointviaBP_InteractComponent:- A wardrobe-specific event is sent to the PlayerController.
- PlayerController opens
WBP_Wardrobe_Placeholder_InGame.
- From the wardrobe UI:
- Character appearance is updated via
BPCharacterSkinComponent. - Loadout (weapons, armor, bags) is updated via
BP_EquipmentComponent.
- Character appearance is updated via
- Changes are saved using the general save/load system (see character/init docs).
Configuration:
BP_EquipmentPointitself does not expose many tunables; main behavior is defined inside the UI and customization systems.
Wash Point (Hygiene Station)
Actor: BP_Inter_WashM (child of
BP_Inter_Master)
Purpose:
- Allows the player to clean the character’s body and reduce contamination.
Interaction flow:
- On interaction:
- Calls a function on the character to adjust the
Hygienestat. - Plays a wash AnimMontage on the actor’s SkeletalMesh (shower animation).
- Calls a function on the character to adjust the
Configuration notes:
- No per-actor parameters for “wash speed/strength”; those are configured in the stats/survival system.
BP_Inter_WashMis essentially a simple stat trigger plus VFX/animation.
Other Specialized Interactable Actors
Several other interactable actors are defined as
BP_Inter_Master or BP_Inter_AutoInit children
and plug into the same interaction pipeline:
BP_Inter_Buildable
Base for building-placeable interactables (doors, building pieces).
Detailed behavior is documented in the building system docs.BP_Inter_WeapModif,BP_Inter_Master_Quest,BP_Int_Buff_Master, etc.
These are covered in detail in:interaction-and-items.md- inventory/equipment documentation
- buff and quest system docs
From the perspective of this file, they are “non-door world interactables” that:
- Implement
BPI_Interactables/BPI_MulticlassData. - May implement
BPI_SaveSystem. - Are discovered and used by
BP_InteractComponentvia the same trace and widget flow.
Input and State Integration for Doors
Although doors are world actors, they still integrate with the state system and input routing.
Key points:
- Input:
IA_Interactis the main action used to:- Start door interaction (aim + press).
- Enter/exit code input mode for code doors.
- Confirm new codes or abort.
- Mouse wheel:
- Mapped internally to
DoorActionNext/DoorActionPrevious.
- Mapped internally to
- Extra keys such as
E:- Used to switch positions (digits, segments) where applicable.
- State integration:
- Door unlocking sequences are typically tied to a state,
e.g.
CharacterStates.Effects.DoorUnlocking. - When that state is deactivated for any reason:
Door ForceCancelLockStateis called on the door.- The door resets any transient lock/unlock interaction.
- Door unlocking sequences are typically tied to a state,
e.g.
This keeps door logic consistent with the rest of the state-driven interaction architecture.
Save and Persistence Summary
Doors and specialized interactables participate in the same persistence system as other world actors:
- Implement
BPI_SaveSystem. - Respond to
BPI SS LoadActorFromSaveDatausingS_SaveContainer. - Important for doors:
S_IA_DoorSave.OpenClose— open/closed.S_IA_DoorSave.DoorState— locked/unlocked.S_IA_DoorSave.DoorCode— current code (code doors).
On level load:
- All actors with
BPI_SaveSystemare cleared. - Save system respawns doors and world interactables based on saved data.
- Doors restore rotation, lock state, and codes exactly as they were at save time.
Related Docs
Doors and interactables connect to:
docs/systems/interaction/interaction-and-items.mddocs/systems/interaction/trading-and-vendors.md