Verse Library verse

01 Device

Grants wood items automatically when a player completes tracker chopping tasks.

verse-library/configure-the-automated-wood-producer/01-device.verse

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

# This is our main "Island" class. Think of it as the map itself.
# Every island needs one of these to hold the logic.
wood_producer_device := class(creative_device):

    # These are our "Components" (devices) attached to the island.
    # We declare them here so Verse knows they exist.
    # Wire each of these up in the UEFN Details panel for this device.
    @editable
    TrackerDevice : tracker_device = tracker_device{}

    @editable
    ItemGranter : item_granter_device = item_granter_device{}

    @editable
    PropManipulator : prop_manipulator_device = prop_manipulator_device{}

    # This is our "Variable" (Health Bar).
    # It stores how many times we've chopped the tree since the last reward.
    # 'var' makes it mutable so we can change it at runtime.
    var ChopsSinceLastWood : int = 0

    # The "OnBegin" function runs once when the island starts.
    # Like the bus flying over the map before you jump.
    OnBegin<override>()<suspends> : void =
        # Show the prop so the tree is visible when the round 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