Objectives
From STModWiki
Objectives:
- To write custom objectives, users will have to first write their own objective file for the custom mission. The objective file consists of three main sections, Descriptions, Objectives, and Hints. Tags placed in the Descriptions section appear in game under the briefing section. Likewise tags placed in the objectives section appear under the objective section in game. Lastly tags placed in the Hints section appear in the Hints menu.
Description Tags:
- <Description0>description text</Description0>
- <Description#> denotes the start of a Description tag, where # is the number of the tag in the Description tag list. Tags are numbered 0, 1, 2, 3, etc...
- description text is simply the name of the tag, and will be used to find the correct description in the Objectives_Loacal file. The name that is placed here needs to be unique, and cannot have any spaces in it. Examples of names that will work are STL12_OBJECTIVES_DESCRIPTIONS_DESCRIPTION0 or STL12_MOD, remember no two tags can have the same name.
- </Description#> denotes the end of the Description tag. Note that # here must be the same number that was entered at the start of the description tag.
Objective Tags:
- There are two types of Objective tags, Primary and Secondary. Primary objectives are objectives that players must complete in order to progress through the mission, and secondary objectives are optional objectives for the player.
- We'll start with an overview of Primary Objectives.
- <Primary0 visible="true">objective text</Primary0>
- <Primary# visible="true"> this denotes the start of the tag. The # after Primary needs to be replaced with the number of the tag in the list, tags are numbered 0, 1, 2, etc... The tag also has a visible property which when true means the player can see it, and when false they cannot. Also, there is an optional points="#" which can be placed after the visible property, but before the ending >. # is the amount of points the objective is worth.
- objective text is just like the description text above, it’s just used to find the correct objective in the objectives_local file. The same naming criteria also apply here, also no objective tag can have the same name as a description tag.
- </Primary#> the # here has to match the number after primary in the start of the tag. Otherwise this just denotes the end of the objective tag.
- Now on to the Secondary objectives.
- <Secondary0 visible="true">objective text</Secondary0>
- The secondary objectives function exactly the same as the primary objectives, with the only difference being wherever primary appeared above, the word secondary now appears.
Hint Tags:
- Hints are displayed in the Hints menu in game, and are used to guide players and give them tips on how the mission is to be completed.
- <Hint0 visible="true">hint text</Hint0>
- These again are created exactly the same as the primary and secondary tags above, however where the words primary or secondary appear the word hint now appears.
- Now that the four kinds of tags have been discussed, the structure of the levels objective doc needs to be discussed. Users can see the Objectives template by opening their game folder, then opening the objectives folder and locating the file called "ObjectivesTemplate.xml". Users will place their created tags in the appropriate section.
The root tag:
- <ObjectivesTemplate MissionName="mission name">
- is the last part of this part of the objectives that needs to be discussed. Players need to make sure that ObjectivesTemplate is changed to be a unique tab name, and it is suggested that it is named after the name of the custom mission (The name that is chosen here also needs to be placed at the ending tab). Lastly in the MissonName"mission name" the user should change the words in between the apostrophes to be something that is also appropriately named after their mission. Lastly users can reference the Objective files for each mission in the objective folder (which is in the game folder).
- Now its time to write out what the objectives, descriptions, and hints actually say. Users first need to locate the file Objectives_Localized_Strings_EN.xml and open it. To attach text to the tags, users need to simply add a tag inside of this file of the format:
- <Entry id="NAME_OF_TAG">Enter what the (objective, hint, description) tag should say here.</Entry>
- So for example, if a tag was created of the form:
- <Primary0 visible="true">MY_NEW_LEVEL_OBJECTIVE_PRIMARY0</Primary0>
- And we wanted the objective to say "Scan Planet A.", we would simply add the below to the file Objectives)Localized_Strings_EN.xml:
- <Entry id="MY_NEW_LEVEL_OBJECTIVE_PRIMARY0">Scan Planet A.</Entry>
- Now users can create their own custom text for in game
