Tasks
The ways tasks work will be based on your briefing.sqf on what you want to specify your tasks to be. I'll make up random scenario cases as examples.
There are 5 task states, but it is best to know these 3. Succeeded, Failed, Canceled
- Assigned can be nice to know as well
- You don't need to know Created because we'll be using FHQ_TT_addTasks for adding tasks on the fly instead.
Let's have Task1 as our example of a kill a unit or destroy a building kind of task.
Let's open up the editor and have a unit of ourselves and then create an enemy or some random building/structure you want to destroy or blow up with a satchel charge.
Don't forget to define your target's name. I'll call him target.
There are 5 task states, but it is best to know these 3. Succeeded, Failed, Canceled
- Assigned can be nice to know as well
- You don't need to know Created because we'll be using FHQ_TT_addTasks for adding tasks on the fly instead.
Let's have Task1 as our example of a kill a unit or destroy a building kind of task.
Let's open up the editor and have a unit of ourselves and then create an enemy or some random building/structure you want to destroy or blow up with a satchel charge.
Don't forget to define your target's name. I'll call him target.
Now create a trigger. Put the following lines in the right positions.
Condition: !alive target
On act: ["task1", "succeeded"] call FHQ_TT_setTaskState;
Click ok when you're done. !alive means NOT ALIVE. (aka the unit is dead or non-existent)
Condition: !alive target
On act: ["task1", "succeeded"] call FHQ_TT_setTaskState;
Click ok when you're done. !alive means NOT ALIVE. (aka the unit is dead or non-existent)
When you eliminate your target in game and complete that task. The dialog below should show up and if you go into your task screen, there should be a green checkmark by it stating that you have completed it.
Now instead of having Task1 as destroy a certain target, let's make it clear out an enemy base instead. So let's place a group of OPFOR units inside a city, and create a trigger with a radius of how big you want it to be and your job is to clear out that area.
Activation: OPFOR
Not present
Condition: this
On act: ["task1", "succeeded"] call FHQ_TT_setTaskState;
Activation: OPFOR
Not present
Condition: this
On act: ["task1", "succeeded"] call FHQ_TT_setTaskState;
There's many other kinds of scenarios you can do but the On Act will be the same unless you're doing it for a different task, change Task1 to something like Task2 if you are handling the task completion for Task2. You can also change succeeded into something like failed or canceled. That's why I mention the 3 case scenarios worth noting would be succeeded, failed, or canceled.
We can also make a task where you protect someone and if they were to die. Then for example condition: !alive guy and on Act: ["task1", "failed"] call FHQ_TT_setTaskState; . You probably should get the point by now. I'll cover more on types of situations later like escape missions, steal car missions, unlocking vehicles, and etc.
You can also add tasks on the fly as well. Simply use the FHQ_TT_addTasks commands from the briefing. You can simply copy and paste, and modify it then paste it into the On. Act menu.
For example...
Condition: !alive target
On act: ["task1", "succeeded"] call FHQ_TT_setTaskState;
[
west,
["task2",
"Now that you have finished off the enemy general. Your task is to now finish off all of his forces <marker name='test2'>here</marker>.",
"Eliminate all OPFOR",
"!",
getmarkerpos "test2"
]
] call FHQ_TT_addTasks;
We can also make a task where you protect someone and if they were to die. Then for example condition: !alive guy and on Act: ["task1", "failed"] call FHQ_TT_setTaskState; . You probably should get the point by now. I'll cover more on types of situations later like escape missions, steal car missions, unlocking vehicles, and etc.
You can also add tasks on the fly as well. Simply use the FHQ_TT_addTasks commands from the briefing. You can simply copy and paste, and modify it then paste it into the On. Act menu.
For example...
Condition: !alive target
On act: ["task1", "succeeded"] call FHQ_TT_setTaskState;
[
west,
["task2",
"Now that you have finished off the enemy general. Your task is to now finish off all of his forces <marker name='test2'>here</marker>.",
"Eliminate all OPFOR",
"!",
getmarkerpos "test2"
]
] call FHQ_TT_addTasks;
You can do the same thing for new briefing diary entries on the fly. Just use FHQ_TT_addBriefing.
For example...
Condition: !alive target
On act: ["task1", "succeeded"] call FHQ_TT_setTaskState;
[
west,
["New Intel",
"We have spotted new enemies inbound from <marker name='test2'>this position</marker>."]
] call FHQ_TT_addBriefing;
For example...
Condition: !alive target
On act: ["task1", "succeeded"] call FHQ_TT_setTaskState;
[
west,
["New Intel",
"We have spotted new enemies inbound from <marker name='test2'>this position</marker>."]
] call FHQ_TT_addBriefing;
For adding new diary entries/briefings on the fly, I recommend you use the hint command to make a hint appear for the player that they got a new diary entry because these do not alert you that you got a new entry unlike tasks.
So add something like this to your On Act after the diary entry.
hint "New journey entry";
or use hintsilent if you don't want that beeping sound
hintsilent "New journey entry";
So add something like this to your On Act after the diary entry.
hint "New journey entry";
or use hintsilent if you don't want that beeping sound
hintsilent "New journey entry";
You can always add more than 1 task or briefing at a time. It's the same way as adding them in the briefing.sqf but instead you're throwing it the On Act. part of the trigger. They're formatted like this...
Tasks' format
[
SIDE,
["task name",
"task text in briefing",
"task title in briefing",
"waypoint text",
getmarkerpos "name of marker <for position> (optional)"
]
] call FHQ_TT_addTasks;
Journey entry/Briefing's format
[
SIDE,
["Journal Entry Title",
"Journal Entry description"]
] call FHQ_TT_addBriefing;
Tasks' format
[
SIDE,
["task name",
"task text in briefing",
"task title in briefing",
"waypoint text",
getmarkerpos "name of marker <for position> (optional)"
]
] call FHQ_TT_addTasks;
Journey entry/Briefing's format
[
SIDE,
["Journal Entry Title",
"Journal Entry description"]
] call FHQ_TT_addBriefing;