Verse Library verse

01 Device

Controls mercenary hire states, binds summon buttons to guard spawners, and tracks game conditions.

verse-library/using-guard-spawner-devices-in-fortnite-creative/01-device.verse

# Import the necessary libraries for devices and game logic
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }

# This is our main script file. Think of it as the "Brain" of the island.
# It inherits from creative_device, which is the real base class for
# island scripts that interact with placed devices in UEFN.
my_mercenary_script := class(creative_device):

    # --- THE VARIABLES (The "Stats") ---

    # This variable tracks if the player has hired guards.
    # It starts as "false" (not hired).
    # 'var' makes it mutable so we can flip it later.
    var HasHiredGuards : logic = false

    # This is a reference to the Guard Spawner device.
    # In the UEFN editor, drag your placed Guard Spawner device
    # into this property slot to wire it up.
    @editable
    GuardSpawnerRef : guard_spawner_device = guard_spawner_device{}

    # This is the Button device.
    # In the UEFN editor, drag your placed Button device into this slot.
    @editable
    SummonButtonRef : button_device = button_device{}

    # --- THE SETUP (When the game 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