# We need to import the basic frameworks for Verse and World simulation using { /Fortnite.com/Devices } using { /UnrealEngine.com/Temporary/SpatialMath } # This is our main device script. # It "listens" for events from the Trigger Volume. script class StormTriggerDevice extends Device: # 1. VARIABLES: The "Loot Slots" for our data # We need a variable to store the "new" color we want to apply. # Think of this as a "Mood" card we draw from the deck. new_storm_color: vector3 = <0.2, 0.3, 0.5> # A dark, stormy blue-grey # We also need a variable for the new intensity. # This is like the "Volume" slider for the bounced light. new_intensity: float = 0.5 # Half as bright as the default sunny sky # 2. EVENTS: The "Trigger" moment # This function runs automatically when a player enters the volume. # It's like the "Elimination" event firing when someone gets knocked out. OnBegin(): void = # Wait for a player to enter the trigger for player : GetPlayers(): # If the player is inside, we change the lighting ApplyStormMood() # 3. FUNCTIONS: The "Action" # This is the code that actually does the work. # Think of this as the "Building Edit" command. ApplyStormMood(): void = # We need to find the SkyLight component in the world. # In Verse, we use 'Find' to grab a component by name. # It's like finding your favorite gun in the loot pool. if sky_light := FindComponent("SkyLight_1"): # NOW WE CHANGE THE LIGHTING # .SetIntensity() is the command to change the volume knob. sky_light.SetIntensity(new_intensity) # .SetColor() is the command to change the tint. # We pass in our vector3 (R, G, B) values. sky_light.SetColor(new_storm_color) # Optional: Log a message so we know it worked Print("Storm front arrived! Lighting updated.")