Jump to content
Sign in to follow this  
Drumheller

Can I assign objective completion to triggers?

Recommended Posts

I'm very new to modding. I want to make it so that when my trigger(all opfor on the airfield are gone) is complete, the 1st objective in my mission completes. Is there a way to do this via the trigger? And if so, how?

Share this post


Link to post
Share on other sites

You can use the setTaskState command to manually set the taks state. To use this you can put this into your triggers onAct box:

TASKNAME setTaksState "SUCCEEDED";

When you do this there will not be a visual update on your task, to do this you could either set your trigger to also hint that tasks have been updated like this:

hint "Tasks have been updated!";

or use the more advanced taskHint command. To use taskHint you use the following syntax:

taskHint [hintText, [red, green, blue, alpha], iconName]

For example (from wiki):

taskhint ["Task failed!\nBad job!", [1, 0, 0, 1], "taskFailed"]

This will create a box in the upper middle of your screen with the text 'Task Faliled! Bad job!' in red writing in full transparency, the "\n" means go to a new line.

For anything else I thik the wiki would be more useful.

Share this post


Link to post
Share on other sites

Cool thanks. I already have a hint for when the task is completed. How do I seperate the hint and the settaskstate command? Just with the semicolon and a space?

Share this post


Link to post
Share on other sites

So this is what I have and for some reason it's not working. The hint will pop up properly but the objective in my map menu will not update:

hint "Airfield clear. You are authorized to move to Kemenyy."; Overwatch setTaskState "SUCCEEDED";

My objective name is Overwatch and the Marker is named Overwatch but it won't check off the box no matter what I do that the task is complete.

This is my briefing.sqf:

//These are the tasks

tskObj2=player createSimpleTask ["Assault"];

tskObj2 setSimpleTaskDescription ["Once the airfield is secured, move north to <marker name=assault'>assault</marker> Kamenyy. You can link up with the airfield assault team(not recommended as they usually take a while to regroup and head out), try to move quick and join the gun truck team, or move out on your own. Use discretion and fight smart.","Attack and Clear Kamenyy","Clear Kamenyy];

tskobj2 setSimpleTaskDestination (getMarkerPos "assault");

tskObj1=player createSimpleTask ["Overwatch"];

tskObj1 setSimpleTaskDescription ["Make your way to hill 63 south of Utes Airfield. Find a good position to <marker name=overwatch'>overwatch</marker> for the assault team. Make sure to approach the hill from the south/southeast to avoid detection.","Set up an overwatch position","Get to and set up an overwatch];

tskobj1 setSimpleTaskDestination (getMarkerPos "overwatch");

//These are for the Notes in the briefing screen.

player createDiaryRecord["Diary", ["Command and Signal", "Your mission is to assist the assault on Utes Island. Marines have secured the town of Strelka and we are now moving to take the rest of the island to prepare for a full scale invasion of Chernarus. We have built up hasty defenses in Strelka in case of counterattack, but our plan is to bring the fight to them with overwhelming force before they can do so.

According to the locals in Strelka, the aircraft on the airfield are all bingo on fuel due to no resupply from the mainland, so they will not be a threat."]];

player createDiaryRecord["Diary", ["Service Support", "You are the support for this mission."]];

player createDiaryRecord["Diary", ["Execution", "You will move to Hill 63 from the south/southeast and set up an overwatch position above the airfield. You will only have around one to two minutes to identify targets before the assault team begins its assault on the airfield. Once the shooting starts, be sure to take out enemy snipers and vehicle gunners first. Once the airfield is secured, you will move north either by yourself or with the assault team to attack and secure Kamenyy. Gun trucks from the FOB are being prepared and will join in the attack once you begin heading north. Once Kamenyy is secured and all enemy presence from both the town and airfield are eliminated have the assault team leader call HQ to report mission success."]];

player createDiaryRecord["Diary", ["XXX"]];

Edited by MacScottie

Share this post


Link to post
Share on other sites

Reference the task by the variable (tskObj1) for the task "Overwatch"

So to set the task complete use:

tskObj1 setTaskState "SUCCEEDED"

Share this post


Link to post
Share on other sites

Make a trigger zone and set to

activation: opfor

not present

in the on act;

"1" objstatus "DONE"; obj1 = true

when there are no opfor left in the tirgger, you will get a msg saying objective complete.

Also if you click effects in the trigger options you can add text when the trigger is activated

e.g "objective complete, all enemies are eliminated"

hope this helps

Share this post


Link to post
Share on other sites
Make a trigger zone and set to

activation: opfor

not present

in the on act;

"1" objstatus "DONE"; obj1 = true

when there are no opfor left in the tirgger, you will get a msg saying objective complete.

Also if you click effects in the trigger options you can add text when the trigger is activated

e.g "objective complete, all enemies are eliminated"

hope this helps

If you have 2 objectives to complete, would it simply be:

"2" objstatus "DONE"; obj2 = true

and the triggers would be named?

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
Sign in to follow this  

×