Jump to content
_qor

How to set a task as "succeeded"

Recommended Posts

I know there are some description out there, but they are kind of puzzling me...

So I have got a briefing.sqf with:

task1 = player createSimpleTask ["Turnout"];

task1 setSimpleTaskDescription ["Turnout the intruders of Feruz Abad. Proceed to their base north of town. A mob of warriors is waiting for you to get orders.", "Turnout", "Turnout"];

task1 setSimpleTaskDestination markerpos "enemy";

task1 setTaskState "Created";

player setCurrentTask task1;

In the editor, there is a trigger which becomes activated if all BLUFOR units are dead or fleeing.

But which lines do I have to add to the trigger's condition if I want to see the task "succeeded"?

I guess there are simple lines but I found it hard to filter those from the informations in the net.

I tried with tskTurnout setTaskState "Succeeded";

in the OnAct box. But it doesnt work. There is a "biepbiep" but the task is still unchecked.

Edited by _qoR

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Should be

setTaskState "SUCCEEDED";

example

For a mission I built I used a marker on the map, and an area trigger, so when the area was cleared this is what I had in a trigger:

hint "You have cleared the area and taken back the town."; "town" setMarkerColor "colorGreen"; tskarea1 setTaskState "SUCCEEDED";m1obj=true;publicvariable "m1obj"

the marker by the town would turn green, and under map, under tasks the task would be green indicating you completed the task.

But which lines do I have to add to the trigger's condition if I want to see the task "succeeded"?

put your codes in the on actline, and then under condition put this

another way I use is the use of an !alive command placed in the condition spot of the trigger, for example:

enemy officer I have to kill, is named OF

OF is the name given to the officer.

condition

!Alive OF

trigger

name field of the trigger

obj2

m2 is an area marker that surrounds the objective area

in the on act field of the trigger

hint "The Enemy officer has been eliminated!."; deleteMarker "OF"; tskarea2 setTaskState "SUCCEEDED";m2obj=true;publicvariable "m2obj"

in the briefing:

tskarea2 = player createSimpleTask["Kill the officer."];
tskarea2 setSimpleTaskDescription["!Locate the enemy officer and eliminate him <marker name='m2'>here</marker>.", "Kill the officer.", "Kill the officer."];
tskarea2 setSimpleTaskDestination (getMarkerPos "m2");

Best way to learn is to look at other people's missions and see how they did it, even if you dont totally understand it, you can always just copy n paste.

that make sense?

Edited by Gnter Severloh

Share this post


Link to post
Share on other sites

ah I found my mistake.

You just have to put the name of the task designated in the briefing (which is "task1", in my case - not "Turnout") in front of "setTaskState".

I thought there is "tsk..." as a prefix. So finally I put this in my OnAct box of the trigger:

task1 setTaskState "succeeded"

Share this post


Link to post
Share on other sites

Correct, there you go, now you got it, great job!

I thought the word turnout wasn't being properly used, I felt reveal would be more appropriate in terms of how you are using it.

But glad you got it figured out, theres more to tasks then meets the eye, theres many ways to do it, so Im still learning myself. :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×