Moderator
M
Moderator
19 Oct 2015 07:07
Bribe: I really like the smoothness of the floating and would be good to make a non-floating model into one that does float. A couple of things:
When I set the minimum height to 100, the unit would still touch the ground.
Turning on the loop trigger is only necessary if the floating unit count is equal to 1. That's why Purge and the others recommended using a FloatCount integer so you can keep track. This way, you don't have to use CountUnitsInGroup when you remove a unit from a group - just check if FloatCount is equal to 0.
Bribe: I really like the smoothness of the floating and would be good to make a non-floating model into one that does float. A couple of things:
When I set the minimum height to 100, the unit would still touch the ground.
Turning on the loop trigger is only necessary if the floating unit count is equal to 1. That's why Purge and the others recommended using a FloatCount integer so you can keep track. This way, you don't have to use CountUnitsInGroup when you remove a unit from a group - just check if FloatCount is equal to 0.
20:55, 9th May 2013
PurgeandFire111:
The variables FU_MaxHeight and FU_MinHeight aren't needed. Just save the values of FU_MaxHeightSet and FU_MinHeightSet directly.
As Maker said, you shouldn't check if the group is empty every loop. It means an extra enumeration per loop (which is a drag on performance). I recommend using an integer variable -> increase it by 1 every time FU Event is ran, then decrease by 1 every time the unit is removed from the group. Then you can replace the condition for "<Unit Group> is empty" with "SomeInt Equal to 0".
PurgeandFire111:
The variables FU_MaxHeight and FU_MinHeight aren't needed. Just save the values of FU_MaxHeightSet and FU_MinHeightSet directly.
As Maker said, you shouldn't check if the group is empty every loop. It means an extra enumeration per loop (which is a drag on performance). I recommend using an integer variable -> increase it by 1 every time FU Event is ran, then decrease by 1 every time the unit is removed from the group. Then you can replace the condition for "<Unit Group> is empty" with "SomeInt Equal to 0".