Hello fellow Hiveworkshop members! Here is my problem:
Supose I have three units in a Unit Group. Each of them has its own Custom Value and there are some variables that have information of some of these unit's stats according to the unit's custom value.
Example:
Units_HP[1] = 10
Units_HP[2] = 15
Units_HP[3] = 20
And when I need to set the right HP amount on the right unit, I set it using the unit's custom value (i.e If the CV is 1, the HP is 10 and so on...)
Also, there is a variable called "Current HP" that measures how much hitpoints a unit has. It's also related to the unit's custom value and it can range from 0 to the amount determined by Units_HP.
The problem is I don't know much about the math of the World Editor. Of course I know that there are the Max and Min but I don't know how can I make a trigger to pick every unit in a specific unit group and analyse who has the higher value of "Current HP" and also put them in order like
Unit[1] = Unit with higher "Current HP"
Unit[2] = 2nd position unit with the higher "Current HP"
Unit[3] = The remaining
For my example, I would like to make a trigger that picks a unit group with 3 units.
Supose I have three units in a Unit Group. Each of them has its own Custom Value and there are some variables that have information of some of these unit's stats according to the unit's custom value.
Example:
Units_HP[1] = 10
Units_HP[2] = 15
Units_HP[3] = 20
And when I need to set the right HP amount on the right unit, I set it using the unit's custom value (i.e If the CV is 1, the HP is 10 and so on...)
Also, there is a variable called "Current HP" that measures how much hitpoints a unit has. It's also related to the unit's custom value and it can range from 0 to the amount determined by Units_HP.
The problem is I don't know much about the math of the World Editor. Of course I know that there are the Max and Min but I don't know how can I make a trigger to pick every unit in a specific unit group and analyse who has the higher value of "Current HP" and also put them in order like
Unit[1] = Unit with higher "Current HP"
Unit[2] = 2nd position unit with the higher "Current HP"
Unit[3] = The remaining
For my example, I would like to make a trigger that picks a unit group with 3 units.