Jump to content
Sign in to follow this  
CombatComm

createtrigger not working :my script included:

Recommended Posts

You could just modify the cas.sqf, like this:

sleep 120;

deletevehicle a10cas; deletevehicle a10pilot;

sleep (_this - 120);

trgBravo setTriggerActivation ["bravo", "present", true];

Assuming you will always use the 300 delay, or at least something thats more than 120.

Share this post


Link to post
Share on other sites

OOOk soo, this had been working amazingly. Now I just got my computer sent from korea and starting actulley playing the mission I was testing. I can spawn the A10 on command and it will dissapear on command the FIRST time only. Some how, the syntax does not include a repeat feature for it. BUT I have an actual trigger in the game and it is set to repeat but still not working. After calling the second or maybe third a10 it sticks around and does not dissapear. Any help would be appreciated. Thanks

Share this post


Link to post
Share on other sites
After calling the second or maybe third a10 it sticks around and does not dissapear.

Does that mean, you call the second after the first has been deleted or that you have 2 planes in the air at the same time?

Share this post


Link to post
Share on other sites

I call the second after the first has been deleted. Than that one sticks around and if I call another I have 2 in the air. :/

Share this post


Link to post
Share on other sites

Does this do the same? It's the same script but with local variables instead of global.

trgBravo setTriggerActivation ["none", "present", true];

if (isserver) then {
 _g = CreateGroup West;
 _v = createVehicle ["A10", [(getMarkerPos "A10Spawn") select 0,(getMarkerPos "A10Spawn") select 1,100], [], 0, "FLY"];
 _p = _g createUnit ["USMC_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];
 _p moveInDriver _v;
 _wp = _g addWaypoint [(getpos player), 0];
 _wp setWaypointSpeed "NORMAL";
 _wp setWaypointType "SAD"; 

 sleep 120;
 deletevehicle _v; deletevehicle _p;
 sleep (_this - 120);
 trgBravo setTriggerActivation ["bravo", "present", true];
};

Share this post


Link to post
Share on other sites

It does indeed work! Thanks. Only thing now is can you tell me what variable number is the length it stays and which one is how long before it runs the script again? The first 120 or the second 120?

Share this post


Link to post
Share on other sites

Minor modification, call it like this:

nul = [TriggerAvailableDelay,TimeAfterCASisDeleted] execvm "cas.sqf"

Example:

nul = [300,120] execvm "cas.sqf"

trgBravo setTriggerActivation ["none", "present", true];

if (isserver) then {
 _g = CreateGroup West;
 _v = createVehicle ["A10", [(getMarkerPos "A10Spawn") select 0,(getMarkerPos "A10Spawn") select 1,100], [], 0, "FLY"];
 _p = _g createUnit ["USMC_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];
 _p moveInDriver _v;
 _wp = _g addWaypoint [(getpos player), 0];
 _wp setWaypointSpeed "NORMAL";
 _wp setWaypointType "SAD"; 

 _d = _this select 1;
 sleep _d;
 deletevehicle _v; deletevehicle _p;
 sleep ((_this select 0) - _d);
 trgBravo setTriggerActivation ["bravo", "present", true];
};

Share this post


Link to post
Share on other sites

Hey SHK. This was working fine in single player butfor some reason does not want to work online. Online the a10 is spawned just fine and seems to dissapear every time but does not limit the time between CAS calls. What could be the problem? Im preaty sure online it needs to be global variables or public right? Which this is. Thanks again.

Share this post


Link to post
Share on other sites

On the same subject, building a little IED disarm script. Player activates a Disarm IED script via addaction, and want him to stay within say 1m of the object for 10 seconds to complete the disarm.

Trying to add a Timeout trigger within the script, testing using the following, to no avail (I'd expect to see either Disarmed at the end of 10 secs, or "Disamring interupted" if I move away within 10 seconds.

Any ideas what I've stuffed up?

object init line (called charge9)

Cap = this addAction ["Disarm device","Scripts\IEDdisable.sqf",charge9,5,true];

calls

_unit = _this select 0;
_device = _this select 3;

_EngineerClose = createTrigger["EmptyDetector",getPos _unit];
_EngineerClose setTriggerArea[1,1,0,false];
_EngineerClose setTriggerActivation["WEST","PRESENT",true];
_EngineerClose setTriggerTimeout [10, 10, 10, true];
_EngineerClose setTriggerStatements ["this", "hint 'Disarmed!'", "hint 'Disamring interupted'"];

Edited by gnarly_rider

Share this post


Link to post
Share on other sites

Since you already have an script you run, why not forget the trigger and do the checking in the script.

private "_hint";
_hint = "Disarmed!";
for "_i" from 0 to 9 do {
 if (_unit distance _device > 1) exitwith {_hint = "Disarming interupted"};
 sleep 1;
};
hint _hint;

Share this post


Link to post
Share on other sites
Since you already have an script you run, why not forget the trigger and do the checking in the script.

Of course!!!! So much simpler, thanx SHK!

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  

×