# Is this the most efficient way? (Task Triggers Optimization)

## Recommended Posts

Long story short i just wanted to make basic move objectives for the players to follow in the game. This is what i came up with after about 5 hours of trial and error,.... and hair pulling. >.>

It works, But i'm wondering if I've over complicated things a bit. All of the info i have i either had to cobble together from guides doing something similar to what i want but not exact, and some intuition.

Below will be a flow chart picture of sorts and a simple step guide showing how i made chain-objectives. If anyone sees anything that can be simplified let me know.

First off, im using Eden Enhanced, FREAKIN' LOVE IT! So some steps may be simplified due to that tool i'm not sure.

Steps:

Spoiler
1. Placed VR Soldier: Named "Player_1" | Playable & Player | BLUEFOR | Squad Leader
2. Placed "Create Task": Set ID"OBJ_1" | Name "Move" | State=Assigned | Syncd to "Player_1"
3. Placed "Trigger_1": Sized 2x2x-1 | Type None  | Activation BLUEFOR = Present | Condition = this
4. Placed "Set_Task_State_1": Set State = Succeeded | Synced to Trigger_1 | Synced to "OBJ_1"
5. Placed "Create Task": Set ID"OBJ_2" | Name "Move again" | State=Unassigned | Syncd to "Player_1"
6. Placed "Set_Task_State_2": Set State = Assigned | Synced to Trigger_1 | Synced to "OBJ_2"
7. Placed "Trigger_2": Sized 2x2x-1 | Type None  | Activation BLUEFOR = Present | Condition = this
8. Placed "Set_Task_State_3": Set State = Succeeded | Synced to Trigger_2 | Synced to "OBJ_2"
9. Placed "Create Task": Set ID"OBJ_3" | Name "Win" | State=Unassigned | Syncd to "Player_1" | Set Trigger Owner: "Player_1"
10. Placed "Set_Task_State_4": Set State = Assigned | Synced to Trigger_2 | Synced to "OBJ_3"
11. Placed "Trigger_3": Sized 2x2x-1 | Type: End#1  | Activation BLUEFOR = Present | Condition = this
12. Placed "Set_Task_State_5": Set State = Succeeded | Synced to Trigger_3 | Synced to "OBJ_3"

Flow Chart / Picture:

##### Share on other sites

yeh been doin it pretty much thisway too would be interested if any1 did have a simpler way

##### Share on other sites

I have an objective completed script template that I use which makes things quite easy. I just save something like

```["TaskSucceeded",["","Move 1"]] call BIS_fnc_showNotification;

// Optional, if task not already defined in the briefing
// obj2 = player createSimpleTask ["Move 2"];
// obj2 setSimpleTaskDescription ["Description.", "Move 2", ""];

sleep 3;

as obj1.sqf and call it from a trigger. The more complicated missions I do, the less WYSIWYG I prefer.

##### Share on other sites
13 minutes ago, theend3r said:
Spoiler

I have an objective completed script template that I use which makes things quite easy. I just save something like

```

// Optional, if task not already defined in the briefing
// obj2 = player createSimpleTask ["Move 2"];
// obj2 setSimpleTaskDescription ["Description.", "Move 2", ""];

sleep 3;

as obj1.sqf and call it from a trigger. The more complicated missions I do, the less WYSIWYG I prefer.

Yea I can see how having it handled in an exterior script could be very useful. Keep a pile of templates handy for variable task types. Not exactly what i was looking for but definitely worth considering!

##### Share on other sites
Just now, Jes McDevlin said:

Yea I can see how having it handled in an exterior script could be very useful. Keep a pile of templates handy for variable task types. Not exactly what i was looking for but definitely worth considering!

Well, the advantage is that you can add timed radio messages, conditions, save the game a few seconds after the task is complete (in SP), branching scenarios...etc. which would be a nightmare to do in Eden.

##### Share on other sites
6 minutes ago, theend3r said:
Spoiler

Well, the advantage is that you can add timed radio messages, conditions, save the game a few seconds after the task is complete (in SP), branching scenarios...etc. which would be a nightmare to do in Eden.

Yea; I can totally see how it would indeed be a nightmare... Already gone through it a bit in fact. I am simi-new to scripting, i know most basic syntax but not the functions and vocabulary for ARMA3. Im not entirely sure what all of your script dose exactly. The middle bit with "//" Seems to be referencing/calling functions or something where as i'm use to "//" being "ignored" in code lines. That parts the one stumping me mostly. The rest is straight forward.

##### Share on other sites
8 minutes ago, theend3r said:
Spoiler

Well, the advantage is that you can add timed radio messages, conditions, save the game a few seconds after the task is complete (in SP), branching scenarios...etc. which would be a nightmare to do in Eden.

Actually, i think i am understanding the functions now for the // bit. Call me a derp, but it is 5AM. lol

##### Share on other sites
3 minutes ago, Jes McDevlin said:

Actually, i think i am understanding the functions now for the // bit. Call me a derp, but it is 5AM. lol

That's just a comment, i.e. the compiler ignores that part, unless you delete the "//". I put it there for you since it seemed you wanted to create tasks on the fly. I usually define them in the briefing at the start of the mission so there is no need to create new ones.

##### Share on other sites
2 minutes ago, theend3r said:
Spoiler

That's just a comment, i.e. the compiler ignores that part, unless you delete the "//". I put it there for you since it seemed you wanted to create tasks on the fly. I usually define them in the briefing at the start of the mission so there is no need to create new ones.

Feeling so lost lol. I didn't even know you could make objectives in the briefing. Honestly not sure how to even edit the briefing. Sorry if i'm just wasting your time.

But from what your saying is you can make predefined objectives in the briefing and call them in triggers and such?

##### Share on other sites
20 minutes ago, Jes McDevlin said:

Feeling so lost lol. I didn't even know you could make objectives in the briefing. Honestly not sure how to even edit the briefing. Sorry if i'm just wasting your time.

But from what your saying is you can make predefined objectives in the briefing and call them in triggers and such?

Yes, make a file named briefing.sqf in your mission folder and save it wih something like this example:

```diaryExtraction = player createDiaryRecord ["Diary", ["Extraction", "
After you eliminate your target, find an open space and call for extraction using your radio (0-0-1).<br/><br/>If the helicopter gets shot down, we are capable of providing you with one more. If you fail to extract the second time, we will cancel the mission.
"]];

player createDiaryRecord ["Diary", ["Overview", "
Your target is <marker name='target_marker'>here</marker>.
"]];

obj1 = player createSimpleTask ["Move"];
obj1 setSimpleTaskDescription ["Description 1", "Move", ""];

obj2 = player createSimpleTask ["Elimninate"];
obj2 setSimpleTaskDescription ["Description 2", "Elimninate", ""];

obj3 = player createSimpleTask ["Extract"];
obj3 setSimpleTaskDescription ["Description 3", "Extract", ""];

The game will autamatically exec it at the start of the mission and show you the briefing.

##### Share on other sites
2 minutes ago, theend3r said:
Spoiler

Yes, make a file named briefing.sqf in your mission folder and save it wih something like this example:

```

diaryExtraction = player createDiaryRecord ["Diary", ["Extraction", "
After you eliminate your target, find an open space and call for extraction using your radio (0-0-1).<br/><br/>If the helicopter gets shot down, we are capable of providing you with one more. If you fail to extract the second time, we will cancel the mission.
"]];

player createDiaryRecord ["Diary", ["Overview", "
Your target is <marker name='target_marker'>here</marker>.
"]];

obj1 = player createSimpleTask ["Move"];
obj1 setSimpleTaskDescription ["Description 1", "Move", ""];

obj2 = player createSimpleTask ["Elimninate"];
obj2 setSimpleTaskDescription ["Description 2", "Elimninate", ""];

obj3 = player createSimpleTask ["Extract"];
obj3 setSimpleTaskDescription ["Description 3", "Extract", ""];

The game will automatically exec it at the start of the mission and show you the briefing.

Oh wow looking at it that would make life a lot better;  One last bit of noobishness; to get these to display in game i'd simply place the "set Task" markers and name them in accordance with said briefing script correct?

Then the Triggers would call up the other end of the system the "OBJ1.SQF" yea? You'd just put that in the trigger's condition list?

Thanks a ton btw!

##### Share on other sites
24 minutes ago, Jes McDevlin said:

Oh wow looking at it that would make life a lot better;  One last bit of noobishness; to get these to display in game i'd simply place the "set Task" markers and name them in accordance with said briefing script correct?

I don't quite understand what you mean with this. You don't need to do anything else that what I said. (Although, like the commands imply, this is a simple task framework and there are other, nicer looking solutions, afaik.)

24 minutes ago, Jes McDevlin said:

Then the Triggers would call up the other end of the system the "OBJ1.SQF" yea? You'd just put that in the trigger's condition list?

Just using obj1 settaskstate "succeeded"; player setCurrentTask obj2; in the onAct window of a trigger would work but calling something like what I posted before with _nul = [] execVM "obj1.sqf" could provide nicer results.

I'm sure you can figure out the rest yourself.

##### Share on other sites
1 minute ago, theend3r said:
Spoiler

I don't quite understand what you mean with this. You don't need to do anything else that what I said. (Although, like the commands imply, this is a simple task framework and there are other, nicer looking solutions, afaik.)

Just using obj1 settaskstate "succeeded"; player setCurrentTask obj2; in the onAct window of a trigger would work but calling something like what I posted before with _nul = [] execVM "obj1.sqf" could provide nicer results.

I'm sure you can figure the rest yourself.

Thanks a ton for the insight man! :)