# BP_Door Actor - /Game/ScribeTest/Blueprints/BP_Door Parent: BP_InteractiveBase > Actor Interfaces: BPI_Interactable compile: Warnings, 54 nodes in 6 graphs, hard references: 5 packages (81 KB), used by 1 asset Complexity: 30 of 100 (moderate). C++ candidate: 34 of 100 (consider c++). A door that opens when the player interacts with it. Locked doors need their BP_Key. ## Components - DefaultSceneRoot: SceneComponent [from BP_InteractiveBase] - DoorMesh: StaticMeshComponent (under DefaultSceneRoot) - Trigger: BoxComponent (under DoorMesh) - Overlap area for the interact prompt. ## Variables - bIsLocked: Boolean = False [Instance Editable, category Door] - Locked doors only open with their key. - OpenSpeed: Float (double-precision) = 2.0 [Instance Editable, Expose on Spawn, category Door] - Settings: F_DoorSettings Structure = (OpenAngle=90.000000) [Instance Editable, unused] - Shared tuning values. - State: E_DoorState Enum = Closed [Replicated, unused] - Current state, replicated. - Key: Actor Object Reference = None [Instance Editable] - The key that unlocks this door. - UnusedCounter: Integer = 0 [Private, unused] ## Functions - Open(Speed: Float (double-precision)) -> (Success: Boolean = true) - Opens the door at the given speed. Returns false when it is locked. - HelperNoDocs() [Private] - IsOpen() -> (Result: Boolean = false) [Pure, Const] - True while the door is open. - GetPrompt() [Interface (BPI_Interactable)] - Interact() [Interface (BPI_Interactable)] ## Events - Event BeginPlay() [Override] - Event when play begins for this actor. - Event Tick(DeltaSeconds: Float (single-precision) = 0.0) [Override] - Event called every frame, if ticking is enabled - OnUnlocked(Who: Actor Object Reference) [Custom Event, Multicast, Reliable] - Plays the unlock effects on every client. - Slam() [Custom Event] ## Event dispatchers - OnDoorOpened(Door: Actor Object Reference) - Broadcast after the door finished opening. ## Graphs ### EventGraph (Event Graph, 42 nodes) ``` Event BeginPlay: Print String(In String="Door ready") Branch(Condition=bIsLocked) True: Cast To BP_Key(Object=Key) Open(Speed=OpenSpeed) False: Print String(In String=Get Unique Device Id) Event Tick(Delta Seconds): Print String(In String="Tick step 1") Print String(In String="Tick step 2") Print String(In String="Tick step 3") Print String(In String="Tick step 4") Print String(In String="Tick step 5") Print String(In String="Tick step 6") Print String(In String="Tick step 7") Print String(In String="Tick step 8") Print String(In String="Tick step 9") Print String(In String="Tick step 10") Print String(In String="Tick step 11") Print String(In String="Tick step 12") Print String(In String="Tick step 13") Print String(In String="Tick step 14") Print String(In String="Tick step 15") Print String(In String="Tick step 16") Print String(In String="Tick step 17") Print String(In String="Tick step 18") Print String(In String="Tick step 19") Print String(In String="Tick step 20") Print String(In String="Tick step 21") Print String(In String="Tick step 22") Print String(In String="Tick step 23") Print String(In String="Tick step 24") Event OnUnlocked(Who): Print String(In String="Unlocked") Event Slam: Print String(In String="Slam!") Not run by any event (3): Print String, Get Actor Location, Print String (disabled) ``` ### Open (Function, 3 nodes) ``` Entry(Speed): Print String(In String="Opening") Return(Success=true) ``` ### HelperNoDocs (Function, 2 nodes) ``` Entry: Print String(In String="Helper") ``` ### IsOpen (Function, 3 nodes) ``` Entry: Return(Result=bIsLocked) ``` ### GetPrompt (Interface, 2 nodes) ``` Entry: Return ``` ### Interact (Interface, 2 nodes) ``` Entry(Instigator): Return(Handled=false) ``` ## Comments - EventGraph / Print String: Debug only: shows the device id when the door is unlocked. - EventGraph: Startup: open the door if the key fits ## Findings - Warning, Event Tick: Event Tick runs 24 nodes every frame. Timers, events or a lower tick interval are often cheaper. (graph EventGraph) - Warning, Unused variable: Private variable 'UnusedCounter' is not used in any graph. - Warning, Dead nodes: 1 node in 'EventGraph' never runs because nothing is connected to the exec input: Print String. (graph EventGraph) - Warning, Deprecated node: 'Get Unique Device Id' in 'EventGraph' is deprecated: Usage of 'Get Unique Device Id' has been deprecated. Use GetDeviceId instead (graph EventGraph) - Warning, Circular reference: Hard reference cycle with BP_Key. Each of them loads all the others; an interface or a soft reference breaks the cycle. - Info, Cast to Blueprint: Casts to BP_Key. The cast target is loaded together with this Blueprint; an interface avoids that. (graph EventGraph) - Info, Unused variable: Variable 'Settings' is not used in any graph of this Blueprint (other Blueprints may still use it). - Info, Unused variable: Variable 'State' is not used in any graph of this Blueprint (other Blueprints may still use it). - Info, Unused results: 1 pure node in 'EventGraph' has no connected output: Get Actor Location. (graph EventGraph) - Info, Disabled nodes: 1 disabled node in 'EventGraph': Print String. (graph EventGraph) - Info, Missing description: 2 functions and events have no description: HelperNoDocs, Slam. - Info, Missing description: 1 public variable has no tooltip: OpenSpeed. ## C++ migration - Event Tick runs 24 nodes every frame; a C++ Tick, a timer or an event costs far less. - 1 deprecated node: replace it before the next engine upgrade. - Compiles with warnings: today's warnings are often the next version's errors. ## References - Loads (hard): F_DoorSettings, E_DoorState, BPI_Interactable, BP_Key, BP_InteractiveBase - Used by: BP_Key