Verse Library verse

01 Device

Initializes a boss arena, listens for player triggers, and tracks the current combat target.

verse-library/using-overlord-spire-devices-in-fortnite/01-device.verse

# Import necessary Verse libraries
using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }

# Define our Boss Script as a creative_device so it can live in the UEFN editor.
# Think of creative_device as the base class every placeable Verse object inherits from.
boss_script := class(creative_device):

    # This is our "Constant" - the Spire we want to control.
    # Think of this like saving a specific player's username so you can DM them later.
    # Bind this in the UEFN editor's Details panel after placing your Verse device.
    @editable
    SpireDevice : overlord_spire_device = overlord_spire_device{}

    # The trigger volume players walk into to wake the boss.
    # Bind this to a trigger_device placed around the arena entrance in the editor.
    @editable
    ArenaTrigger : trigger_device = trigger_device{}

    # This is our "Variable" - the current target.
    # Think of this like the "Focus" in a camera or the "Target Lock" in a missile.
    # option(?agent) lets us represent "no target yet" safely.
    var CurrentTarget : ?agent = false

    # This function runs when the script starts (like when the island loads)
    OnBegin<override>()<suspends> : void =
        # Subscribe to the trigger so we know when a player enters the arena.
        # Analogy: Arming the tripwire before the fight starts.

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