Jump to content
Sign in to follow this  
Maurdekye

Check if a unit is inside a trigger area from outside the trigger

Recommended Posts

I've got a script that runs once a second on loop and examines all units each time, and one calculation it ought to apply is to check whether or not they're within the area of a trigger on the map. From what I can tell the only way to get a list of units within the trigger is by using the thisList var inside the trigger's activation, but that only fires once. I was hoping it might be possible to either access this list or query for inclusion in the list from outside the trigger's activation.

Share this post


Link to post
Share on other sites

You could pass the trigger itself as an argument and gather the units present in its radius.

 

In the activation field of your trigger : 0 = [thisTrigger] execVM "someScript.sqf"

 

someScript.sqf :

_trigger = _this select 0;
_radius = (triggerArea _trigger) select 0;

while {{_x distance _trigger < _radius} count AllUnits > 0} do {
	//gather all units
};

Share this post


Link to post
Share on other sites

The inArea command doesn't seem to work; it keeps giving me a strange error about forgetting a semicolon when I try to use it. Here's an example line in a logic entity;

bluscore = southking |#|inArea contention;

It gives me an error pointing to that character in the code, saying i'm missing a semicolon. What's going on?

Share this post


Link to post
Share on other sites

Are you sure you are using dev branch?

 

 

Game: Arma 3 Development Branch,

Version: 1.57

Share this post


Link to post
Share on other sites

Are you sure you are using dev branch?

 

 

Oh, it's only available in the dev branch? No wonder.

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  

×