Verse Library verse

01 Device

Links trigger zones to quest completion states and displays HUD messages on interaction.

verse-library/quests/01-device.verse

# QuestTutorial.verse

using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }

# 2. THE QUEST GIVER DEVICE: This is the brain
quest_giver_device := class(creative_device):

    # --- VARIABLES (The "Boxes") ---
    # HasPlayerCompleted: Remembers if the player did the task.
    # Default is false (they haven't done it yet).
    # var makes it mutable so we can change it at runtime.
    var HasPlayerCompleted : logic = false

    # Reference to the trigger_device that wraps the Crystal Prop
    # in the Scene Graph. Wire this up in the UEFN Details panel.
    @editable
    CrystalTrigger : trigger_device = trigger_device{}

    # Reference to the HUD message device to show messages.
    # Wire this up in the UEFN Details panel.
    @editable
    QuestHUD : hud_message_device = hud_message_device{}

    # OnBegin runs once when the match starts.
    # We subscribe to device events here.
    OnBegin<override>()<suspends> : void =
        # Listen for a player entering the crystal trigger zone.

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