Verse Library verse

01 Device

Chains triggers to activate a glowing light and cascade activation to the next device in a domino effect.

verse-library/art-and-design/01-device.verse

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

# This is our device. It controls the glowing box.
GlowingBoxDevice := class(creative_device):

    # This is a variable. It holds a trigger_device.
    # We connect this in the UEFN Details panel.
    # A variable is a container for data.
    @editable
    HitTrigger : trigger_device = trigger_device{}

    # This is another trigger for the next box in the chain.
    # Wire this to the next GlowingBoxDevice to create the domino effect.
    @editable
    NextTrigger : trigger_device = trigger_device{}

    # This controls a customizable light device placed near the box.
    # Place a customizable_light_device in UEFN and connect it here.
    @editable
    GlowLight : customizable_light_device = customizable_light_device{}

    # This function runs when the game starts.
    # "override" means we are changing how the device works.
    # "suspends" means it can wait for things.
    OnBegin<override>()<suspends> : void =
    {
        # Subscribe to the trigger so we know when the box is hit.

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