Setting Up Mission Objectives

Overview

After completing this tutorial, you will be able to set up an objective for use within a game level. This tutorial assumes that the reader has a basic knowledge of the Flow Graph Editor and object placement.

How to Create a Custom Objective Text for a Level

The Objectives_global.xml File

The file that will contain all the information for the objective is located in: Game\Libs\UI\Objectives_global.xml.

When you open the file in a text editor, you will see a few lines of example objectives. The following example shows the text broken into useful parts.

Setting Up the File

The text in the file will look like this:

<Root>
  <Example>
    <Objective_01 Name="Example Objective 1" Description="Example Text." />
    <Objective_02 Name="Example Objective 2" Description="Example Text." />
    <Objective_03 Name="Example Objective 3" Description="Example Text." />
  </Example>
</Root>

At the start and end of the objectives file are the <Root> and </Root> tags.

Now we will add our own objectives, you need to create a tag for the level. If the level is called Levelname, the tags will be <Levelname> and </Levelname>:

<Root>
  <Example>
    ...
  </Example>

  <Levelname>
  </Levelname>
</Root>

Objective Number

<Root>
  <Example>
    ...
  </Example>
  <Levelname>
    <Objective_01 Name="Mission Objective Title" Description="Mission Objective Description" />
  </Levelname>
</Root>

Now to setting up the objective and its text.

Within the level tags, place another tag containing a short reference number for the objective. For example, if it is the first objective in the level, open the tag with <Objective_01.

Please note that if you want multiple objectives in the level, you should clone this entire line, with a second objective line, as shown below:

<Root>
  <Example>
    ...
  </Example>
  <Levelname>
    <Objective_01 Name="Mission Objective Title" Description="Mission Objective Description" />
    <Objective_02 Name="Mission Objective Title" Description="Mission Objective Description" />
  </Levelname>
</Root>

Objective Name

<Root>
  <Example>
    ...
  </Example>
  <Levelname>
   <Objective_01 Name="Mission Objective Title" Description="Mission Objective Description" />
  </Levelname>
</Root>

Next, add a Name for the objective. After <Objective_01, add Name="Mission Objective Title", where Mission Objective Title is the name of your objective e.g. "Lower Control Rods".

It is possible to use text tags for the name and description of the objectives. This can be useful as they can then be linked to the localization spreadsheet. To do this you have to place an '@' at the beginning and use the correct text tag from the localisation file.

An example is shown below:

 <Objective_01 Name="@texttagexample01" Description="@texttagexample02" />

Please refer to the UI Localization Documentation for more information on the localization system.

Objective Description

<Root>
  <Example>
    ...
  </Example>
  <Levelname>
    <Objective_01 Name="Mission Objective Title" Description="Mission Objective Description" />
  </Levelname>
</Root>

Now, create the description of the objective. The description is the longer text under the name of the objective. Replace Mission Objective Description with the required text. To finish, close the tag with />.

Mission Objective Entity

Placing the Mission Objective Entity

Now that you have set up an XML file, place an Entity -> Others -> MissionObjective in the level.

Now, go to Entity Properties and click the Mission Objectives Browser button, shown in the image below.

Select the desired objective from the list. For more details on setting up a mission objective, refer to the Setting Up the Basic Game Logic tutorial.