Ending a Mission... with a Victory
Now that you know how to handle tasks let's learn how to end missions. You should also read up on the description.ext for more information on debriefings for mission ends.
I tend to stick End1 as mission fail from EndMission cheat. I tend to stick End2 as Mission Accomplished. I tend to stick End3, End4, End5, etc as Mission Failed. We'll be talking about the accomplish side for this section.
If you only have 1 objective to complete to end the mission as a victory. This should be simple.
Let's go with a simple clear the town example and that's it. So with a simple trigger with OPFOR not present around the area of the town and On Act: ["task1", "succeeded"] call FHQ_TT_setTaskState;
That should do the trick and then you can add "end2" call BIS_fnc_endMission; after that line or you can copy and paste another trigger of OPFOR not present, have a few second timeout and see the task complete first then the Mission Accomplished screen a little later.
I tend to stick End1 as mission fail from EndMission cheat. I tend to stick End2 as Mission Accomplished. I tend to stick End3, End4, End5, etc as Mission Failed. We'll be talking about the accomplish side for this section.
If you only have 1 objective to complete to end the mission as a victory. This should be simple.
Let's go with a simple clear the town example and that's it. So with a simple trigger with OPFOR not present around the area of the town and On Act: ["task1", "succeeded"] call FHQ_TT_setTaskState;
That should do the trick and then you can add "end2" call BIS_fnc_endMission; after that line or you can copy and paste another trigger of OPFOR not present, have a few second timeout and see the task complete first then the Mission Accomplished screen a little later.
Now let's say you have more than 1 objectives, but they're all destroy something or assassinate someone. So let's say you have 3 objectives.
1) General
2) Radar
3) Tank
Basically make like some infantry named General, tank named Tank, and radar named Radar.
Let say if you want if all 3 of those following items are destroyed, then Mission Accomplished.
Create a trigger.
CONDITION: !alive general && !alive tank && !alive radar
ACTIVATION: "end2" call BIS_fnc_endMission;
1) General
2) Radar
3) Tank
Basically make like some infantry named General, tank named Tank, and radar named Radar.
Let say if you want if all 3 of those following items are destroyed, then Mission Accomplished.
Create a trigger.
CONDITION: !alive general && !alive tank && !alive radar
ACTIVATION: "end2" call BIS_fnc_endMission;
Now let's say you have more than 1 objectives and it involves clearing out towns as well. That'll be more complicated to keep track of, but there's always a quick and dirty work around that I tend to use.
Let's say we have 3 objectives.
1) Tank
2) Radar
3) Town1
Town1 will be an Invisible H and you can find it in Empty -> Objects (sign) -> Helipad (Invisible)
Create a trigger.
CONDITION: !alive town1 && !alive tank && !alive radar
ACTIVATION: "end2" call BIS_fnc_endMission;
Let's say we have 3 objectives.
1) Tank
2) Radar
3) Town1
Town1 will be an Invisible H and you can find it in Empty -> Objects (sign) -> Helipad (Invisible)
Create a trigger.
CONDITION: !alive town1 && !alive tank && !alive radar
ACTIVATION: "end2" call BIS_fnc_endMission;
So basically to make sure that the Radar and Tank are !alive you simply kill them. As for the Town1, you're going to have to delete it by a trigger with the DeleteVehicle command (it deletes units that you define).
So make your trigger around the town you want to fill that is full of OPFOR units with that simple OPFOR not present around the area of the town and On Act: ["task1", "succeeded"] call FHQ_TT_setTaskState;
Now add in deleteVehicle town1;
It should now say On Act: ["task1", "succeeded"] call FHQ_TT_setTaskState; deleteVehicle town1;
Now town1 should be !alive
So make your trigger around the town you want to fill that is full of OPFOR units with that simple OPFOR not present around the area of the town and On Act: ["task1", "succeeded"] call FHQ_TT_setTaskState;
Now add in deleteVehicle town1;
It should now say On Act: ["task1", "succeeded"] call FHQ_TT_setTaskState; deleteVehicle town1;
Now town1 should be !alive