Quest scripts syntax for AI

From PSwiki
Revision as of 14:54, 6 April 2026 by Talad (talk | contribs) (Created page with "This is the syntax to create a quest script. Any line starting with # is a comment. We add at the start of the file the name and prerequisites as comments. The quest script is divided in steps. Each one being separated with this line: ... NoRepeat This line tells the engine to create a new step. Only the first step does not have the ... line Every step starting from the second one, start with a comment stating the step number, this is important for readability. Exam...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This is the syntax to create a quest script.

Any line starting with # is a comment. We add at the start of the file the name and prerequisites as comments.

The quest script is divided in steps. Each one being separated with this line:

... NoRepeat

This line tells the engine to create a new step. Only the first step does not have the ... line

Every step starting from the second one, start with a comment stating the step number, this is important for readability. Example:

  1. Step 2

Each step can have a prerequisite step to be executed, example step 3 will require step 2 to be executed. If you have parallel steps, then the requirement for step 3 and step 4 can all point to step 2.

Requiments are expressed like this, where we substitute <quest name> with the name of the quest:

Require completion of <quest name> step 2.

Every step must have a P: line with the questid plus a progressive number, which corresponds to the step. Example, assuming our quest number is 1500, and step is 2:

P: 15002

Every step must have a Menu: line . This is what the player will select from the possible speak options. Example:

Menu: Hello, who are you?

Every step must have a line with the answer from the NPC, which starts with the name of the NPC, example:

Harnquist: I'm the local blacksmith!

Every step must have a quest note that goes into the player journal summarizing what he accomplished or learned in that step. Example:

QuestNote You met Harnquist the local blacksmith.


  1. Quest name