Quest Data

Quest information is stored in the dialogue database and its corresponding Lua environment as described in the dialogue database Items/Quests section.

Below are some example quests.


Example 1: Kill 5 Rats

Field Value
Group "Bremen"
State unassigned
Description "The baker asked me to bring him 5 dead rats to make a pie. I need to collect [lua(Variable["Rats_Remaining"])] more."
Success Description "I brought the baker 5 dead rats, and we ate a delicious pie! Yum!"
Failure Description "I freed the Pied Piper from jail. He took all the rats. No pie for me...."
Trackable true
Track false
Abandonable true
Abandon Sequence Audio(sadTrombone)

Since this quest has a Group, it will be organized in the quest log window with all other quests that share the same group name ("Bremen").

Note the [lua(code)] tag in the Description field. It's used to include the player's current count.

You could add an Increment On Destroy component to the rats to increment the Variable["Rats_Remaining"] as the player catches each rat.

This quest is trackable and abandonable in the Quest Log Window. Your gameplay HUD is responsible for displaying tracking information if the player enables tracking. You can use the Quest Tracker HUD or write your own. Since Track is currently false, it won't be shown in the quest tracker HUD until the player toggles tracking on in the quest log window.

The Abandon Sequence field contains a sequence that plays a sad trombone audio clip if the player abandons the quest.


Example 2: Escape the Prison Planet

This example quest has quest entries (subtasks).

Field Value
Name "EscapePlanet"
Display Name "Escape the Prison Planet"
Group "Prison Planet"
State active
Trackable true
Track true
Description "I've been unjustly imprisoned on this planet, but I'll escape!"
Entry Count 4
Entry 1 State active
Entry 1 "I woke up on this prison planet, but I won't die here."
Entry 2 State unassigned
Entry 2 "I broke out of my cell by hacking the electronic lock."
Entry 3 State unassigned
Entry 3 "I set up a distraction to lure the guard away from his ship."
Entry 4 State unassigned
Entry 4 "I stole the guard's ship and finally made my escape."

Although the quest's name is "EscapePlanet", its display name, "Escape the Prison Planet", will be shown in the quest log window and quest tracker.

Since Track is true, when the quest becomes active it's automatically shown in the Quest Tracker HUD. If Trackable were true and Track were missing or false, the player would have to enable tracking in the Quest Log Window.

If you reference these fields in Lua code, remember to replace spaces and hyphens with underscores as described in Important Note About Table Indices. For example:

Item["Escape_the_Prison_Planet"].Track = false

Localization

Quest text can be localized. See How to Localize Quests.


<< Quest System | Quest Design Notes >>