Jump to content
Sign in to follow this  
mikie boy

Triggers and playableunits from an object

Recommended Posts

looked at various threads but ive finally given up - struggling with this one...

this works with "player" in host mode - but in multiplayer "player" doesnt work, so i need anyone of the players named - s1 to s6 - set off the trigger when they are triggerarea distance away from the object FakeFOB.

basically any playable unit would be great to set it off.

ive messed around with playable units, trigger attachvehicle, and well ive dodged using triggers in the past that im now completely stuck.

I would just use west but unfortunately there are west AI at the centre of the trigger area that i do not wish to set off the trigger.

_trg	= createTrigger["EmptyDetector",getPos FakeFOB];
_trg setTriggerArea[13,13,0,false];
_trg setTriggerActivation["NONE", "PRESENT", false];
_trgstatement = format["(position S1 distance FakeFOB <18) or (position S2 distance FakeFOB <18)"];
_trg setTriggerStatements [_trgstatement, "nul = [] execVM 'Terrorsupport\FAKEFOBwaveattack.sqf'", ""];

None of them are in a group and i dont want them to be, only other way i can think of it is to scrap the trigger and use a while loop, but id rather not.

any ideas would be much appreciated..

Share this post


Link to post
Share on other sites

_trg=createTrigger["EmptyDetector",getpos _Modulename];
_trg setTriggerArea[500,500,0,true];
_trg setTriggerActivation["ANY","PRESENT",true];
_trg setTriggerTimeout [4, 4, 4, true ];
_trg setTriggerStatements["{vehicle _x in thislist} count playableUnits + [player]  > 0 ", "", ""]; 

Try adapting this, I used it to check if any players whether in a vehicle or on foot were within 500m of a town. It works on my test dedicated server.

The addition of the player value allows for testing locally.

I can't take any credit for it, and I can't remeber where I came across it either sorry?

Possibly from here?

http://forums.bistudio.com/showthread.php?t=128822&highlight=%7Bvehicle+thislist%7D+count+playableUnits

Share this post


Link to post
Share on other sites

yep - nice one blakeace,

i didnt have the any in the activation - when using _x in thislist

thanks again

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  

×