Jump to content
Sign in to follow this  
Carpaazi

JIP or Tasks_fix problem...

Recommended Posts

Im making a mission that uses JIP.sqf (Join IN Progress) and tasks_fix.sqf, and my problem is that once task1 is succeeded and publicvariable kicks in (In my triggers "on activation" is as follows: skapparit_selva = true;publicVariable "skapparit_selva"; nil = [objNull, ObjNull, task1, "Succeeded"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf")

The next objective wont show up, and the task1 doesnt go to green even that its supposed to. here is my JIP.sqf file:

private ["_diary6", "_diary5", "_diary4", "_diary3", "_diary2", "_diary1", "_str", "_trigger"];

waitUntil {!isNil "tasks_done"};


if (isNil "skapparit_selva") then {
"skapparit_selva" addPublicVariableEventHandler {
	task1 settaskstate "Succeeded";
	"skapparit" setMarkerColorLocal "ColorGreen";
	hint "Officers have been rescued!";
};
} else {
"skapparit" setMarkerColorLocal "ColorGreen";
};


if (isNil "skapparit_fail") then {
"skapparit_fail" addPublicVariableEventHandler {
	task1 settaskstate "failed";
	deletemarkerlocal "skapparit";
	"skapparit_fail" setmarkertypelocal "warning";
	hint "Objective failed!\nOfficers have been executed!";
};
} else {
"skapparit" setMarkerColorLocal "ColorBlack";
};


if (isNil "skapparit_selva") then {
"skapparit_selva" addPublicVariableEventHandler {
	"spetzileiri" setMarkerTypeLocal "o_recon";
	task2 = player createSimpleTask ["obj2"];
	task2 setSimpleTaskDescription ["Proceed to the <marker name=""spetzileiri"">Wolf 1s camp</marker> at the old castle ruins west of Tulga. They will have new objective for you, while we are trying to pinpoint your next objective in HQ","Got to camp","Go to"];
	task2 setSimpleTaskDestination markerpos "spetzileiri";
	task2 settaskstate "Created";
};
} else {
"spetzileiri" setMarkerTextLocal "The camp";
};


if (isNil "leirilla_selva") then {
"leirilla_selva" addPublicVariableEventHandler {
	task2 settaskstate "succeeded";
	"spetzileiri" setmarkercolorlocal "green";
	hint "Objective completed!";
};
} else {
"spetzileiri" setMarkerColorLocal "Colorgreen";
};


if (isNil "saattue_selva") then {
"saattue_selva" addPublicVariableEventHandler {
	task3 settaskstate "Succeeded";
	"saattue" setMarkerColorLocal "ColorGreen";
	hint "Guerilla convoy is burning!";
};
} else {
"saattue" setMarkerColorLocal "ColorGreen";
};

if (true) exitWith {};

and here is my tasks_fix (i leave the diary part away 'cause it would fill the whole damn site xD)

private ["_diary6", "_diary5", "_diary4", "_diary3", "_diary2", "_diary1", "_str"];

-------(here is the briefing and suchs, these work just fine)-------

if (!isNil "saattue_selva") then {
task4 = player createSimpleTask ["obj4"];
task4 setSimpleTaskDescription [" <marker name=""spetzileiri"">Wolf 1s camp</marker> ","Got to camp","Go to"];
task4 setSimpleTaskDestination markerpos "saattue";
if (isNil "_selva") then {
	task2 settaskstate "Created";
} else {
	task2 settaskstate "Succeeded";
};
};

if (!isNil "skapparit_selva") then {
task2 = player createSimpleTask ["obj2"];
task2 setSimpleTaskDescription ["Proceed to the <marker name=""spetzileiri"">Wolf 1s camp</marker> at the old castle ruins west of Tulga. They will have new objective for you, while we are trying to pinpoint your next objective in HQ","Got to camp","Go to"];
task2 setSimpleTaskDestination markerpos "spetzileiri";
if (isNil "leirilla_selva") then {
	task2 settaskstate "Created";
} else {
	task2 settaskstate "Succeeded";
};
};

task1 = player createSimpleTask ["obj1"];
task1 setSimpleTaskDescription ["Guerilla fighters Have captured two of our high ranking officers and if they're demands are not met, our officers will be executed at midday. We have a reliable information that the officers are being held in <marker name=""skapparit"">a small village of Tulga</marker>. Get our officers out from there before the execution takes place, and watch what you shoot! We don't need anymore resistance to grow here because you killed a civilian!","Rescue officers","Rescue"];
task1 setSimpleTaskDestination markerpos "skapparit";
if (isNil "skapparit_selva") then {
task1 settaskstate "Created";
} else {
task1 settaskstate "Succeeded";
};

tasks_done = true;

Does anyone see the problem, or then this thing works only in MP and not in editor when i test it myself?

Edited by Carpaazi

Share this post


Link to post
Share on other sites

Hmm.

Tested this with a friend and it seems that "it" thinks i am a dedicaded server and sont update my status...

Share this post


Link to post
Share on other sites

i am not a scripter but it happen i was just reading about this issue.

# What is not synchronized at JIP

* Markers (The markers themselves and their updated properties, e.g positions (if any))

o you can use the onPlayerConnected function to setMarkerPos the markers you wish to have updated to JIP players, this way when the player joins, the markers and their properties are transferred to the player

* if the value was changed of a variable which was publicVariabled earlier on, the earlier value is synchronized, not the current

source : http://community.bistudio.com/wiki/6thSense.eu:EG#Join_in_Progress

if i understand this right (excuse me for not typing the proper syntax as i said i aint a scripter)

you will have to add for each task status change involving a marker update, a script portion looking like:

onPlayerConnected

if task1 = "Succeeded"

do desired marker stuff.

Edited by Ka-Oz

Share this post


Link to post
Share on other sites

I did a lot of work to make jip work in my random-towns version of evo for arma1. The mission had (has!) some issues but the client synchronisation worked an absolute treat. The new joiner is kept appraised of the status of the mission update process with messages from crossroad.

I can send you the mission file if you want to pm me with an email.

Share this post


Link to post
Share on other sites

please do, Mr fenix! i have been trying to get it to work but i still cant update the tasks for the host (me), im hitting my head to a wall here =)

also, i might get my problem fixed with it, because the joined players tasks will reset to the original (the first 3 ones)

Share this post


Link to post
Share on other sites

just remember that on a hosted server, publicvariable broadcasts changes to all machines EXCEPT the one it was made public on =]

Share this post


Link to post
Share on other sites

Isn't that the whole idea of publicvariable,so it updates others ingame,but won't have to update yours since your running the whole thing =)?

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  

×