How to Create a Quest Line in .uri
This guide walks you through the process of creating a quest line using the .uri
language. You'll learn how to define quests, structure their flow using behavior trees, and connect everything to an NPC in the world.
Before diving into this example, it’s highly recommended that you first understand the basics of the .uri
language. This includes how its tree structure works, how actions are defined, how behavior trees function, and how constructors are processed. You can find all of this in the .uri
guides. Having a solid grasp of these fundamentals will help you follow and customize this quest line effectively.
Step 1: Define Each Quest
Every quest is a self-contained block starting with the QUEST
constructor. See more at Core > Extensions > Constructors > QUEST
Here’s how a quest is structured:
QUEST
id "example_quest_1_line_1"
name "First Steps"
description "Begin your Pokémon adventure by defeating some wild Pokémon. You'll need to run a few errands before claiming your first vehicle. Let’s go — this is just the beginning!"
author "Soru"
duration 15
profile "Beginners"
category "SIDE"
theme "General"
context "You look confused… and judging by that old bike, you're probably here to get your own, right?"
"Before I hand it over, go do some training. Defeat 5 wild Pokémon around here. Don’t mess it up — remember your type chart!"
success "Nice job! Before we continue, take this reward."
failure "Don't you appreciate Louis Oberon's hard work?"
participants 1
rewards
item (10) poke_ball
item (6) potion
money (500)
goals
pokemonFainted (5) "Defeat 5 wild Pokémon" wild=true
What each field means:
-
id
: Unique identifier for the quest. -
name
: Display name of the quest. -
description
: Text shown in the quest request. -
author
: The creator of the quest. -
duration
: Estimated or suggested time to complete (used for orientate players). -
profile
: Category for grouping (e.g., Beginners, Experts, Miners, Taxi Drivers...). -
category
: Type of quest (SIDE
,MAIN
, etc.). -
theme
: Quest category (e.g., General). -
context
: Dialogue lines shown when starting the quest. -
success
/failure
: Dialogue shown upon success or failure. -
participants
: How many players must do this quest together. -
rewards
: Items or money received upon completion. See more atCore > Extensions > Rewards
-
goals
: Defines what must be done (e.g., faint Pokémon, catch, level up). See more atCore/Monsters > Extensions > Events
Step 2: Chain Quests Together with Behavior Trees
To define progression, you use BEHAVIOURTREE
. This tree runs when an NPC is interacted with. Each quest is linked to the next via startQuest
. The interaction tree run the actions that we define, see more at Core > Extensios > Actions
.
Root Tree (First contact)
BEHAVIOURTREE
name example_line_1_tree
interaction
knows
tell "Hey there! How's it going?"
do example_line_1_1_tree
tell "Who are you? I’m Jimbo."
do example_line_1_1_tree
🧠 What it does:
This is the entry point. It checks if the player already “knows” this NPC. Depending on that, it shows different lines and redirects to the next tree using do line_1_1_tree
.
First Quest Tree
BEHAVIOURTREE
name example_line_1_1_tree
interaction
startQuest example_quest_1_line_1
do example_line_1_2_tree
tell "Come back whenever you’re ready."
tell "You can always retry later."
nothing
nothing
tell "Come back anytime."
tell "You're not ready yet."
🧠 What it does:
This tries to start example_quest_1_line_1
. If successful, it moves on to example_line_1_2_tree
.
The extra tell
and nothing
lines are fallback messages depending on why the quest couldn't be started (e.g., already active, requirements not met, etc.).
Second Quest Tree
BEHAVIOURTREE
name example_line_1_2_tree
interaction
startQuest example_quest_2_line_1
do example_line_1_3_tree
tell "Come back whenever you’re ready."
tell "You can always retry later."
nothing
nothing
tell "Come back anytime."
tell "You're not ready yet."
🧠 Same structure, now starting the second quest (example_quest_2_line_1
) and preparing for the third tree.
Third Quest Tree (Final)
BEHAVIOURTREE
name example_line_1_3_tree
interaction
startQuest example_quest_3_line_1
tell "Sorry, I have nothing else for you."
tell "Come back anytime."
tell "You can always retry later."
nothing
nothing
tell "Come back whenever."
tell "You're not ready yet."
🧠 This final step gives the third and last quest. After that, there’s nothing else to give.
Step 3: Attach the Tree to an NPC
Now connect it all to a world character using the NPC
constructor:
NPC
name "example_starter_trainer"
model "cs_dale"
position 1982.66 3771.62 32.17 209.76
interaction
do example_line_1_tree
behaviour
nothing
-
model
: Ped model used for the NPC. -
position
: World coordinates + heading. -
interaction
: Starts the root behavior tree when talked to. -
behaviour
: NPC behavior in the world. Here it does nothing.
Final Result
By structuring quests like this:
-
Players are guided step-by-step through increasingly advanced tasks.
-
You control the dialogue, logic, rewards, and conditions.
-
The system automatically handles fallback dialogue based on the player’s current quest state.
Full .uri
example:
// -------------------------- QUESTS --------------------------
QUEST
id "example_quest_1_line_1"
name "First Steps"
description "Begin your Pokémon adventure by defeating some wild Pokémon. You'll need to run a few errands before claiming your first vehicle. Let’s go — this is just the beginning!"
author "Soru"
duration 15
profile "Beginners"
category "SIDE"
theme "General"
context "You look confused… and judging by that old bike, you're probably here to get your own, right?" "Before I hand it over, go do some training. Defeat 5 wild Pokémon around here. Don’t mess it up — remember your type chart!"
success "Nice job! Before we continue, take this reward."
failure "Don't you appreciate Louis Oberon's hard work?"
participants 1
rewards
item (10) poke_ball
item (6) potion
money (500)
goals
pokemonFainted (5) "Defeat 5 wild Pokémon" wild=true
QUEST
id "example_quest_2_line_1"
name "Louis Oberon Hurto – Your invention is mine now"
description "A small errand from Jimbo, a local delivery guy. Catch five wild Pokémon to fill your team. That bike is almost yours!"
author "Soru"
duration 20
profile "Beginners"
category "SIDE"
theme "General"
context "Well done, but it’s not enough... I need you to catch five more." "Careful not to knock them out… it helps if they’re asleep, paralyzed, and so on."
success "Good job! But before we continue… here’s your bike."
failure "Don't you appreciate Louis Oberon's hard work?"
participants 1
rewards
item (1) pokebike
money (250)
goals
pokemonCaptured (5) "Catch 5 wild Pokémon" wild=true
QUEST
id "example_quest_3_line_1"
name "The Nexus is Big"
description "Jimbo introduces you to the Nexus and encourages you to train your Pokémon in exchange for a reward. You can also start other quests in parallel — no problem!"
author "Soru"
duration 120
profile "Beginners"
category "SIDE"
theme "General"
context "By the way, I haven’t explained — this Pokémon Center is known as 'The Nexus'. It’s a place where people look for trainers for contracts, adventures or missions…" "You should stop by here daily… But anyway, I suggest leveling up three Pokémon to level 15. It’ll be useful for what’s coming…" "Maybe you can do other quests at the same time. Actually, I think there's a battle fanatic looking for people — he’s wearing a cyclist suit."
success "You're a champ! Take this egg — it’s said to be valuable. I find them all over the place, really."
failure "Don't you appreciate the great Nexus?"
participants 1
rewards
item (1) lucky_egg
goals
levelUp (3) "Raise 3 Pokémon to level 15" specific=15
// -------------------------- BEHAVIOUR TREES --------------------------
BEHAVIOURTREE
name example_line_1_tree
interaction
knows
tell "Hey there! How’s it going?"
do example_line_1_1_tree
tell "Who are you, buddy? I’m Jimbo."
do example_line_1_1_tree
BEHAVIOURTREE
name example_line_1_1_tree
interaction
startQuest example_quest_1_line_1
do example_line_1_2_tree
tell "Come back whenever you’re ready."
tell "You can always try again later."
nothing
nothing
tell "Come back anytime."
tell "You're not quite ready yet."
BEHAVIOURTREE
name example_line_1_2_tree
interaction
startQuest example_quest_2_line_1
do example_line_1_3_tree
tell "Come back whenever you’re ready."
tell "You can always try again later."
nothing
nothing
tell "Come back anytime."
tell "You're not quite ready yet."
BEHAVIOURTREE
name example_line_1_3_tree
interaction
startQuest example_quest_3_line_1
tell "Sorry, I don’t have anything else for you right now."
tell "Come back anytime."
tell "You can always try again later."
nothing
nothing
tell "Come back whenever."
tell "You're not quite ready yet."
// -------------------------- NPC --------------------------
NPC
name "example_starter_trainer"
model "cs_dale"
position 1982.66 3771.62 32.17 209.76
interaction
do example_line_1_tree
behaviour
nothing
Tips
-
You can use the
failure
message to give personality to your characters even when the player messes up. -
The
do
command allows nesting behavior trees to avoid repeating long dialogues. -
Use
participants
> 1 if you want cooperative quests. -
All
startQuest
entries support fallback results — so take advantage of them!