Objectives tutorial v1.0
bedges 22 aug 2006
INTRODUCTION
This tutorial is primarily in reference to OFP, but it may well still apply to ArmA.
Objectives are descriptions of the tasks which the player must complete in order to finish the mission. They are shown in the briefing on the first page, and are ticked off once the player completes them, or crossed if the played fails the objective.
FROM THE COMREF
Take a look at the ObjStatus command.
BREAKING IT DOWN
This is what the Plan section of a briefing might look like:
We are attempting to sabotage the enemy's supply lines. You must stop the convoy at all costs!
Objectives:
Destroy the convoy.
Retreat to the evac zone.
It's pretty basic. You then have to determine when the player has completed these things, so that you can tick off the relevant objective.
For the first objective, you could set up a trigger with the condition
(not (canmove truck1)) and (not (canmove truck2))
and in the 'on activation' field type
"1" objstatus "done"
When the trucks are immobilised, the first objective gets a green tick next to it. For the second objective you could set up a trigger at the evac area and group it to the player so that it activates when he is present. To make sure that the player cannot leave before the convoy is destroyed you could make the condition of the trigger
this and (not (canmove truck1)) and (not (canmove truck2))
In the 'on activation' field type
"2" objstatus "done"
It may be that at some point you wish to have objectives only appear when some other condition is met. For example, if we want the instruction to retreat to the evac zone to be hidden, and only appear once the trucks are destroyed, we can hide the second objective by typing
"2" objstatus "hidden"
in the
init.sqs file. When the mission begins, only the first objective will be visible in the briefing. Now when the trucks are destroyed, the first trigger's 'on activation' field would read
"1" objstatus "done"; "2" objstatus "active"
and the second objective would appear in the briefing only once the first is completed.
The same principles apply for defining an objective as "failed", and it will have a red cross next to it.
As you saw above, we had to provide a full check in the second objective trigger for the evac zone to see if the trucks were immobilised when the player entered the trigger area. It would be much easier if we could just check a variable, rather than repeating the 'canmove' commands. Thus most editors include global variable switches with their objectives.
For example, in the
init.sqs file we could put
my_obj1 = false
my_obj2 = false
which defines two global variables and sets them both to false. Now when the trucks are destroyed, the 'on activation' field could read
"1" objstatus "done"; my_obj1 = true; "2" objstatus "active"
my_obj1 is now set to true, so we know the first objective is complete. The evac area trigger's 'condition' field can now read
this and my_obj1
which is much easier to type. The 'on activation' field of the evac trigger can be changed to
"2" objstatus "done"; my_obj2 = true
my_obj2 is now set to true, so we know the second objective is complete.