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:
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: (By default the Objectives_global.xml file will have an example listed identical to the one shown below. If not in your game directory you must extract the libs folder from the gamedata.pak file.)
Objectives_global.xml is found in:
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>:
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:
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:
Please refer to the UI Localization Documentation for more information on the localization system.
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 objectives that are valid for more than one level, are the objectives that you should add to the Objectives_global.xml. An example from Crysis 3, would be the tactical scan (visor) info, or simple basic objectives such as go here, kill this, destroy that etc...
Sometimes, depending on the amount of levels you want to ship with your game, this Objectives_global.xml can get quite large. And certain mission objectives are only valid for a specific level. To make a dedicated "level-specific" objectives list, you can re-create this file embedded within the level itself.
For example: the Woodland level shipped with the GameSDK Sample Project contains its own dedicated objectives.xml file save within the woodland\leveldata folder.
Pic1: Objectives.xml in GameSDK Sample Project
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.
Pic2: Placing a mission objective entity
Now, go to Entity Properties and click the Mission Objectives Browser button, shown in the image below. In the MissionID field, click the button to open the browser to select the missionID you want to assign to this objective entity.
Pic3: Mission Objective browser button
For more details on setting up a mission objective, refer to the Setting Up the Basic Game Logic tutorial.