# StealthAlarm.verse using { /Fortnite.com/Devices } using { /Verse.org/Simulation } using { /Verse.org/Simulation/Tags } using { /UnrealEngine.com/Temporary/Diagnostics } # Define the script that will run as a creative_device placed in the level. # In UEFN you add a "Verse Device" actor to the level and assign this class to it. StealthAlarmScript := class(creative_device): # This variable holds the reference to the Customizable Light device. # Drag your 'StealthAlarmLight' actor onto this slot in the UEFN Details panel. @editable alarm_light : customizable_light_device = customizable_light_device{} # This variable holds the reference to the Trigger Zone device. # Drag your 'StealthTrigger' actor onto this slot in the UEFN Details panel. @editable alarm_trigger : trigger_device = trigger_device{} # This function runs when the game starts. OnBegin() : void = # Connect the trigger's TriggeredEvent to our reaction function. # Whenever an agent (player) activates this trigger, run 'OnPlayerEntered'. alarm_trigger.TriggeredEvent.Subscribe(OnPlayerEntered) # This function runs when the event fires. OnPlayerEntered(Agent : agent) : void = # Turn the light on. alarm_light.TurnOn() # note: runtime SetLightColor and SetRhythm are not exposed in the current # public Verse SDK for customizable_light_device. Set the light color to red # and the Rhythm Preset to "Wave" in the device's Customize panel in UEFN. # The TurnOn() call above will activate those pre-configured settings.