Hey! I am doing a rework of the UI, and i am trying to work out the life, shields, energy and name of the first unit from the subgroup you have selected.
Currently i am sorting selected units by their subgroup priority and saving the position of the first units of the subgroup in a string.
This works perfectly but when units have the same subgroup priority it messes up and displays wrong units info.
So my question: Is there way to get units creation time or when its spawned in the map.
Or is there a another way to sort same subgroup priority units?
Because that seems to be the way subgroups are sorted if the subgroups are same. I had an idea of picking all units in the map because i think they are sorted by time of creation, then comparing if the unit is the same. But that way seems very inefficient for the triggers and might cause lag.
you could set a custom value on the unit on unit creation or maybe use it's unique unit handle, never used it, dunno how it looks like but it might be realted to creation time.
Hey! I am doing a rework of the UI, and i am trying to work out the life, shields, energy and name of the first unit from the subgroup you have selected.
Currently i am sorting selected units by their subgroup priority and saving the position of the first units of the subgroup in a string.
This works perfectly but when units have the same subgroup priority it messes up and displays wrong units info.
So my question: Is there way to get units creation time or when its spawned in the map. Or is there a another way to sort same subgroup priority units?
Because that seems to be the way subgroups are sorted if the subgroups are same. I had an idea of picking all units in the map because i think they are sorted by time of creation, then comparing if the unit is the same. But that way seems very inefficient for the triggers and might cause lag.
you could set a custom value on the unit on unit creation or maybe use it's unique unit handle, never used it, dunno how it looks like but it might be realted to creation time.
@FunkyUserName: Go
Where is the unit handle? How do i get it or use it?