KnightHawk75
Posts: 1450
Joined: 11/15/2018 Status: offline
|
So if I understand right you just want to know if all the good guys are out of the area at a give time right? See attached sample scenario, choose a in editor. I threw all the code into a special action, move the units around and use the button to test results. When satisfied just copy it all into an lua action and create and event that fires however often you want the check done (or however else you chose to use it like in a condition), though I suggest 1min or more as it's a heavy function if a side has a ton of units of the type and\or subtype you're filtering though. requires: 3 or more Reference points on Bad Guy's side (in the sample they are rp4,5,6,7 and part of a bad guy exclusion zone, but they don't have to be part of such). In fact you really don't even need RP's defined at all if you say want to just feed it a table of hard coded latitudes and longitudes points like r = {{latitude=0.0,longitude=0.0},{latitude=0.0,longitude=0.0},
{latitude=0.0,longitude=0.0},{latitude=0.0,longitude=0.0}} etc.
Code does not require any inarea triggers to exist or have fired on a unit, nor does it even use unit:inArea() as it has it's own inPolygon checking function which I find more reliable for this sort of thing. Note when looking at the non-function code in the special action: checkAreaForUnits('Good Guys',r,'Facility','5002') The last parameter to filter on subtype is optional, you can leave it blank or include the proper subtype code, 5002 is mobile personnel, 5001 is mobile vehicle,etc.
Attachment (1)
< Message edited by KnightHawk75 -- 4/16/2020 7:07:50 AM >
|