# Import the tools we need using { /Fortnite.com/Devices } # Gives us access to Audio Players, Triggers, etc. using { /Fortnite.com/AI } # Gives us access to NPC-specific logic using { /Verse.org/Simulation } # The core engine logic # This is our Custom Device Blueprint # We call it 'concrete' because it's a real device you can place in the world ai_voiceline_manager := class: # --- EDITABLE PROPERTIES --- # These are the "knobs" you see in the device panel in UEFN. # 1. The Sound File # We link this to an Audio Player device. # When you place this device in UEFN, you'll drag a sound file into this slot. @editable Sound:audio_player_device := audio_player_device{} # 2. Should it repeat? # If true, the guard can say the same line twice in a row. # If false, it waits a cooldown before repeating. @editable CanRepeat:logic = true # 3. The Delay # Time in seconds before the bark plays. # 0.0 means instantly. 1.5 means wait 1.5 seconds. @editable Delay:float = 0.0 # 4. The Trigger (Optional but recommended) # This is the "switch" that tells the manager to speak. @editable Trigger:trigger_device := trigger_device{} # --- THE BRAIN --- # This function runs when the Trigger is activated. OnTriggered():void= # If we are waiting, stop waiting # (Simplified logic for this tutorial: we just play it) # Play the sound! # .Play() is the command that says "Make noise." Sound.Play() # Optional: Log a message to the console for debugging # (This shows up in the debugger, not in-game) Print("Guard said something!")