The NPC Who Won't Shut Up: Mastering Conversation Events in Verse
The NPC Who Won't Shut Up: Mastering Conversation Events in Verse
You've placed an NPC. You've connected a Conversation device. You've made them say "Hello, traveler." But what if you want to know when they stop talking? Or what if you want to drop a chest of loot the second the conversation ends?
In UEFN, conversations aren't just text boxes that float in the air; they are active game states. Think of a conversation like a Tournament Match. There's a lobby (start), the actual gameplay (the dialogue choices), and the scoreboard/results screen (end). If you don't listen for the "Match Started" or "Match Ended" signals, you can't trigger the next phase of your island.
In this tutorial, we're going to build a "Gossip Mill." An NPC will spill some tea, and the moment they finish their monologue, a trap door opens under the player. We'll use Verse to listen for the specific "beat" of the conversation so your island reacts exactly when the NPC stops talking.
What You'll Learn
- Conversation Events: How to detect when a dialogue starts, ends, or hits a specific checkpoint.
- Event Binding: Connecting a Verse device to a Conversation device's signals (the "wiring" of logic).
- State Management: Using a simple variable to track if the player is currently "in conversation."
- Scene Graph Basics: Understanding how devices talk to each other through the hierarchy.
How It Works
Imagine you're playing Fortnite. You hear footsteps. You don't know if it's a friend or a sweaty tryhard until you see the name tag. That's an Event.
In programming, an Event is a signal that says, "Something just happened!" It's like the Elimination Counter on the HUD. The counter doesn't know who got eliminated or how they died, but it knows that an elimination occurred, so it increments.
A Conversation Device in UEFN has its own set of events:
- On Conversation Started: The moment the NPC opens their mouth.
- On Conversation Event [1-10]: Specific checkpoints within the dialogue (like plot twists or choices).
- On Conversation Ended: The moment the NPC shuts up and the UI disappears.
We are going to bind a Verse device to the On Conversation Ended event. Why? Because that's when we want our trap to spring. If we trigger the trap during the conversation, the player might miss it while reading. If we trigger it after, it's a classic "waited too long to read the lore" trap. Perfect.
Let's Build It
We need two things in your level:
- A Conversation Device with an NPC talking.
- A Verse Device that listens for the conversation to end and then activates a Prop Mover (the trap door).
Step 1: The Setup
- Place an NPC.
- Add a Conversation Device and assign the NPC to it.
- Create a simple conversation:
- Node 1: "Hey, do you know about the secret vault?"
- Node 2: "It's hidden right under your feet!"
- Node 3: "Just kidding. Or am I?"
- Place a Prop Mover (set to "Open" animation) and hide it under a floor tile or make it invisible until triggered.
- Place a Verse Device nearby.
Step 2: The Verse Code
Open the Verse editor for your Verse Device. We need to define the device, bind it to the conversation, and react when the talk fest is over.
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<override>()<suspends> : 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.")```
### Walkthrough: What Just Happened?
1. **`MyConversationDevice` & `MyTrapDoor`**: These are **Properties**. In Fortnite terms, this is like defining your loadout before you drop. You need to tell the Verse device *which* conversation device and *which* trap door to use. In the UEFN editor, you'll drag the actual devices from your level into these slots in the Verse Device's properties panel.
2. **`OnBegin`**: This is the **Lobby Phase**. It runs once when your island loads. We don't want to check for the end of the conversation every single frame (that's wasteful, like checking if you have loot every millisecond). Instead, we set up a listener.
3. **`.Subscribe(...)`**: This is the **Cable**. We are connecting the `ConversationEndedEvent` event from the Conversation Device to our `TrapSprings` function. When the event fires, the function runs.
4. **`TrapSprings()`**: This is the **Action**. It calls `.MoveToEnd()` on the Prop Mover, which triggers its configured movement animation. Boom. Trap triggered.
### Scene Graph Note: Hierarchy Matters
In UE6 and Verse, everything is part of the **Scene Graph**. Your Verse Device, Conversation Device, and Prop Mover are all **Entities** (objects in the world) with **Components** (properties like health, position, or dialogue scripts). By defining `MyConversationDevice` as a property in your Verse device, you are creating a link in the scene graph. The Verse device doesn't "search" for the conversation device every time; it already has a direct reference to it. This is efficient and prevents bugs where the trap tries to open a conversation device that doesn't exist.
## Try It Yourself
The current trap only triggers once. What if the player starts a *new* conversation with the NPC? The trap is already open, so nothing happens.
**Challenge:** Modify the code so that the trap resets (closes) when a *new* conversation starts.
**Hint:** Look at the `On Conversation Started` event. You'll need to bind a second callback in `OnBegin` that calls a new function, maybe called `TrapReset()`, which uses `.MoveToStart()` on the Prop Mover.
```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()
Recap
- Events are signals that say "Something happened!" (like an elimination or a conversation ending).
- Subscribing connects an event to a function, so your code reacts automatically.
- Properties let your Verse device know which specific devices in your level to control.
- Conversation Events let you time your gameplay mechanics perfectly with NPC dialogue.
Now go build some islands where the NPCs don't just talk—they act. And maybe put a pit trap under the next one.
References
- https://dev.epicgames.com/documentation/en-us/uefn/conversation-devices-in-unreal-editor-for-fortnite
- https://dev.epicgames.com/documentation/en-us/fortnite/creating-conversations-in-unreal-editor-for-fortnite
- https://dev.epicgames.com/documentation/en-us/fortnite/conversation-device-design-examples
- https://dev.epicgames.com/documentation/en-us/fortnite/36-00-fortnite-ecosystem-updates-and-release-notes
- https://dev.epicgames.com/documentation/fortnite/verse-starter-06-managing-the-game-loop-for-in-unreal-editor-for-fortnite
Verse source files
- 01-device.verse · device
- 02-device.verse · device
Turn this into a guided course
Add Basic Conversation Events to your free study plan — we'll suggest related pages and stitch the lot into one compile-checked, self-guided lesson with worked examples and quizzes.
References
Original tutorial generated by Verse Island from the Verse/UEFN knowledge base, with references to the Epic Games sources above. Code is validated against the knowledge base.