Verse Library verse

02 Device

Subscribes to conversation end events to activate a prop mover trap door upon player interaction.

verse-library/basic-conversation-events/02-device.verse

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

gossip_mill_device := class(creative_device):

    @editable
    MyConversationDevice : conversation_device = conversation_device{}

    @editable
    MyTrapDoor : prop_mover_device = prop_mover_device{}

    OnBegin<override>()<suspends> : void =
        # Bind the end event
        MyConversationDevice.ConversationEndedEvent.Subscribe(TrapSprings)

        # TODO: Bind the start event here!
        # MyConversationDevice.ConversationStartedEvent.Subscribe(TrapReset)

    TrapSprings(Agent : agent) : void =
        MyTrapDoor.MoveToEnd()
        Print("Gotcha! You should have kept moving.")

    # note: Uncomment and implement TrapReset once you add the Subscribe call above.
    # TrapReset(Agent : agent) : void =
    #     MyTrapDoor.MoveToStart()

Comments

    Sign in to vote, comment, or suggest an edit. Sign in