Verse Library verse

01 Fragment

Controls island lighting and weather conditions by responding to trigger volume events.

verse-library/using-day-sequence-devices-in-fortnite-creative/01-fragment.verse

# This line tells Verse: "We are making a device for Fortnite Creative."
# It links our code to the Day Sequence device we placed in the editor.
using { /Fortnite.com/Devices }

# This is our "Script" class. Think of it as the brain of our device.
# It inherits from `Device`, which gives it access to Fortnite's built-in tools.
day_sequence_trigger: script() class is:
    # --- COMPONENTS (The "Inventory" of our device) ---
    
    # 1. The Trigger Volume we placed in the editor.
    # We "bind" this to a variable named `trigger_zone`.
    # 'bind' means: "Connect this editor object to this variable in code."
    trigger_zone: trigger_volume = bind()

    # 2. The Day Sequence device we placed in the editor.
    # We bind it to `lighting_device`.
    lighting_device: day_sequence = bind()

    # --- VARIABLES (The "Settings" we can change) ---
    
    # These are our "custom settings." 
    # In Verse, we define variables inside the script class.
    # 'bool' means True or False (like a light switch).
    is_night_mode: bool = false

    # 'float' means a decimal number (like 1.5 or 0.0).
    # We'll use this to control fog density.
    night_fog_density: float = 0.8

    # 'color' is exactly what it sounds like.

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