Jump to content
Sign in to follow this  
Carpaazi

I don't understand this...again wiht JIP/tasks_fix...

Recommended Posts

I don't get it, why the &%##!"&% these scripts won't change objective after task1 is completed. Here is the tasks_fix:

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

//Briefing
_diary6 = player createDiaryRecord ["Diary", ["Technical Details", "None"]];
_diary5 = player createDiaryRecord ["Diary", ["Historic", "No Information available"]];
_diary4 = player createDiaryRecord ["Diary", ["Weather", "No weather information available"]];
_diary3 = player createDiaryRecord ["Diary", ["Intelligence report", "No intelligence report avaialbe"]];
_diary2 = player createDiaryRecord ["Diary", ["Motor pool", "Not available"]];
_diary1 = player createDiaryRecord ["Diary", ["Briefing", "none"]];

//Missionslist
if (!isNil "urals_destroyed_done") then {
task2 = player createSimpleTask ["obj2"];
task2 setSimpleTaskDescription ["Destroy <marker name=""uazit"">UAZs</marker>.","Destroy UAZs","Destroy"];
task2 setSimpleTaskDestination markerpos "uazit";
if (isNil "uazs_destroyed") then {
	task2 settaskstate "Created";
} else {
	task2 settaskstate "Succeeded";
};
};

//task1
task1 = player createSimpleTask ["obj1"];
task1 setSimpleTaskDescription ["Destroy <marker name=""uraalit"">URALs</marker>.","Destroy Urals","Destroy"];
task1 setSimpleTaskDestination markerpos "uraalit";
//Created, Succeeded, Failed
if (isNil "urals_destroyed") then {
task1 settaskstate "Created";
} else {
task1 settaskstate "Succeeded";
};

tasks_done = true;

Ingame i have a trigger for task1 that has on condition:

isServer && !canmove r1 && !canMove r2

(r1 and r2 are the two urals that need to be destroyed)

on triggers on act:

IF (isServer) THEN {urals_destroyed = true; publicVariable "urals_destroyed"; hint "URALs destroyed!"}

Then i have second trigger that has on condition:

isServer && !isNil "urals_destroyed"

and on act:

urals_destroyed_done = true; publicVariable "urals_destroyed_done";

This is the JIP.sqf:

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

waitUntil {!isNil "tasks_done"};

if (isNil "urals_destroyed") then {
"urals_destroyed" addPublicVariableEventHandler {
	task1 settaskstate "Succeeded";
	"uraalit" setMarkerColorLocal "ColorGreen";
	hint "URALs destroyed!";
};
} else {
"uraalit" setMarkerColorLocal "ColorGreen";
};

if (isNil "urals_destroyed_done") then {
"urals_destroyed_done" addPublicVariableEventHandler {
	"uazit" setMarkerTypeLocal "destroy";
	task2 = player createSimpleTask ["obj2"];
	task2 setSimpleTaskDescription ["Destroy <marker name=""uazit"">UAZs</marker>.","Destroy UAZs","Destroy"];
	task2 setSimpleTaskDestination markerpos "uazit";
	task2 settaskstate "Created";
	};
} else {
"uazit" setMarkerTypeLocal "destroy";
};

if (true) exitWith {};

---------- Post added at 11:27 AM ---------- Previous post was at 11:24 AM ----------

I have tried to get the task change to work just by using "urals_destroyed" instead of the "urals_destroyed_done" part, but no luck that way either...i have been struggling with this thing for days and my missions are pretty much on hold until this works, because my mission depends on objectives that shows up later on and they need to be working for HOST/all current players,and JIP.

When i destroy the urals (r1 & r2) i get the hint "URALs destroyed", but task won't go to green on the taskslist, and the task2 (destroy UAZs) won't show up...at least not for ME (host)

This seemed to work quite well for players in game, but not for the host...huoh, im going to destroy something soon

---------- Post added at 11:37 AM ---------- Previous post was at 11:27 AM ----------

Tell me if i have understood this right:

if (!isNil "urals_destroyed_done")

The "!IsNil" part means, that when "urals_destroyed_done" kicks in, magic after it should happen, (!isnil = 1), but without (!), just with "isnil", we look for something that is at 0 state?

IsServer = "locally hosted server/SP/editor", and NOT dedicated?

Edited by Carpaazi

Share this post


Link to post
Share on other sites
if (!isNil "urals_destroyed_done")

The "!IsNil" part means, that when "urals_destroyed_done" kicks in, magic after it should happen, (!isnil = 1), but without (!), just with "isnil", we look for something that is at 0 state?

Have you tried using simple boolean (false/true) instead of nil check? At least then you'd know exactly what you have. isServer also includes dedi.

Share this post


Link to post
Share on other sites

Need to test that too, but originally this is from Xeno's script, so it is supposed to work this way xD.

Thanks for the reply thou, not many people replies to post about JIP, but i try simple boolean

---------- Post added at 11:01 AM ---------- Previous post was at 10:50 AM ----------

Didn't work, actually nothing seemed to have changed =/

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  

×