Skip to content

NPCs and Dialog Trees

Non-Player Characters (NPCs) populate towns and outposts, serving as quest givers, vendors, bankers, refiners, and story guides. Open MMORPG includes node-based dialog trees, conditional menu branches, and automated entity generation.


You can generate NPC prefabs using the NPC Entity Creator:

  1. Open Tools → Open MMORPG → Develop → Npc Entity Creator (3D).
  2. Assign your 3D character mesh or prefab.
  3. Configure the title, nameplate height, and interaction radius.
  4. Click Create Entity.
  5. Save the generated GameObject as a prefab in your project.

Alternatively, add the NpcEntity component to any GameObject with an interaction trigger collider.


Open MMORPG provides two ways to author dialog:

  • Right-click and choose Create → Create GameData → NpcDialog → Npc Dialog.
  • Best for simple greeting text and basic merchant or teleport menus.
  • Right-click and choose Create → Create GameData → NpcDialog → Npc Dialog Graph.
  • Uses a visual node graph (powered by xNode) to connect branching conversation paths, choices, conditional checks, and action triggers.

You can restrict dialog options or quest offers using conditions:

  • Level Requirement: Visible only when the player’s level is $\ge$ minimum level.
  • Quest Condition: Shown only if a quest is Not Started, In Progress, or Completed.
  • Item Condition: Requires the player to hold specific items or quest tokens in their bags.
  • Faction / Class: Restricts options to specific factions or player classes.

Selecting a dialog choice can trigger actions:

ActionResult
Open StoreOpens the merchant UI to buy and sell items using gold or custom currencies.
Open StorageAccesses the player’s personal bank vault.
Open CraftingLaunches the item crafting interface.
Warp CharacterTransports the player to another map or coordinate.
Increase / Decrease GoldAwards or deducts gold (via IncreaseGoldDialogAction or DecreaseGoldDialogAction).
Increase / Decrease ItemAwards quest reward items or takes turn-in items from inventory.