Jump to content
Sign in to follow this  
shuko

Taskmaster, creating and updating tasks for any set of players with JIP support

Recommended Posts

0.6 Fixed: It was possible for hints to appear in wrong order when a task was updated and another was added more or less simultaneously (f.ex same onAct field of a trigger)

0.6 Added: Optional parameter to the update function. It's possible to give the task name of the task which should be set as current. This way it's possible to set one task as completed and another as current without needing to call the function twice.

--

Using the update function it's possible to set one task completed and another as current using an optional 3rd parameter.

Example:

nul = ["Kill","succeeded","Extract"] call TASKMASTER_upd;

This will make task state of task Kill to succeeded and the state of the task Extract as current.

--

Still trying to figure out a good way to set next uncompleted task as current automatically on current task completion.

Share this post


Link to post
Share on other sites

Armaholic still has 0.2 version. Great script.

Also, in the readme inside briefing.sqf v0.6 the tasks and notes example:

["faction _x == ""USMC"","Protect",["Protect the prototype plane.","Protect plane","Protect"]]

Missing a " after USMC

["side _x == WEST",["Mission","Do some other stuff"]],

Trailing semicolon even though its last element

Edited by tcp

Share this post


Link to post
Share on other sites

Thanks, fixed. Latest version has been sent to Armaholic, I'd prefer to be able to update it myself.

Share this post


Link to post
Share on other sites

Version 0.7

Yet another rewrite. This time using the same per-unit method, but with addPublicVariableEventHandler instead of waitUntil. The amount of threads (spawns) has been cut from 1 per task plus few additional down to just one. The iterations (looping) have been reduced alot as well; instead of looping all units now only playable units are checked, and looping count went from 5 to 3.

The support for alternative addition and update methods are not supported anymore, however the update (objSomething=true;publicvariable "objSomething") should work still normally. It's recommended to use TASKMASTER_add and TASKMASTER_upd from now on.

Minor changes to the marker system has been made as well. Now the boolean (true/false) value not only shows the marker, but also defines if that marker is hidden or left visible after task is completed. To ease the users, automatic marker hiding is also added, which means that when you use a boolean as marker value, the task marker will be hidden from everyone except those who have the task. If you prefer to use the default type (same as setSimpleTaskDestination) marker, they work in the same way as before.

A hint queue has been introduced as well. It handles all the fancy taskHints. It was added to make sure that a) all hints were actually shown b) they were shown in right order (in the order _add or _upd were called). However, due to latency, to get update and add hints in right order you need to use a new, optional, parameter of the update function.

Instead of doing this:

["TaskName","succeeded"] call TASKMASTER_upd;

[true,"TaskName2",["Desc","Short","HUD"]] call TASKMASTER_add;

You should use this:

["TaskName","succeeded",[true,"TaskName2",["Desc","Short","HUD"]]] call TASKMASTER_upd;

The old optional parameter to make another task current after completing a task still works. It's used like this:

["TaskName1","succeeded","TaskName2"] call TASKMASTER_upd;

Related to this, first option to the taskmaster was added. It's called ShowHintsAtStart, which can either be true or false. It determines if the hints for the tasks added to briefing (from init.sqf) will be spammed at the start of the mission. It has no effect on the hints shown later in the mission.

I have limited possibilities to test this completely just by myself, so I'm eager to hear feedback from you brave beta testers! ;)

Share this post


Link to post
Share on other sites

0.72

Added: New option (SetNewTaskCurrent). Determines if added task is made current task automatically.

Added: It's now possible to update multiple tasks with one call by passing an array of name/state pairs.

Fixed: tskCurrent was not set correctly for created tasks.

Share this post


Link to post
Share on other sites

0.8 Reworked: Hint Queue, to prevent same hint from being shown twice. Multiple minor tweaks.

0.73 Added: TASKMASTER_addNote. Function to add a note to briefing after mission has started.

Share this post


Link to post
Share on other sites

As per Wolle's and few other people request:

0.82 Added: Support for non-dedicated multiplayer host.

0.81 Added: New option: ShowHints. Determines if hints about task state changes are shown.

Also, "current" as dropped from the supported task state list, because BIS itself uses "assigned". "current" will still work as before, but to avoid getting double task hints, only "assigned" should be used. This whole thing only affects those cases where you manually set a current task.

Edited by Shuko

Share this post


Link to post
Share on other sites

0.83 Fixed: tskCurrent was not set for created tasks, only for those updated with TASKMASTER_upd.

Share this post


Link to post
Share on other sites

Have a little problem with this script.

When the mission is started and a player join the session, the tasks aren´t present. What must i do to solve this problem?

ps: not the best english, i know :)

Share this post


Link to post
Share on other sites

Could you be more specific; dedicated or host server? Link your mission or paste your briefing init etc.

Share this post


Link to post
Share on other sites

I´ve wrote this in the init.sqf:

[[
[WEST,"task1",["Befreien Sie die Ortschaft <marker name='strelka'>Strelka</marker>.","Primärziel: Strelka befreien","Strelka befreien"],"strelka"],
[WEST,"task2",["Befreien Sie die Ortschaft <marker name='kameny'>Kameny</marker>.","Primärziel: Kameny befreien","Kameny befreien"],"kameny"],
[WEST,"task3",["Sichern Sie die <marker name='kaserne'>Kaserne</marker>.", "Primärziel: Kaserne sichern", "Kaserne sichern"],"kaserne"],
[WEST,"task4",["Sichern Sie das <marker name='depot'>Depot</marker>.", "Primärziel: Depot sichern", "Depot sichern"],"depot"],
[WEST,"task5",["Zerstören Sie beide Su-27 auf dem <marker name='flug'>Flughafen</marker>.", "Primärziel: Su-27 zerstören", "Su-27 zerstören"],"flug"],
[WEST,"task6",["Zerstören Sie alle AA-Stellungen und Tunguskas.", "Sekundärziel: AA zerstören", "AA zerstören"]]
],[
["true",["About","Made by Shuko"]],
[WEST,["Mission","For the Motherland!"]],
[WEST,["Mission","Semper Fi"]]
]] execvm "scripts\briefing.sqf";

I tested it on my dedicated server. Hope this will help you. If not, i´ll send you the mission.

Share this post


Link to post
Share on other sites

And tasks dont show up for anyone, or just not for JIPs or..?

Share this post


Link to post
Share on other sites

The tasks are not present for JIP-players. Sry that i forgot this information...:o

Share this post


Link to post
Share on other sites

Does the mission have respawn enabled and AI disabled in description.ext?

That would mean tasks are not created for the unit which is spawned/created for the joining player. JIPing to AI units present at mission start should work.

I will look into this in the morning.

Share this post


Link to post
Share on other sites

I had tested it and it works now. The tasks will shown now for all players (JIP too). Good work.:ok:

Share this post


Link to post
Share on other sites

Good to hear.

First post and rar updated:

0.90 Fixed: Briefing tasks were not created for JIPs who had their units created by respawn.

Share this post


Link to post
Share on other sites
Holyhell, how is that thing supposed to work.

You don't change the briefing.sqf at all. The tasks to be shown in briefing ingame are defined in init.sqf.

simple init.sqf example:

[[
 [true,"Task1",["Kill the general.","General","General"]],
 [true,"Task2",["Destroy it the plane.","Plane","Plane"]]
],[
 [true,["Mission overview","Bla bla bla do this and do that"]]
]] execvm "briefing.sqf";

That will create 2 tasks and 1 note, which are shown in briefing screen.

Example trigger to update Task1:

cond: !alive general

onact: nul = ["Task1","succeeded"] call TASKMASTER_upd;

Example trigger to create 3rd task after 1 and 2 are done:

cond: tskTask1Completed && tskTask2Completed

onact: nul = [true,"Task3",["Get to teh choppa!","Extraction","Extract"]] call TASKMASTER_add;

Extraction zone trigger:

activation: west present (select correct side of course)

cond: this && tskCurrent == "Task3"

alternative cond: this && tskTask1Completed && tskTask2Completed

onact: nul = ["task3","succeeded"] call TASKMASTER_upd;

Mission end trigger:

cond: tskTask3Completed

type: end1 (or whichever you wish)

It's possible to create or hide/show markers as well, but above is a simple example without them.

Share this post


Link to post
Share on other sites

what is the best way to update jip players with tasks created during the mission? I have a mission where tasks are created during the mission and I would like the tasks and there status sent to jip players.

Share this post


Link to post
Share on other sites
what is the best way to update jip players with tasks created during the mission? I have a mission where tasks are created during the mission and I would like the tasks and there status sent to jip players.

I don't know about best way, but one way would be to give taskmaster a go. It should add and update tasks for JIPs automatically.

Share this post


Link to post
Share on other sites

I must be doing something wrong then because that is not happening.

nul = [WEST,"obj1",["Eliminate the enemy threat","Enemy","Enemy"],"obj1"] call TASKMASTER_add;

I have that in a script and the tasks are updated to those who are connected but if someone leaves then comes back or joins later that task is not updated to them.

**UPDATE**

Seems I may not have been patient enough. Still need to test with my friends by just myself on my dedi jip works, just takes a few moments.

Edited by Ghost

Share this post


Link to post
Share on other sites

I had V0.9 not V0.91 but I edited my post and it seems it does work, just takes a moment. Still need to test with friends to make sure they scripts I am calling it from are working properly. thanks for your help and the newer version.

Share this post


Link to post
Share on other sites

Just keep the feedback coming. I'll do my best to make it work.

How it currently works is that, when tasks are added (during mission), server saves them. Once a JIP connects, the tasks in init.sqf are created for him, then he waits for the new tasks to be synched from server.

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  

×