Verse Library verse

01 Fragment

Modifies SkyLight color and intensity when players trigger a volume, creating dynamic weather mood effects.

verse-library/skylight/01-fragment.verse

# 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<override>()<suspends>: 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 =

Sign in free to read the full source 🌴

This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.

Sign in with Discord

Comments

    Sign in to vote, comment, or suggest an edit. Sign in