Creating Missions - Dungeons-of-Kathallion/Bane-Of-Wargs GitHub Wiki

Table Of Contents

Introduction

Missions are a key part of Bane Of Wargs. They're used to make the plot progress and enhance role-playing opportunities for the player. Missions are located in the data/mission.yaml data file. You can find examples of mission here. Missions are simple: they have a name, a description (that are displayed in the player 'tasks' diary section) but also optionally stopovers. Missions can be set to be triggered only if the player has certain conditions. They can also display dialog, give/remove gold or add experience to the player on certain missions conditions. You can check the Gameplay Guide wiki page to understand the mission functionalities.

Mission are also often used to spawn specific enemies at specific locations when the mission is active. Which is useful to make enemies spawn only in a specific condition. Missions can also be set to an 'invisible' mission by setting the invisible: true key, so it doesn't get displayed on the player's diary.

Missions can have 1 of these three states: offered, active or done. Every missions are unique but can be named the same, because of the name attribute. The simplest possible mission is as follow:

Test Mission:
  name: "Test Mission"
  source: 7
  destination: 15
  invisible: False
  force accept: False

This mission will appear while being on map point point7 and will be completed while being on map point point15. To make it more interesting, you can add a description attribute that will be displayed in the player check his tasks in his diary and add a new dictionary on complete with a dialog key, to make the mission display a dialog when completed.

Test Mission:
  name: "Test Mission"
  description: "This is your first mission. Go to $destination."
  source: 7
  destination: 15
  invisible: False
  force accept: False
  on complete:
    dialog: "Generic Mission completion dialog"

Now, let's give the player more interesting role-playing by paying him when he completes the mission and show a dialog when the mission gets offered to the player.

Test Mission:
  name: "Test Mission"
  description: "This is your first mission. Go to $destination."
  source: 7
  destination: 15
  invisible: False
  force accept: False
  on complete:
    dialog: "Generic Mission completion dialog"
    payment: 17.6
  on offer:
    dialog: "Generic Mission offering dialog"

Now, let's add some completion and offering conditions.

Test Mission:
  name: "Test Mission"
  description: "This is your first mission. Go to $destination."
  source: 7
  destination: 15
  invisible: False
  force accept: False
  to offer:
    visited locations:
    - 12
    - 4
  to complete:
    player attributes:
    - 'has visited Cocorico Village'
  on complete:
    dialog: "Generic Mission completion dialog"
    payment: 17.6
  on offer:
    dialog: "Generic Mission offering dialog"

And so on. Missions can become very complex and you'll see on the game vanilla data that dialogs and missions work together and are dependent to each others in the plot. Here's a full definition of a mission.

<mission id>:
  name: <displayed name(str)>
  description: <a clear and concise description(str)>
  stopovers: <stopover map points digit(list)> # not required
  source: <source map point digit(int)>
  destination: <destination map point digit(int)>
  invisible: <true | false(bool)>
  force accept: <true | false(bool)>
  to <offer | complete | fail>: # not required
    player attributes: <custom attributes(list)>
    visited locations: <map points digit(list)>
    known enemies: <enemies id(list)>
    known zones: <map zones id(list)>
    known npcs: <npcs id(list)>
    has items: <items id(list)>
    has missions active: <missions id(list)>
    has missions offered: <missions id(list)>
    random: <percentage(float)>
  on <offer | complete | fail | abort | accept>: # not required
    dialog: <dialog id(str)>
    payment: <gold addition(float)>
    fine: <gold removal(float)>
    exp addition: <experience addition(float)>
    add attributes: <custom attributes(list)>
  enemies: # not required
    <mission enemy id>:
      enemy category: <enemy category(str)>
      location: <map point digit(int)>
      dialog: <dialog id(str)> # display this dialog on enemy death # not required
      to <spawn | despawn>: # not required
        player attributes: <custom attributes(list)>
        visited locations: <map points digit(list)>
        known enemies: <enemies id(list)>
        known zones: <map zones id(list)>
        known npcs: <npcs id(list)>
        has items: <items id(list)>
        has missions active: <missions id(list)>
        has missions offered: <missions id(list)>
        random: <percentage(float)>

Text Replacements

Text replacements are special tags, beginning by a $ character. These tags are used in dialogs phrases and mission descriptions. Once a dialog phrase or a mission description is displayed, each of these tags will be replaced by its corresponding value. You can find every text replacements at the text replacements wiki page. But here are the text replacements for missions-only:

Placeholder Signification
$name_mission the name of the mission
$description the description of the mission
$payment the payment for completing the mission
$destination the destination where the player has to go to complete the mission using format 'x, y'
$stopovers the stopover locations of the mission

Basic Mission Characteristics

The mission must be unique. Each missions have an identifier and no mission should have the same. While offering missions or loading mission events, missions are stored in alphabetical order (more specifically, ASCII lexical ordering), meaning that missions events that have the same location for an event will be triggered by alphabetical order.

name: <displayed name(str)>

While missions id must be unique, the name (displayed name) of the mission can be the same for as many mission as you want. It can be useful if for example you want that two missions have the same name so they look like to be the same (in the plot) but they aren't the same technically (in the game data).

description: <a clear and concise description(str)>

This is a short description of the mission that can contain text replacements. It is displayed when the player look for tasks in his diary.

stopovers:
- <map point digit(int)>
- <another map point digit(int)>
...

This attributes lists all locations that the player has to go to be able to complete the mission if he completed all other conditions. You will list map points using a single integer, which is the map point number. So it will look like this:

stopovers:
- 8 # for map point 'point8'
- 2 # for map point 'point2'

With a definition like this, the player will have to go to map points point8 and point2 before completing the mission.

source: <map point digit(int)>

This is the map point where the player has to be to offer the mission if the the player has all other required conditions. Where <map point> is the $ in point$.

destination: <map point digit(int)>

This is the map point where the player has to be to complete the mission if the the player has all other required conditions. Where <map point> is the $ in point$.

invisible: <true | false(bool)>

This determine whether the mission get displayed on the player's diary or not. Useful for missions that are not tasks but here to activate events or spawn enemies at specific conditions.

force accept: <true | false(bool)>

This make so that the player won't have the choice to accept this mission or not when offered.

Conditions

Conditions are values stored in the player save that can be set to be required for offering/failing/completing a mission. These values are things like visited locations, custom attributes added/removed by dialogs, met enemies, owned items etc...

Conditions can be checked at several times during a mission: when the mission is supposed to be offered, when the mission is supposed to be completed and when the mission is supposed to be failed. Here are the 6 checks that can be ran:

Name Signification
player attributes // the custom attributes added the player that are required
visited locations // the locations that needs to be visited, where you only specify one by one the map point number
known enemies // the enemies that are required to be in the player diary
known zones // the map zones that are required to be in the player diary
known npcs // the npcs that are required to be in the player diary
has items // the items that are required
has missions active // the active missions that are required
has missions offered // the offered missions that are required
random // the percentage of chance that the player has to get the mission offered, if all other conditions are good

Mission Enemies

Mission enemies are enemies that are spawned by a mission at a specific condition.

<mission enemy id>:
  enemy category: <enemy category(str)>
  location: <map point digit(int)>
  dialog: <dialog id(str)> # display this dialog on enemy death
  to <spawn | despawn>: # not required
    player attributes: <custom attributes(list)>
    visited locations: <map points digit(list)>
    known enemies: <enemies id(list)>
    known zones: <map zones id(list)>
    known npcs: <npcs id(list)>
    has items: <items id(list)>
    random: <percentage(float)>
enemy category: <enemy category(str)>

This is which enemy category that will be used to choose a random enemy from that category.

location: <map point digit(int)>

This is the map point number where the mission enemy will be spawned if spawn conditions are all good.

dialog: <dialog id(str)>

This is the id of the dialog that will be triggered and displayed when defeating the mission enemy.

to <spawn | despawn>: # not required
  player attributes: <custom attributes(list)>
  visited locations: <map points digit(list)>
  known enemies: <enemies id(list)>
  known zones: <map zones id(list)>
  known npcs: <npcs id(list)>
  has items: <items id(list)>
  has missions active: <missions id(list)>
  has missions offered: <missions id(list)>
  random: <percentage(float)>

All the attributes that are required to make that mission enemy spawn or despawn. Check the Conditions heading for conditions explanation.

Triggers

A mission can also specify what happens at various key parts of the mission:

on <offer | complete | fail | abort | accept>: # not required
  dialog: <dialog id(str)>
  payment: <gold addition(float)>
  fine: <gold removal(float)>
  exp addition: <experience addition(float)>
  add attributes: <custom attributes(list)>

There are 3 different events that can trigger a response of some sort:

  • offer // this is triggered when the mission gets offered
  • complete // this is triggered when the mission gets completed
  • fail // this is triggered when the mission gets failed
  • abort // this is triggered when the player aborts the mission from the (D) Diary menu
  • accept // this is triggered when the player accepts the mission (also triggered when the force accept is set to True)

Some of the events below usually only make sense for certain triggers. In particular, dialogs and payment can be shown when a mission is offered, but not in response to it being failed.

dialog: <dialog id(str)>

The dialog to be displayed and triggered when the trigger is activated. Note that the to display checks of this dialog won't be run.

payment: <gold addition(float)>

This is how many gold will be added to the player when it gets triggered.

fine: <gold removal(float)>

This is how many gold will be removed from the player when it gets triggered.

exp addition: <experience addition(float)>

This is how many experience will be added to the player when it gets triggered.

add attributes: <custom attributes(list)>

This is the list of different custom attributes to add to the player.

⚠️ **GitHub.com Fallback** ⚠️