Hi.
So I need to get the unit in group g whose fly height is closest to the fly height of a unit.
I'm getting confused because ForGroup needs to call a function which would require to use a global. Is it possible I can use ForGroup in an If statement to return a unit? How would I do this?
Also, am I right in thinking GroupEnumUnitsInRange doesn't take Z into account and if it doesn't, can I use AND in a boolexp's return? Like so....
but it says a boolexp should take nothing so I can't put a value from another trigger (i) into it. How to work around???
Most important question is whether GroupEnumUnitsInRange takes Z into account.....
So I need to get the unit in group g whose fly height is closest to the fly height of a unit.
I'm getting confused because ForGroup needs to call a function which would require to use a global. Is it possible I can use ForGroup in an If statement to return a unit? How would I do this?
Also, am I right in thinking GroupEnumUnitsInRange doesn't take Z into account and if it doesn't, can I use AND in a boolexp's return? Like so....
JASS:
function myFilter takes nothing returns boolean
return GetOwningPlayer(GetFilterUnit()) == Player(15) and GetUnitFlyHeight(GetFilterUnit()) == GetUnitFlyHeight(udg_u[i])
endfunction
but it says a boolexp should take nothing so I can't put a value from another trigger (i) into it. How to work around???
Most important question is whether GroupEnumUnitsInRange takes Z into account.....