Jump to content
Sign in to follow this  
dragon zen

How to check whether unit in area of trigger, without "list"??

Recommended Posts

Friends:

I use trigger to set an area, and now I want to check whether certain units are in this area, how to make it??

I know there is a code "list" which can give all units in area, but this seems calculate too much. Is there any method by which I can check certain unit, just this unit??

Thanks

Share this post


Link to post
Share on other sites

This should do it.

_isUnitInTrigger = [MyTrigger, getPos MyUnit] call BIS_fnc_inTrigger;

Share this post


Link to post
Share on other sites
This should do it.

_isUnitInTrigger = [MyTrigger, getPos MyUnit] call BIS_fnc_inTrigger;

Thanks a lot.

I just write a script to calculate it, Now this can be done by simple code. T_T.........

Share this post


Link to post
Share on other sites
I know there is a code "list" which can give all units in area, but this seems calculate too much.

It isn't, and BIS_fnc_inTrigger uses list anyway.

Share this post


Link to post
Share on other sites
It isn't, and BIS_fnc_inTrigger uses list anyway.

No it doesn't. I uses math to perform check whether the object lies geometrically inside the area the trigger covers.

Share this post


Link to post
Share on other sites

Oh, really? I must have been thinking of a different function. In any case, I wouldn't worry about list causing massive performance issues, but I'm sure both methods would work well. Thanks for the correction.

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  

×