Jump to content
Sign in to follow this  
Flens

Task modules broken in multiplayer, best workaround/alternative?

Recommended Posts

Attempting to use modules to create tasks just means every tasks completes whenever someone joins.

How do I prevent this from happening?

Alternatively, how do I create tasks in sqf and have them complete/fail on trigger activation?

Share this post


Link to post
Share on other sites

I wouldn't use the word broken, I don't recall them ever working in MP, which is a shame because its a very nice system. (Same with the Support module not working in MP properly). I hope Neo can fix it like he fixed the slingloading in TOH.

Share this post


Link to post
Share on other sites

Do you mean once a task complete then a player joins the game then the task says complete again? Or are you saying every time some one joins the game the mission is completed?

Share this post


Link to post
Share on other sites
Attempting to use modules to create tasks just means every tasks completes whenever someone joins.

How do I prevent this from happening?

Alternatively, how do I create tasks in sqf and have them complete/fail on trigger activation?

Could you please describe exact repro steps or provide sample mission?

Task modules were briefly broken in alpha, but were fixed and are working ever since. I'm afraid the most common cause of issues tends to be improper configuration.

Share this post


Link to post
Share on other sites

1: Create task module

2: Set task state module

3: Link them together

4: Create a trigger and synch that with the set task state module

Congratulations, your tasks are now broken beyond repair for multiplayer

Attempting to remove the set task state module and changing the trigger on act to _null = ["task1", "SUCCEEDED"] spawn BIS_fnc_taskSetState; doesn't work either, you'll get the task completion just fine and it doesn't spam shit like crazy in multiplayer whenever someone joins, but it also resets the task state after a couple seconds to being just created and not succeeded.

---------- Post added at 13:54 ---------- Previous post was at 13:21 ----------

How does shk handle jips?

Will they be getting an up to date task screen?

Share this post


Link to post
Share on other sites

How does shk handle jips?

Will they be getting an up to date task screen?

FHQ TaskTracker does support full JIP now, including disabled units joining in progress

Share this post


Link to post
Share on other sites

What attributes did you set to module? What is trigger activation?

When I tried it with "All playable units" being owners and trigger activated by radio command, everything worked fine both on client and on server.

Share this post


Link to post
Share on other sites

Did you test with other people when hosting?

Anyway, I looked into shk and it seems easy enough to work with, certainly easier than wrestling with modules.

Share this post


Link to post
Share on other sites

I tried it with one hosted server and one client. Should I check different environment?

Share this post


Link to post
Share on other sites

Try it on a dedicated server.

SHK btw, does NOT work in multiplayer. No player could see ANY task.

Share this post


Link to post
Share on other sites
Try it on a dedicated server.

SHK btw, does NOT work in multiplayer. No player could see ANY task.

BTW it does...

Share this post


Link to post
Share on other sites

I can't say much for the Task Module, as I don't think it is all that useful for a multi-task operation with multiple triggers and such. It is much easier to organize it in script, and is still very easy. It uses BIS functions, which the Task Module does as well. The difference in this alternative is you are just doing it manually. Also, choosing neither side for whether or not the Module works (as I have no clue), doing it this way in script works on SP and MP, hosted and dedicated, as long as you get your localities correct. The functions I'm using are global. I haven't tested JIP yet, but what I'm showing you is not JIP compatible. For it to be, I believe you can either A. Wrap it in BIS_fnc_MP, or B. Execute an additional file that runs checks on each objective, setting them appropriately. I'd start with the MP function though, I'll be that does the trick.

Here's a little snippet that shows how I do it in my missions.

init.sqf - This ensures that the tasks are created only on the server. This works for other clients and on a DS because it uses global functions. Can still run it on all clients if you wish, however for me I did not because my tasks.sqf also encompassed conditions and effects and other server side items. Could always scope them out though, if you insisted.

if (isServer) then {
[] execVM "tasks.sqf";
};

tasks.sqf

[west, "tsk1", ["Successfully and silently deploy on the northern beach.", "Insertion", "Insertion"], (getMarkerPos "insertion"), true] spawn BIS_fnc_taskCreate;  

sleep 10;

["tsk1","SUCCEEDED"] call BIS_fnc_taskSetState;
sleep 2;

[west, "tsk2", ["Infiltrate the enemy encampment and destroy the coastal defences.", "Destroy Coastal Defences", "Destroy Coastal Defences"], (getMarkerPos "obj1"), true] spawn BIS_fnc_taskCreate;  

waitUntil {
(isNil "arty1" || {!alive arty1}) && (isNil "arty2" || {!alive arty2}) && (isNil "arty3" || {!alive arty3})
};

sleep 2;

["tsk2","SUCCEEDED"] call BIS_fnc_taskSetState;

What this bit of script does is create a task with the given title and description, then hint that it was assigned (see true). Then put a condition, in this case just sleep, and it hints and sets that it was succeeded. After a sleep, we create another task, this time with the condition being the death of 3 artillery guns (isNil because they have % conditional presence). Rinse n' repeat as you please. The reason I have sleeps all over is because each hint stays up for a few seconds. It's a neatness thing. Give this a shot, let me know if you have any questions. For info about these functions, find them in the Functions dialog in the editor.

Share this post


Link to post
Share on other sites

Although this is useful for its time, with A3 it is a bit obsolete (should still work though, just more time consuming). See the function info for BIS_fnc_taskCreate, BIS_fnc_setTaskState (hell, this one is just optional for looks, it is actually incorporated into the former), and BIS_fnc_MP (the "MP Framework" of A3, and much more understandable and user friendly).

Sorry for the lack of links, the biki doesn't contain all functions yet. The Function viewer in the editor, however, includes full comments at the top that basically include anything you'd see in the biki, save for a few examples, which I have provided above.

Edit: On the topic of the Briefing module, I again suggest doing it in an .sqf. Its just easier to manage and manipulate if you want to, let alone maintain JIP.

Edited by Grimes [3rd ID]

Share this post


Link to post
Share on other sites

SHK works fine in any setup including dedicated server

Share this post


Link to post
Share on other sites
BTW it does...

Then please explain how to get it working on a dedicated server.

Share this post


Link to post
Share on other sites
SHK works fine in any setup including dedicated server

Yeah I agree. It's fantastic to use on a dedicated server.

Share this post


Link to post
Share on other sites
4: Create a trigger and synch that with the set task state module

Congratulations, your tasks are now broken beyond repair for multiplayer

The problem is probably that the trigger triggers (weird sentence) on all clients, and therefore notifies the module X amount of times.

Share this post


Link to post
Share on other sites
The problem is probably that the trigger triggers (weird sentence) on all clients, and therefore notifies the module X amount of times.

I believe triggers are only server side, but have global effects. IE, when a trigger set to Once fires, it doesn't fire as an independent event on all clients, it fires once for the server and is then broadcasted. For example, a trigger won't spawn 10 vehicles when the init only calls for 1 to spawn, when there are 10 people on the server.

Again though, don't have to deal with sync with the method I posted. :D All stock too.

Share this post


Link to post
Share on other sites
;2600194']I believe triggers are only server side' date=' but have global effects. IE, when a trigger set to Once fires, it doesn't fire as an independent event on all clients, it fires once for the server and is then broadcasted. For example, a trigger won't spawn 10 vehicles when the init only calls for 1 to spawn, when there are 10 people on the server.

Again though, don't have to deal with sync with the method I posted. :D All stock too.[/quote']

But triggers do work on each client, locally, don't they? Only, if ran nearly simultaneously on everyone, as it usually is, it gives the illusion that it's global.

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  

×