Mapping 104: Objectives

There are numerous ways to accomplish objectives in MBII. In base JKA, a lot of the entities are linked to the .siege file, which handles certain messages on objective completion. This is also the same for MBII, which uses JKA siege as it's base, and adds a few additional features.

### Guide

To connect your map with your siege information, let's first create an info\_siege\_objective.

If we set the key and value to objective 1, it will fire whatever is set within our .siege file. For example:

```
 Objective1
 {
 goalname "ACCOMPLISH: Defend yourselves!"
 final -1
 message\_team1 "We have survived the attack"
 message\_team2 "The rebels still are alive!"
 objdesc "ACCOMPLISH: Fend off the Empire's attack!"
 objgfx "gfx/mp/mplevels/samplemap/rebelobjective1"
 }

```
Our entity will now fire and complete that objective as well as print the messages to both team 1 and 2.

Using our knowledge of triggers and targets from the past few guides, try making a setup using these which fire at your info\_siege\_objective. You could have it as a hack, you could have it as an area you walk into or capture, you could have it upon destroying something, you could even have it if you bring a siege item to an area! There are a lot of possibilities. Here is a very basic .map file which has spawns and an info\_siege\_objective setup. Try opening the map, compiling it (Build menu) and adding this Samplemap.siege file.

Once you've done that, open the file in a text editor like notepad (any text program will do) and take a look at what the file comprises of. Confused yet? I'll explain what most of this stuff means:

* Teams 'team1 Rebels' / 'team2 Imperials'
	+ This tells the game what to display on the briefing screen for team1 and team2. Mainly for visual use, you could type anything here and have it display ingame. Make sure to leave team1 and team2 alone and only change what comes after them.
* mapgraphic "gfx/mp/mplevels/samplemap/samplemaplayout"
	+ You can specify an image to use for the objective screen. Normally its used for an overhead shot of the map showing the layout and routes. Make sure the image is 256 by 512 pixels.

```
Rebels
{
RequiredObjectives 1
Timed 300
UseTeam "Samplemap\_Rebels"
TeamIcon "gfx/2d/mp\_rebel\_symbol\_3"

```

* 1 This is the start of Team 1's part of the siege file (or rebel team in this case).
* 3 Required objectives tells the game how many objectives need to be completed before scoring a round for this team.
* 4The Timed 300 means the rebels are the attacking force and therefor have to complete the objectives before time runs out (in this case 5 mins is the time limit). Only one team can have this entry as it determines who the attackers and defenders are.
* 5 The UseTeam corresponds to the team config files (more on those later). Unlike the team1 and team2 commands we saw earlier, UseTeam gets its information from another textfile and therefor the name entered here must match the filename of the team config file.
* 6 Finally, TeamIcon allows you to specify an icon for your team. These should be 128 by 128 pixels.

```
Objective1
{
goalname "ACCOMPLISH: Defend yourselves!"
final -1
message\_team1 "We have survived the attack"
message\_team2 "The rebels still are alive!"
objdesc "ACCOMPLISH: Fend off the Empire's attack!"
objgfx "gfx/mp/mplevels/samplemap/rebelobjective1"
}

```

* Objective1 starts off at the top of an objective entry, can go higher if you have multiple objectives (example being objective2, objective3, etc). The game will match the map's info\_siege\_objective numbers to whats specified here and display the according messages.
* Goalname is more editor convenience then anything else, pretty much just put something here that will tell you what the objective is.
* The final command is pretty important, this tells the game when to stop the round completely and give a score to the team. A value of -1 means the objective does not end the round, useful for when you have multiple objectives like opening doors and such. A value of 0 means the round ends right then and there.
* Message\_team1 and 2 will show onscreen messages to both teams when the objective is completed. You can type anything here but keep it short. Too long and the text goes offscreen.
* Objdesc is the text for what appears in the objective menu to describe a certain objective. Again you can type anything here.
* Objgfx allows you to link to an image to better show what the objective is (some examples could be a control panel, person, area, etc). Make sure the image is 128 by 128 pixels.

```
 wonround "Mission Accomplished."
 lostround "Mission failed."
 roundover\_sound\_wewon ""
 roundover\_sound\_welost ""
 roundover\_target "siegeend"
 attackers 1

 briefing ""
 }

```
\*Wonround is the message that the winning team sees (in this case the Rebel team). You can type anything here but remember to keep it short.

* Lostround is the message seen if the team loses the round, just like wonround pretty much though only seen in the inverse scenario.
* roundover\_target firing at siege end is self explanatory

See if you can create a .siege file for it which causes the round to end upon hacking the trigger! **Remember, format is very important, missing quotation marks, brackets or improper spacing could break your .siege.**[1]

There are of course many ways to get the info\_siege\_objective to fire. Try playing around with the possibilities or decompiling other maps to figure out how they were accomplished.

### Minimap Icon (info\_siege\_radaricon)

Another important entity for objectives (and to help with map navigation) is info\_siege\_radaricon. This is the icon that shows up in your radar's Automap (minimap). Simply place this entity by your objective and it will show up on your minimap. By default the radar icon will show up as a glowing white dot. You can of course add your own icon, just make sure it is small and following the rule of 1:1 ratio and powers of 2. Something sized at 64x64px should work. As usual with entities, giving your entity a targetname and having a trigger or target firing at it will toggle it on or off. You can also have it hidden on the radar at first by setting startoff to 1.