Jump to content

Recommended Posts

Variable names aren't replaced in strings, not in the task tracker, nor anywhere else in SQF scripts.

What you need to do is to use the "format" script command. FOr example, the string "Secure the town of '_town'" should read format["Secure the town of '%1', _town];

Basically, the %1 will be replaced by the content of the first variable after the "format" string.

Share this post


Link to post
Share on other sites

Ok I used the format string and it worked. I also used it on the _curtask variable which created the proper task finally.

I am having trouble though using it in my trigger though.

_trg1 setTriggerStatements["this","[format ['%1',_curtask],'succeeded'] call FHQ_TT_setTaskState; hint 'fired'; ",""];

Trigger fires but my task is not updated.

Any suggestions?

k

Edited by ikmn

Share this post


Link to post
Share on other sites
Trigger fires but my task is not updated.

The format string references the local variable "_curtask", but in the context of the trigger condition/onActivate code, this variable is not known at all..

In essence, that means that you need to de-reference the variable at the time you set the trigger statements, like this:

_trgi1 setTriggerStatements["this", format["['%1', 'succeeded'] call FHQ_TT_setTaskState;", _curtask];, ""];

Note that the format is executed at the time you call setTriggerStatements, not inside the trigger's onActivate code. Of course, this means that it will always be the same task that is succeeded here with this trigger. You will need to update the trigger, use different triggers, or use a global variable instead of _curtask (which is local)

Share this post


Link to post
Share on other sites

Hello.

Might be a noob question but how can I set these tasks NOT to show on launch of mission. Lets say I have this in my briefing.sqf

[
west,
	["task1",
	"Do something over there",
	"Go do it",
	"Do",
	getmarkerpos "doIt_mrk"

	],
	 ["task2",
	 "Ask forums cause you are dumb",
	 "Forum question",
	 "post",
	 gemarkerpos "BiForums"
	 ]
] call FHQ_TT_addTasks;

So lets say I want task1 to assign after I am landed to the ground (trigger cond = IsTouchingGround unitname). And after I complete task1, then I want task2 to assign.

So question is how do I do that? If I use briefing.sqf all the tasks are already active.

I also tryed this without any .sqf scripts (only fhqtt2.sqf in mission folder and this line in my init.sqf: call compile preprocessFileLineNumbers "fhqtt2.sqf";)

I place trigger in editor:

Activation  = Radio Alpha
Condition   = true[/i]
Onact       =

[
west,
	["task1",
	"Do something over there",
	"Go do it",
	"Do",
	getmarkerpos "doIt_mrk",
	"assigned"
	]
] call FHQ_TT_addTasks;

This does give you the task but not show "Task assigned" icon on screen.

EDIT Okay I did study a bit more and It seems that my problem is only with notifications (the icon appears "task succeeded"" or "task assigned". I didnt really understand how I implent the task notification...

Edited by Deform

Share this post


Link to post
Share on other sites

So lets say I want task1 to assign after I am landed to the ground (trigger cond = IsTouchingGround unitname). And after I complete task1, then I want task2 to assign.

So question is how do I do that? If I use briefing.sqf all the tasks are already active.

So, if I get it right, you want the tasks not to show at all: You can not make tasks "visible" after being created. You can delay the creation of a task, though. Basically, don't create the task until you want it to be seen.

EDIT Okay I did study a bit more and It seems that my problem is only with notifications (the icon appears "task succeeded"" or "task assigned". I didnt really understand how I implent the task notification...

Uhm, what exactly is the problem now ? I'm afraid I can't follow you...

Share this post


Link to post
Share on other sites
So, if I get it right, you want the tasks not to show at all: You can not make tasks "visible" after being created. You can delay the creation of a task, though. Basically, don't create the task until you want it to be seen.

Uhm, what exactly is the problem now ? I'm afraid I can't follow you...

Sorry english is not my native language so explaining is not the strongest part :j: So the problem I currently have is task notification. It doesent pop up any kind of "task assigned" or "task succeeded" when I complete or assign new tasks.

Edited by Deform

Share this post


Link to post
Share on other sites
Sorry english is not my native language so explaining is not the strongest part :j: So the problem I currently have is task notification. It doesent pop up any kind of "task assigned" or "task succeeded" when I complete or assign new tasks.

The first batch of tasks is never popping up a task notification, since it's assumed this would normally happen during briefing.

Later on, the task notifications should pop up whenever the state of a task changes.

So, for example, if you say

["task1", "succeeded", "task2"] call FHQ_TT_setTaskStateAndNext;

Edit: It might help if you would post the part that sets your task states

it should show "Task suceeded: task1" followed by "Task assigned: task2"...

Share this post


Link to post
Share on other sites
Sorry english is not my native language so explaining is not the strongest part :j: So the problem I currently have is task notification. It doesent pop up any kind of "task assigned" or "task succeeded" when I complete or assign new tasks.

The Task state must be set for every task on his one.

For example you want to canceled a task and creat an new one on the run in the Mission you have too make a new one.

["Task1","canceled"] call FHQ_TT_setTaskState;
			sleep 4;                                        //skript waits her so the notifications are not colliding

    // ------------------ CREAT A NEW TASK FOR  WEST AND ASSIGNED IT ----------------------------
			[
				west,                                                                   // Task for the west 
					["Task2",
					 "Long description of the Task",
					 "Name of the Task you see in the notification",
					 "Waypoint Text",				                // Waypoint text
					getmarkerpos "Marker or Objekt Name",	        // Optional: Position or object in ""
					"assigned"				                        // Optional: Initial state of the created Task
					]
			] call FHQ_TT_addTasks;

So task1 is canceled and then task 2 is created and get assigned to the player. You can have this in a extra sqf and call it from a trigger or write it in the trigger "on activation" condition.

What Varanon wrote works when you have defined the task in the briefing. But how i understand you, you don't want too see the task from the beginning in your task list. So you have too creat them on the run. Hope this helps ;)

Share this post


Link to post
Share on other sites
The Task state must be set for every task on his one.

For example you want to canceled a task and creat an new one on the run in the Mission you have too make a new one.

["Task1","canceled"] call FHQ_TT_setTaskState;
			sleep 4;                                        //skript waits her so the notifications are not colliding

    // ------------------ CREAT A NEW TASK FOR  WEST AND ASSIGNED IT ----------------------------
			[
				west,                                                                   // Task for the west 
					["Task2",
					 "Long description of the Task",
					 "Name of the Task you see in the notification",
					 "Waypoint Text",				                // Waypoint text
					getmarkerpos "Marker or Objekt Name",	        // Optional: Position or object in ""
					"assigned"				                        // Optional: Initial state of the created Task
					]
			] call FHQ_TT_addTasks;

So task1 is canceled and then task 2 is created and get assigned to the player. You can have this in a extra sqf and call it from a trigger or write it in the trigger "on activation" condition.

What Varanon wrote works when you have defined the task in the briefing. But how i understand you, you don't want too see the task from the beginning in your task list. So you have too creat them on the run. Hope this helps ;)

I was just about to upload my test mission here but that was exactly what I was looking for! :yay: To get this work in COOP do I just add if (isServer) then command on that script or does it even need it? Im fairly new with MP scripting. Done plenty of SP missions with custom addactions, briefings, camera scriptings etc. But MP scripting stuff still confuses me :confused:

EDIT: And to answer my own question I assume I dont have to add that If isServer... Since It should run on all clients so other players get the mission aswell right?

...If I understood right how the MP scripting goes. As an examble If I run script that spawns one enemy and it activates via trigger. And if I dont include if (isServer) in my .sqf it will run on all clients making 2 enemies appear? This went a bit off-topic now but...

Edited by Deform

Share this post


Link to post
Share on other sites

Hey Deform I'm also very new too skripting but this should work without any isserver and such snippets. The hole FHQ TaskTracker is multiplayer an JIP ready so I think you don't have to worrie about that.

Share this post


Link to post
Share on other sites

Hi Varanon

Firstly i would like to thank you for releasing this script, it has been a massive help to me as I'm just starting out with scripting and tasks were driving me absolutely nuts.

One issue i have is not a fault in your script, it's more a requirement for the project I'm working on. I am working on a mission that re-uses tasks in the mission but they are randomly placed on the map. what i am finding is that once a task has been defined and completed if that particular task comes round again it is not being added to the task list, presumably because the task name already exists in the task list. As an example i'm using EVAC and MEDIVAC tasks quite frequently in the progress of the mission and once the task has been completed once it never seems to get added to the task list again.

What would be ideal for my situation is a function to remove the completed task from the list, my script at the moment waits for the task to be completed then marks the task as complete in the task list, then after a wait or sleep it needs to clear the task off the list so if the task is generated again in a different location then it will be added to the task list as a new task.

Thanks again for this useful script

Regards

Ian

Share this post


Link to post
Share on other sites

I'll think about it. It shouldn't be too difficult to add.

Share this post


Link to post
Share on other sites

Hi, Varanon, first of all thanks for the great script!

I was making a small Arma OA mission (edited with v. 1.62 due to constant script errors in 1.63 and switched back for exporting to MPM) and figured out that bug L3TUC3 was talking about

I noticed that the task creation/succeeded/etc notifications don't work unless there's at least one FHQ_TT_addBriefing entry. Is this intended behavior?

still exists on dedicated server (v 1.63). Everything runs fine in singleplayer or on listen-server but on dedicated server tasks won't create without briefing. Once I've added briefing with FHQ_TT_addBriefing, tasks started working as expected. :)

Oh, one more thing - I think it would be great if commented description in fhqtt2.sqf will contain scripts version number because right now it's almost impossible to distinguish them.

Edited by Semiconductor
typo

Share this post


Link to post
Share on other sites
Once I've added briefing with FHQ_TT_addBriefing, tasks started working as expected. :)

Yeah, the problem is that the script will always first wait for briefing, then for tasks, so if you don't add a briefing, you won't receive tasks....

Oh, one more thing - I think it would be great if commented description in fhqtt2.sqf will contain scripts version number because right now it's almost impossible to distinguish them.

I'm in the process of reworking the script completely. It will end up being a "plug-in" for the function module. On Arma 3, this allows automatic initialization which makes it possible to safely use Tasktracker calls in triggers.

In fact, it's already done, but I didn't find the time because I was on a well deserved (! :D) vacation trip to the sea last week! Expect an update in the coming week

Share this post


Link to post
Share on other sites

Hey all, sorry i searched and couldnt find nothing on this thread. Is there a way to make these randomized? I'm not actually worried about a new task starting after another in random order (although i'll take that info also!) but rather start a tasks now and then another 15 min later and randomize the order...

Thanks!

Share this post


Link to post
Share on other sites
Anyone?

I'm afraid I can't quite follow you.

If you need to create random tasks at random or fixed intervals, you can use scripts for that purpose. In any case, this goes beyond the scope of what the task tracker wants to achieve...

Share this post


Link to post
Share on other sites

Thanks man. Yea i was interested if it was possible with your scripts. My knowledge is limited although i'm learning more and more everyday. I found some other solutions but doesn't seem like i can integration your scripts logic into them so was interested if anyone has accomplished this before.

Thanks for the reply

Share this post


Link to post
Share on other sites

I've found a little bug with the filters. If you want to assign a task/briefing to a single unit (object), you have to edit the fhqtt2.sqf first like this:

Change lines 152-156

         case "OBJECT":
       {
           // Result is only the array containing the object
         	_outputArray = [_inputArray];
       };

to

        case "OBJECT":
       {
           // Result is only the array containing the object
         	_outputArray = [_filter];
       };

Somehow a wrong variable sneaked in there.

Share this post


Link to post
Share on other sites
Somehow a wrong variable sneaked in there.

Ugh, right. This is probably a leftover from an older version.

Need to release the new version, anyway... been too busy with CUP lately.

Share this post


Link to post
Share on other sites

Hi.

Someone recommended to use this script, but I struggle to use localization with makers.

The following code works: init.sqf:

["taskCapturePyrgosTest", "Kill all enemies at <marker name=""respawn_Pyrgos"">Pyrgos</marker> at postion (map: 167126).", "Test (fixed)", "Capture", getMarkerPos "respawn_Pyrgos", "created"]

But the following does not work:

init.sqf:

["taskCapturePyrgos", localize "smotrans_taskCapturePyrgosDescription", "Test localized", "Capture", getMarkerPos "respawn_Pyrgos", "created"],

stringtable.xml:

<Original>Kill all enemies at <marker name=respawn_Pyrgos>Pyrgos</marker> at postion (map: 167126).</Original>

I tried to use < or &lt, but both do not work. How can I sue HTML code inside the localisation when creating tasks please?

Share this post


Link to post
Share on other sites

What happens in the latter case? Script error message? Or no text showing?

Share this post


Link to post
Share on other sites

I don't know if that what you're trying to do in your stringtable.xml is working, because I've never tried it, but I guess what you want is that:

<Original>Kill all enemies at <marker name="respawn_Pyrgos">Pyrgos</marker> at postion (map: 167126).</Original>

Share this post


Link to post
Share on other sites
I tried to use < or &lt, but both do not work. How can I sue HTML code inside the localisation when creating tasks please?

I think you are running into a general problem with localization that is unrelated to the task tracker itself.

I used localized strings before, using the "<" style for markers.

Again, it would help to know what the result is, i.e. what does "do not work" mean ?

Edit: Also something to consider: I'm not sure if it's mandatory, but literally ALL stringtable.xml I've ever seen start with STR_ for their strings. Also, note that the stringtable must be save in UTF8

Edited by Varanon

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

×