- Joined
- Sep 26, 2009
- Messages
- 9,534
I came across a blog where two people were discussing a specific trigger function...
"Do X action to "random unit from 'y unit group'" matching "matching unit has z condition""
One of the guys said that this function leaks... and not just a minor leak, a major one.
I am curious if this is actually a leak, or if that guy just didn't know what he was talking about. To be honest, I have this function playing hundreds, if not thousands of times during the course of my map (depending on which heroes are being used). Typically for "matching unit is a hero".
Does anyone have any knowledge of the "Random unit from unit group" function? Is this something that I should avoid? If it does, I'm guessing I'll have to set a unit variable at the beginning of a hero's selection that identifies that unit, and then re-assign that variable to the unit via a "unit enters playable map area" trigger so that when they use an ability like Metamorphosis or Robo-goblin (both of which annoyingly remove the variable assignment).
Is there a better way to do this?
"Do X action to "random unit from 'y unit group'" matching "matching unit has z condition""
One of the guys said that this function leaks... and not just a minor leak, a major one.
I am curious if this is actually a leak, or if that guy just didn't know what he was talking about. To be honest, I have this function playing hundreds, if not thousands of times during the course of my map (depending on which heroes are being used). Typically for "matching unit is a hero".
Does anyone have any knowledge of the "Random unit from unit group" function? Is this something that I should avoid? If it does, I'm guessing I'll have to set a unit variable at the beginning of a hero's selection that identifies that unit, and then re-assign that variable to the unit via a "unit enters playable map area" trigger so that when they use an ability like Metamorphosis or Robo-goblin (both of which annoyingly remove the variable assignment).
Is there a better way to do this?