Verse Library verse

01 Fragment

Manages beacon activation, color updates, and HUD badge text for tracking loot events.

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

# Import the necessary Verse libraries for game logic and beacons
use CoreLibs
use GameFeatures
use Beacon

# This is our main script. It runs on the island.
script class LootGoblinTracker: Island:
    # VARIABLES: These are our settings.
    # 'my_beacon' is a reference to the Beacon device we place in the editor.
    # We will assign this in the editor later.
    my_beacon: Beacon = Beacon{}

    # 'is_active' is a boolean (true/false) variable.
    # It tracks whether the beacon is currently showing.
    is_active: bool = false

    # FUNCTION: This is the "Elimination" event for our beacon.
    # It takes a color and a text string as inputs.
    function UpdateBeacon(new_color: linear_color, new_text: string) -> void:
        # If the beacon is already active, turn it off first.
        # This prevents visual glitches.
        if is_active:
            my_beacon.SetMode(BeaconMode::None)
            is_active = false

        # Now, set the new color and text.
        # SetColor changes the particle effect color.
        my_beacon.SetColor(new_color)
        
        # SetBadgeText changes the text on the HUD marker.

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