Verse Library verse

01 Device

Grants random candy items to players who enter a trigger volume.

verse-library/using-halloween-candy-items-in-fortnite-creative/01-device.verse

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

# This is our main script block
SpookyCandyDevice := class(creative_device):

    # This is the Item Granter device
    # We connect it in the editor
    @editable
    CandyMachine : item_granter_device = item_granter_device{}

    # This is the Trigger device
    # We connect it in the editor
    @editable
    PlayerTrigger : trigger_device = trigger_device{}

    # This is the list of all candies
    # Each entry is an item_granter_device set up in the editor
    # to grant a specific candy type via its Item setting
    # note: Verse has no built-in candy item enum; candy type is
    # configured per-device in the editor, so we use one
    # item_granter_device per candy and pick among them randomly.
    @editable
    CandyGranters : []item_granter_device = array{}

    # OnBegin runs once when the game starts
    OnBegin<override>()<suspends> : void =

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