Jump to content

Recommended Posts

if (["task1"] call FHQ_TT_isTaskCompleted) then {[PlayerGroup, ["task2", "Destroy the three communication towers at grid <marker name = obj2>052050</marker> using explosives.", "Destroy the Communication Towers", "", ""]] call FHQ_TT_addTasks;};

Same problem, the last pair of empty quotes (being a string) is the initial task, and that is empty in your case. You need to either make it "created", or "assigned":

if (["task1"] call FHQ_TT_isTaskCompleted) then {[PlayerGroup, ["task2", "Destroy the three communication towers at grid <marker name = obj2>052050</marker> using explosives.", "Destroy the Communication Towers", "", "assigned"]] call FHQ_TT_addTasks;};

Share this post


Link to post
Share on other sites
Alright. I have simplified it for the sake of help. Neither the Briefing, nor the Tasks, are showing up when I preview the mission. Any help would be appreciated. Thanks

call compile preProcessFileLineNumbers "fhqtt.sqf";


[
/* These entries are only visible for the units in PlayerGroup */
West,
	["Situation",
		"Enemy <br/>The island of Utes is controlled by the local guerrilla group called "Utes Guerrilla Resistance" (UGR). Reporting indicates UGR conducts surveillance operations on BLUFOR training in the area. Reporting also states UGR patrol villages providing law and order to citizens who assist their cause and terrorize those who oppose it. Reporting indicates the UGR has the ability to plan and conduct IED attacks, utilizing PPIEDs and RCIEDs, on BLUFOR. Citizens who strike these IEDs are compensated for their damages in exchange for their silence and cooperation. Reports indicate UGR stores weapons crates in populated areas for use if BLUFOR are encountered in the villages. According to recent reporting, UGR has conducted raids on lightly guarded joint BLUFOR outposts and seized armored & light vehicles, and IDF support and are trained in their use, as well as in tactics. UGR is capable of conducting ambushes on BLUFOR from received contact reports via spotters and patrols."
		+ "Most Probable Course of Action (MPCOA) - If attacked, is to Reinforce. UGR's strength lies in their ability to mobilize reinforcements within five (5) minutes of reported contact."
		+ "Critical Vulnerability (CV) - UGR has no aerial support. Reinforcements must travel by road to reach the engagement area and are susceptible to interdiction and delay or destruction by BLUFOR assets."
		+ "Friendly"
		+ "Higher - Alpha Company is has completed CAX and are making preparations to execute the CAXFX."
		+ "Adjacent - 2nd Sqd & Wpns are acting as QRF aboard Camp Warfighter."
		+ "Support - 1st SRIG, callsign "Oracle," conducting R&S operations to locate UGR patrol bases, areas of influence and firm bases."],			
	["Mission",
		"On 27Apr20131900GMT, 1st Plt 1st Sqd will conduct a clearing operation of the island of Utes IOT seize control from the UGR, by locating and eliminating it's leadership, and assist in the re-establishment of the Utes government which will end the CAXFX."]

] call FHQ_TT_addBriefing;

[
West,
  		["taskC11Obj1", "Chaos 1-1 is to clear the village of Strelka of all enemy combatants.  Be advised that intelligence reporting indicates UGR will reinforce its combatants if requested.  Locate and destroy any weapon caches in the village.  If any information of potential intelligence value is discovered, collect it for analysis and processing.  Locate any patrol bases IVO the village from which UGR operations may be planned.","Clear Strelka Village","", getmarkerpos "c11obj1","assigned"],
           ["taskC11Obj2", "Chaos 1-1 is to clear the village of Kamenyy of all enemy combatants.  Locate and destroy any weapon caches in the village.  If any information of potential intelligence value is discovered, collect it for analysis and processing.  Locate any patrol bases IVO the village from which UGR operations may be planned.","Clear Kamenyy Village","", getMarkerPos "c11obj2"],
           ["taskRTB", "Chaos1_1 is to RTB for resupply after objectives 1&2 are completed and standby for follow-on tasking." ,"RTB", "", getmarkerpos "c11obj3"]
] call FHQ_TT_addTasks;

Alright. After tinkering around with it, I noticed it had to do with the naming of the group. I used playergroup on the default example given and it appeared.

[
/* These entries are only visible for the units in PlayerGroup */
Playergroup, 
	["Situation",
		"Enemy"
	+ "The island of Utes is controlled by the local guerrilla group called "Utes Guerrilla Resistance" (UGR). Reporting indicates UGR conducts surveillance operations on BLUFOR training in the area. Reporting also states UGR patrol villages providing law and order to citizens who assist their cause and terrorize those who oppose it. Reporting indicates the UGR has the ability to plan and conduct IED attacks, utilizing PPIEDs and RCIEDs, on BLUFOR. Citizens who strike these IEDs are compensated for their damages in exchange for their silence and cooperation. Reports indicate UGR stores weapons crates in populated areas for use if BLUFOR are encountered in the villages. According to recent reporting, UGR has conducted raids on lightly guarded joint BLUFOR outposts and seized armored & light vehicles, and IDF support and are trained in their use, as well as in tactics. UGR is capable of conducting ambushes on BLUFOR from received contact reports via spotters and patrols."],			
	["Situation",
		"After you've completed your training, the CO wants to see how you perform with heavy weaponry."],
	["Execution",
		"Using the Next-Generation Light Anti-tank Weapon (NLAW), destroy the two captured Ifrits "
         + "<marker name='markTarget1'>here</marker> and <marker name='markTarget2'>here</marker>."
         + "The observer will validate your performance. Return to <marker name='markExfil'>the firing range building</marker> "
         + "afterwards for validation and debriefing."],

/* These entries are visible to all west players in the mission that are NOT part of PlayerGroup */
west,
   	["Assignment", 
       	"Observe the soldier and ascertain his ability to handle the anti tank weapon."],         
       ["Situation", 
       	"Since the provisional government is bascially putting the whole island in the hands of the NATO troops, "
         + "they are demanding that the soldiers show that they can handle their weapons effectively and without any incident. "
         + "After the live fire exercise, return to the <marker name='markExfil'>office</marker> "
         + "to discuss the results"]         
] call FHQ_TT_addBriefing;

[
PlayerGroup,
  		["taskDestroy", "Destroy the two Ifrits", "Destroy Ifrits", ""],
       [["taskTarget1", "taskDestroy"], "Destroy the <marker name='markTarget1'>first Ifrit</marker>", "Destroy target #1", "", getMarkerPos "markTarget1", "assigned"],
       [["taskTarget2", "taskDestroy"], "Destroy the <marker name='markTarget2'>second Ifrit</marker>", "Destroy target #2", "", getMarkerPos "markTarget2"],
       ["taskExfil", "Get back into the building", "Get out", "", getMarkerPos "markExfil"],
   west,
   	["taskObserve", "Make sure the soldier knows how to handle an NLAW", "Observe", "", "assigned"],
       ["taskExfilInst", "Get back into the office", "Get out", "", getMarkerPos "markExfil"]
] call FHQ_TT_addTasks;

When I changed "PlayerGroup" to "West," nothing appeared. Any ideas? Also, I thought I named my groups correctly using the [groupname = group this] command in the init file of every member of each group, however, it proved to be wrong. Any help would be appreciated.

Try west instead of West, it might be case sensitive.

---------- Post added at 11:42 PM ---------- Previous post was at 11:41 PM ----------

Same problem, the last pair of empty quotes (being a string) is the initial task, and that is empty in your case. You need to either make it "created", or "assigned":

if (["task1"] call FHQ_TT_isTaskCompleted) then {[PlayerGroup, ["task2", "Destroy the three communication towers at grid <marker name = obj2>052050</marker> using explosives.", "Destroy the Communication Towers", "", "assigned"]] call FHQ_TT_addTasks;};

Thanks mate. Really great script by the way! Not sure why you're getting so much flame about the JIP/Respawn stuff. Proper players dont play with respawn anyways ;)

Need help setting up this trigger. Now I want this trigger to go off when 3 other triggers have activated. The trigger is to create a new task and the 3 others are to go off when the 3 buildings are destroyed.

I've named the 3 tower triggers but I cannot figure out what to put in the cond box to check if they've activated. So far I've got triggerActivated but not sure how to list them so it checks all three.

Edited by azz_er

Share this post


Link to post
Share on other sites
Try west instead of West, it might be case sensitive.

---------- Post added at 11:42 PM ---------- Previous post was at 11:41 PM ----------

Thanks mate. Really great script by the way! Not sure why you're getting so much flame about the JIP/Respawn stuff. Proper players dont play with respawn anyways ;)

Need help setting up this trigger. Now I want this trigger to go off when 3 other triggers have activated. The trigger is to create a new task and the 3 others are to go off when the 3 buildings are destroyed.

I've named the 3 tower triggers but I cannot figure out what to put in the cond box to check if they've activated. So far I've got triggerActivated but not sure how to list them so it checks all three.

Alright. After some serious testing, I have finally fixed it. I had some extra quotation marks that threw it all off. Thanks for the help to all.

I have one more problem. I have tried naming groups via [Groupname = Group this;] in the init line of each member of the groups, however, when I attempt to put the group name in the filter, nothing shows up. Any help would be nice.

Share this post


Link to post
Share on other sites
Alright. After some serious testing, I have finally fixed it. I had some extra quotation marks that threw it all off. Thanks for the help to all.

I have one more problem. I have tried naming groups via [Groupname = Group this;] in the init line of each member of the groups, however, when I attempt to put the group name in the filter, nothing shows up. Any help would be nice.

I have everything working now. Thanks.

Share this post


Link to post
Share on other sites

Sorry for posting all the time haha. I decided to scrap the 3 triggers and use the parent/child task system. For some reason my trigger won't accept this in its cond line (Gives a blank error)

if (["task1"] call FHQ_TT_isTaskCompleted) then {[PlayerGroup, ["task2", "Destroy the three communication towers at grid <marker name = obj2>052050</marker> using explosives.", "Destroy the Communication Towers", "", ""],
["tower1", "task2"], "Destroy the <marker name = tower1>first comm tower</marker>.", "Destroy Tower One", "", "assigned"],
["tower2", "task2"], "Destroy the <marker name = tower2>second comm tower.</marker>", "Destroy Tower Two", "", ""], 
["tower3", "task2"], "Destroy the <marker name = tower3>third comm tower</marker>.", Destroy Tower Three", "", ""]] 

call FHQ_TT_addTasks;};

any ideas?

Share this post


Link to post
Share on other sites

if (["task1"] call FHQ_TT_isTaskCompleted) then {[PlayerGroup, ["task2", "Destroy the three communication towers at grid <marker name = obj2>052050</marker> using explosives.", "Destroy the Communication Towers", "", ""],
["tower1", "task2"], "Destroy the <marker name = tower1>first comm tower</marker>.", "Destroy Tower One", "", "assigned"],
["tower2", "task2"], "Destroy the <marker name = tower2>second comm tower.</marker>", "Destroy Tower Two", "", ""], 
["tower3", "task2"], "Destroy the <marker name = tower3>third comm tower</marker>.", Destroy Tower Three", "", ""]] 

call FHQ_TT_addTasks;};

any ideas?

You are missing opening brackets on each of the lines with subtasks, i.e.

if (["task1"] call FHQ_TT_isTaskCompleted) then {[PlayerGroup, ["task2", "Destroy the three communication towers at grid <marker name = obj2>052050</marker> using explosives.", "Destroy the Communication Towers", "", ""],
[["tower1", "task2"], "Destroy the <marker name = tower1>first comm tower</marker>.", "Destroy Tower One", "", "assigned"],
[["tower2", "task2"], "Destroy the <marker name = tower2>second comm tower.</marker>", "Destroy Tower Two", "", ""], 
[["tower3", "task2"], "Destroy the <marker name = tower3>third comm tower</marker>.", Destroy Tower Three", "", ""]] 

call FHQ_TT_addTasks;};

Share this post


Link to post
Share on other sites

Thank you mate and once again, really great script. Appreciate the work :)

Edit: Nope still won't accept it in the trigger. Weird.. :S

Its strange because it will accept this:

 if (["task1"] call FHQ_TT_isTaskCompleted) then {[PlayerGroup, ["task2", "Destroy the three communication towers at grid <marker name = obj2>052050</marker> using explosives.", "Destroy the Communication Towers", "", "assigned"]] call FHQ_TT_addTasks;}; 

But wont accept the code you wrote above for the parent/child tasks? Really strange.

Edited by azz_er

Share this post


Link to post
Share on other sites

Is this Arma 2 or Arma 3 (Arma 2, if I remember correctly) ? Due to the way tasks are added in Amra 2 (reversed, to get them in the correct order) the code should work in Arma 3, but in Arma 2, it would have to look like this:

if (["task1"] call FHQ_TT_isTaskCompleted) then {[PlayerGroup, 
[["tower1", "task2"], "Destroy the <marker name = tower1>first comm tower</marker>.", "Destroy Tower One", "", "assigned"],
[["tower2", "task2"], "Destroy the <marker name = tower2>second comm tower.</marker>", "Destroy Tower Two", "", ""], 
[["tower3", "task2"], "Destroy the <marker name = tower3>third comm tower</marker>.", Destroy Tower Three", "", ""]
       ["task2", "Destroy the three communication towers at grid <marker name = obj2>052050</marker> using explosives.", "Destroy the Communication Towers", "", ""]
  ] call FHQ_TT_addTasks;
};

The task tracker automatically reverts the tasks in Arma2 to have them appear in the correct order, which means the parent task must be defined last. Since parented tasks are always put below their parent, it will show them in the correct order.

Share this post


Link to post
Share on other sites

Ok, this should work then:

if (["task1"] call FHQ_TT_isTaskCompleted) then {
  [PlayerGroup, 
       ["task2", "Destroy the three communication towers at grid <marker name = obj2>052050</marker> using explosives.", "Destroy the Communication Towers", ""]
[["tower1", "task2"], "Destroy the <marker name = tower1>first comm tower</marker>.", "Destroy Tower One", "", "assigned"],
[["tower2", "task2"], "Destroy the <marker name = tower2>second comm tower.</marker>", "Destroy Tower Two", ""], 
[["tower3", "task2"], "Destroy the <marker name = tower3>third comm tower</marker>.", Destroy Tower Three", "",]
  ] call FHQ_TT_addTasks;
};

Note, you've added "" as the task state, this should either be a valid state, or the parameter omitted. Next version will treat "" as "created", I guess.

Apart from this it should really work. Do you get any errors, script errors, anything in the .rpt file ?

Share this post


Link to post
Share on other sites

Nope still doesn't work so Im stumped...

I dont get any other errors however when I try to add it to the trigger and the error shows, the cursor always puts it back at the { before PlayerGroup so maybe its something to do with that? I dont know. :S

Share this post


Link to post
Share on other sites
Nope still doesn't work so Im stumped...

I dont get any other errors however when I try to add it to the trigger and the error shows, the cursor always puts it back at the { before PlayerGroup so maybe its something to do with that? I dont know. :S

Ah, right, there's a comma missing after the ["task2"... line:

if (["task1"] call FHQ_TT_isTaskCompleted) then {
  [PlayerGroup, 
       ["task2", "Destroy the three communication towers at grid <marker name = obj2>052050</marker> using explosives.", "Destroy the Communication Towers", ""],
[["tower1", "task2"], "Destroy the <marker name = tower1>first comm tower</marker>.", "Destroy Tower One", "", "assigned"],
[["tower2", "task2"], "Destroy the <marker name = tower2>second comm tower.</marker>", "Destroy Tower Two", ""], 
[["tower3", "task2"], "Destroy the <marker name = tower3>third comm tower</marker>.", "Destroy Tower Three", ""], // <-- here
  ] call FHQ_TT_addTasks;                                                                                           // ^Quote was missing, too 
};

Edited by Varanon
Edit: Found another wring comma

Share this post


Link to post
Share on other sites

Nope :( This is getting really frustrating...

Share this post


Link to post
Share on other sites

Check the last post again, I ust edited it, found another misplaced comma in the last line.

Plus, there's a quote missing in front of "Destroy Tower Three"

Share this post


Link to post
Share on other sites

Fixed it.

This is what worked!

if (["task1"] call FHQ_TT_isTaskCompleted) then {
  [PlayerGroup, 
       ["task2", "Destroy the three communication towers at grid <marker name = obj2>052050</marker> using explosives.", "Destroy the Communication Towers", ""],
[["tower1", "task2"], "Destroy the <marker name = tower1>first comm tower</marker>.", "Destroy Tower One", "", "assigned"],
[["tower2", "task2"], "Destroy the <marker name = tower2>second comm tower.</marker>", "Destroy Tower Two", ""], 
[["tower3", "task2"], "Destroy the <marker name = tower3>third comm tower</marker>.", "Destroy Tower Three", ""] 
  ] call FHQ_TT_addTasks;}; 

It didn't need the comma after the tower three task, not sure what else was changed but its happily in the trigger now haha! Thanks mate, really appreciate it.

Edit: After all that, I can't use it anyway because when the trigger fires and the script runs it drops the FPS down to about 5 and doesn't recover... *sigh*

Edited by azz_er

Share this post


Link to post
Share on other sites
It didn't need the comma after the tower three task, not sure what else was changed but its happily in the trigger now haha! Thanks mate, really appreciate it.

Argh, of course, the comma is not only not necessary, it's wrong if it's the last element... but the quote was definitely wrong.

Glad it works now. Looking forward to the result

Share this post


Link to post
Share on other sites

Check my last post haha :(

I might just have to create all the tasks in the briefing and then just assign them as the player progresses instead of creating them on the fly cause creating 4 at once causes my PC to stutter like crazy.

Edited by azz_er

Share this post


Link to post
Share on other sites

I have got my tasking to work and I have used the trigger command to set a trigger state when unit x is killed. Once I kill unit x, I do not receive a hint saying the task was succeeded. How can I make that happen?

Edited by _Ronin_
Adding more information

Share this post


Link to post
Share on other sites
I have got my tasking to work and I have used the trigger command to set a trigger state when unit x is killed. Once I kill unit x, I do not receive a hint saying the task was succeeded. How can I make that happen?

In the trigger's activation, use

["taskName", "succeeded"] call FHQ_TT_setTaskState;

A better option is of course to use markTaskAndNext. Assuming you have task1, task2, and task3, and you finish task1 and want to select task2 or, if task2 is already finished, task3, you'd use

["task1", succeeded", "task2", "task3"] call FHQ_TT_markTaskAndNext;

This will mark task1 as succeeded, and select task2 or task3 depending on whether task2 is already completed or not.

Share this post


Link to post
Share on other sites
In the trigger's activation, use

["taskName", "succeeded"] call FHQ_TT_setTaskState;

A better option is of course to use markTaskAndNext. Assuming you have task1, task2, and task3, and you finish task1 and want to select task2 or, if task2 is already finished, task3, you'd use

["task1", succeeded", "task2", "task3"] call FHQ_TT_markTaskAndNext;

This will mark task1 as succeeded, and select task2 or task3 depending on whether task2 is already completed or not.

Thanks....Everything is working like it should. I am having a problem with it checking if taskx & tasky is complete in order to fire taskz. Could you help me out with that? My other, and hopefully final, question is how can I make tasks stay hidden until taskx is completed? I intend to have a couple of tasks to only appear if item x is found. Can you help me with this?

Edited by _Ronin_

Share this post


Link to post
Share on other sites
Thanks....Everything is working like it should. I am having a problem with it checking if taskx & tasky is complete in order to fire taskz. Could you help me out with that? My other, and hopefully final, question is how can I make tasks stay hidden until taskx is completed? I intend to have a couple of tasks to only appear if item x is found. Can you help me with this?

To check whether a task is completed, use FHQ_TT_isTaskCompleted, or FHQ_TT_areTasksCompleted to check more than one...

So, to see if taskx and tasky are completed, use

if (["taskx", "tasky"] call FHQ_TT_areTasksCompleted) then {
   ["taskz", "assigned] call FHQ_TT_setTaskState;
};

Tasks can not be made inivisble, but you can add tasks later by simply calling FHQ_TT_addTasks again.

Share this post


Link to post
Share on other sites

I don't know if you remember me asking Varanon, but would it be possible to have a hasState type function where you can check for any kind of state of a task? I know you can check tasks to see if they are completed but not if they are for example assigned as far as I can see.

Share this post


Link to post
Share on other sites
To check whether a task is completed, use FHQ_TT_isTaskCompleted, or FHQ_TT_areTasksCompleted to check more than one...

So, to see if taskx and tasky are completed, use

if (["taskx", "tasky"] call FHQ_TT_areTasksCompleted) then {
   ["taskz", "assigned] call FHQ_TT_setTaskState;
};

Tasks can not be made inivisble, but you can add tasks later by simply calling FHQ_TT_addTasks again.

I tried the code with no love. Below is the detailed code I put in.

if (["task1c"] call FHQ_TT_isTaskCompleted) then {
  	[Chaos1a, 
     	["task1d", "Three weeks ago, UGR launched an offensive on a lightly guarded joint base and seized stored weapons and supplies.  They have occuppied the base and conduct security patrols as a show of force.  Raid the base IOT eliminate the leadership within and destroy all stored supplies.", "Raid Supply Depot", "", getmarkerpos "Spawnpoint3", "assigned"]
  ] call FHQ_TT_addTasks;
};

Once I complete the task, thing happens. I have to task assigned to a radio trigger.

Share this post


Link to post
Share on other sites

Where did you actually put the code ?

One thing I notice that a lot of people have misconceptions about is when and how code is run. For example, if you simply put this code you mentioned into your init.sqf, it will only be checked once while init.sqf is running. it will never be run again.

If you want code to be run "as soon as something happens", it has to be in a trigger or a spawned script that sits in the background, waiting.

For example, this code:

if (["task1c"] call FHQ_TT_isTaskCompleted) then {
  	[Chaos1a, 
     	["task1d", "Three weeks ago, UGR launched an offensive on a lightly guarded joint base and seized stored weapons and supplies.  They have occuppied the base and conduct security patrols as a show of force.  Raid the base IOT eliminate the leadership within and destroy all stored supplies.", "Raid Supply Depot", "", getmarkerpos "Spawnpoint3", "assigned"]
  ] call FHQ_TT_addTasks;
};

will only be checked once when the script it's in executes. If you wanted to "watch" the task and create a new one once the task is finished, you'd need a trigger:

Place a trigger on the map, and put this in it's condition field:

["task1c"] call FHQ_TT_isTaskCompleted

Then, in the OnActivated field, put this

[Chaos1a, 
     	["task1d", "Three weeks ago, UGR launched an offensive on a lightly guarded joint base and seized stored weapons and supplies.  They have occuppied the base and conduct security patrols as a show of force.  Raid the base IOT eliminate the leadership within and destroy all stored supplies.", "Raid Supply Depot", "", getmarkerpos "Spawnpoint3", "assigned"]
  ] call FHQ_TT_addTasks;

When the mission runs, the trigger will run the condition field code every frame, and check whether it's true. If it is, it fires the trigger "OnActivated" code, which creates a new task

Share this post


Link to post
Share on other sites
Where did you actually put the code ?

One thing I notice that a lot of people have misconceptions about is when and how code is run. For example, if you simply put this code you mentioned into your init.sqf, it will only be checked once while init.sqf is running. it will never be run again.

If you want code to be run "as soon as something happens", it has to be in a trigger or a spawned script that sits in the background, waiting.

For example, this code:

if (["task1c"] call FHQ_TT_isTaskCompleted) then {
  	[Chaos1a, 
     	["task1d", "Three weeks ago, UGR launched an offensive on a lightly guarded joint base and seized stored weapons and supplies.  They have occuppied the base and conduct security patrols as a show of force.  Raid the base IOT eliminate the leadership within and destroy all stored supplies.", "Raid Supply Depot", "", getmarkerpos "Spawnpoint3", "assigned"]
  ] call FHQ_TT_addTasks;
};

will only be checked once when the script it's in executes. If you wanted to "watch" the task and create a new one once the task is finished, you'd need a trigger:

Place a trigger on the map, and put this in it's condition field:

["task1c"] call FHQ_TT_isTaskCompleted

Then, in the OnActivated field, put this

[Chaos1a, 
     	["task1d", "Three weeks ago, UGR launched an offensive on a lightly guarded joint base and seized stored weapons and supplies.  They have occuppied the base and conduct security patrols as a show of force.  Raid the base IOT eliminate the leadership within and destroy all stored supplies.", "Raid Supply Depot", "", getmarkerpos "Spawnpoint3", "assigned"]
  ] call FHQ_TT_addTasks;

When the mission runs, the trigger will run the condition field code every frame, and check whether it's true. If it is, it fires the trigger "OnActivated" code, which creates a new task

Well thanks bro. I first up it in the init.sqf, then I put the whole thing in the "onActivated" section. Thanls.

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

×