Jump to content
Sign in to follow this  
tobmic

Trigger script

Recommended Posts

How to make a script that has triggers in it like this :

_trg1=createTrigger["EmptyDetector",getPos Gorka];

_trg1 setTriggerArea[200,200,0,false];

_trg1 setTriggerActivation WEST,NOT PRESENT,true;

_trg1 setTriggerStatements ["west countSide thislist <= 2", task1 setTaskState "Succeeded"; task1done=true; nul = [objNull, ObjNull, task1, "SUCCEEDED"] execVM ""CA\Modules\MP\data\scriptCommands\Taskhint.sqf"]

_trg2=createTrigger["EmptyDetector",getPos Khelmmarker];

_trg2 setTriggerArea[100,100,0,false];

_trg2 setTriggerActivation None,PRESENT,true;

_trg2 setTriggerStatements ["task1done", "nul=[] execVM "tasks\task2.sqf"; _Marker2 = createMarker ["Marker2", [12304.685,10798.175]]; "Marker2" setMarkerDir -631.10779; "Marker2" setMarkerColor "ColorRed"; "Marker2" setMarkerShape "ELLIPSE"; "Marker2" setMarkerSize [250, 150];"]

_trg3=createTrigger["EmptyDetector",getPos Khelm];

_trg3 setTriggerArea[200,200,0,false];

_trg3 setTriggerActivation WEST,NOT PRESENT,true;

_trg3 setTriggerStatements ["west countSide thislist <= 2 AND task1done", task2 setTaskState "Succeeded"; task2done=true; nul = [objNull, ObjNull, task2, "SUCCEEDED"] execVM ""CA\Modules\MP\data\scriptCommands\Taskhint.sqf"]

So after task1 is done task2 gets created with his markers and trigger 3 gets created with his condition and activation.

How do put that in a script and how do i executed it from the init.sqf that it will be JIP friendly and all players get the new tasks etc...

Right now i have placed alot of triggers in the editor but i want to get rid of those and put all the triggers in scripts that gets executed from the init.sqf to make sure all JIP players will get all the new tasks updated and see the new created markers

Help will be realy realy apreciated on this because right now im stuck on my mission : (

---------- Post added at 12:17 PM ---------- Previous post was at 12:15 PM ----------

if you guys dont understand what i mean i can send you the mission i work on it maybe you get an idea what i mean

Share this post


Link to post
Share on other sites

When entering objects with lines within them (ie. trigger statements, adding a unit's init, etc.) via a script, wrap double-double quotations around things which would have single double-quotations in the editor:

"task1 setTaskState ""Succeeded"""

JIP.. I suppose wrap it in isServer tags so you only have one trigger and add publicVariable to broadcast the variable within the trigger. As before, and in response your PM - you need to broadcast the change in variable, else it will only exist for those that triggered it.

"task2 setTaskState ""Succeeded""; task2done=true; publicVariable ""task2done"""

Then have a script run from init (or within it, but that's just messy), to change mission parameters (ie. setTaskState, new task, spawn new units or scripts, etc.)

if isNil varName {
do stuff;
} else exitWith {
other stuff;
};

Also, even besides the double-double quote marks, yours are all over the place.

I've never used taskhint, but to re-iterate the single double double quotation marks and all:

_trg1=createTrigger["EmptyDetector",getPos Gorka];
_trg1 setTriggerArea[200,200,0,false];
_trg1 setTriggerActivation WEST,NOT PRESENT,true;
_trg1 setTriggerStatements ["west countSide thislist <= 2", "task1done=true; publicVariable ""task1done""; nul = [objNull, ObjNull, task1, ""SUCCEEDED""] execVM ""CA\Modules\MP\data\scriptCommands\Taskhint.sqf""",""]

Share this post


Link to post
Share on other sites

possible to make me an example mission with that i have 1 trigger at start and the other triggers get created in a script that create the new markers , tasks etc....

wich will be JIP friendly

Share this post


Link to post
Share on other sites

Possible, but not likely. I'll take you up on looking over yours if you get really stumped.

Share this post


Link to post
Share on other sites

iam already stumped with all the alienlanguage here : (

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  

×