Verse Library verse

01 Device

Manages egg hunt objectives, tracks player collections via counters, and triggers win conditions at finish lines.

verse-library/using-egg-consumables-in-fortnite-creative/01-device.verse

# This is our main script file.
# It manages the egg collection game.

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

# We create a new "Game" device.
# This device holds all our game logic.
egg_collector_game := class(creative_device):

    # A reference to the trigger device placed at the finish line.
    # Wire this up in the UEFN editor by selecting the trigger_device here.
    @editable
    FinishTrigger : trigger_device = trigger_device{}

    # A reference to the item spawner that provides the Heal Egg.
    # Wire this up in the UEFN editor.
    @editable
    HealEggSpawner : item_spawner_device = item_spawner_device{}

    # A reference to the item spawner that provides the Hop Egg.
    # Wire this up in the UEFN editor.
    @editable
    HopEggSpawner : item_spawner_device = item_spawner_device{}

    # We track how many eggs each player has collected using a counter.
    # Both spawners will signal this when a player picks up an egg.

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