Verse Library verse

01 Device

Listens for switch activation events to coordinate prop movement and display feedback messages.

verse-library/interdisciplinary-and-21st-century-connections/01-device.verse

# This script makes a treasure chest open when two switches are on.

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

# This is our main script block.
# It runs when the game starts.
teamwork_treasure_hunt := class(creative_device):

    # Wire these two properties to your Switch devices in the UEFN editor.
    @editable
    Switch_A_Device : switch_device = switch_device{}

    @editable
    Switch_B_Device : switch_device = switch_device{}

    # Wire this property to your Prop Mover device in the UEFN editor.
    @editable
    Treasure_Mover : prop_mover_device = prop_mover_device{}

    # Wire this property to your Button Solver / HUD Message Device for feedback.
    # We use a hud_message_device to show on-screen text to players.
    @editable
    Message_Device : hud_message_device = hud_message_device{}

    # This variable holds the state of the switches.
    # It is a "boolean". A boolean is true or false.
    # We start with both switches being "off".

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