Whicker
Posts: 664
Joined: 6/20/2018 Status: offline
|
I guess I can see how this isn't possible - the game would have to do the same thing - loop thru all units to see what is in any given area of rps. The units that I wanted to check were all in groups, so rather than loop thru all the units on the side I made a table of group names and then loop thru those to see if they are in the area. The goal is to pop up a message if none of the units are in the area so this is what I think works: quote:
local t={'Group 3349','Group 3350','Group 3351','3rd Armored'} for i = 1,#t do local u = SE_GetUnit({name=t,side='Crimson Commonwealth'}) if u ~= nil then unitsToCheck = u.group.unitlist for i = 1, #unitsToCheck do local uu = SE_GetUnit({guid=unitsToCheck}) if uu:inArea{"RP-4091","RP-4092","RP-4093","RP-4094"} then --print(uu.name..' is it in the area? '..tostring(uu:inArea{"RP-4091","RP-4092","RP-4093","RP-4094"})) return --there is a unit still in the area so exit end end end--loop of unitlist end--table of groups ScenEdit_SetEvent('Sangster Recaptured', {IsActive=true})--if we get this far there are no units in the area ScenEdit_SpecialMessage('playerside','Commander, <br><br>Our forces have cleared the area around Sangster of most major enemy units, we should have control of the Airport in the next hour.<br><br>(you must have ground forces occupying the base for 60 minutes)')
< Message edited by Whicker -- 8/28/2019 3:55:46 AM >
|