using { /Fortnite.com/Devices } using { /Verse.org/Simulation } using { /UnrealEngine.com/Temporary/Diagnostics } # This is our Verse Device. Think of it as the "Brain" of the trap. # It needs to know about the Conversation Device and the Trap (Prop Mover). # In Verse, we define these as "Properties" — like attributes on an item. # You will fill these in the UEFN editor by dragging the devices here. gossip_mill_device := class(creative_device): # note: conversation_device is the real UEFN device type for Conversation Device. @editable MyConversationDevice : conversation_device = conversation_device{} # note: prop_mover_device is the real UEFN device type for Prop Mover. @editable MyTrapDoor : prop_mover_device = prop_mover_device{} # This is the main entry point. It runs once when the game starts. OnBegin() : void = # We need to "listen" for the conversation to end. # In Verse, we use 'Subscribe' to connect an event to a function. # Think of this like plugging a speaker into an amplifier. # When the 'EndEvent' signal fires, our 'TrapSprings' function runs. MyConversationDevice.EndEvent.Subscribe(TrapSprings) # This function is called when the conversation ends. # It's the "Elimination Celebration" music that plays after a win. # note: conversation_device events pass the interacting agent as their payload. TrapSprings(Agent : agent) : void = # Wake up the trap! MyTrapDoor.Begin() # Optional: Say something cheeky in the output log Print("Gotcha! You should have kept moving.")