| 05-06-2009, 12:38 AM | #1 |
So. I realize this is something like the 15th time this subject has come up here, but the last time was in 2007 and I'm wondering if after nearly 2 years there has been any progress/insight into this particular problem. Apparently, SetUnitAnimation(u, "walk") fails to play a unit's "walk" animation for any discernible length of time, and the supposed way around this is to use SetUnitAnimationByIndex. Since the index changes depending on the unit model, is there any way to get SetUnitAnimation or QueueUnitAnimation to do its thing? Here's the spell effect I'm going for: the caster begins channeling "Mesmerize," forcing the target unit to face in the direction of the caster and walk (very) slowly towards the caster. At the moment, this is accomplished with Aerial Shackles (for single-target channeling and disable) and a periodic timer that makes the unit face the caster and moves it with SetPosition. SetPosition does not, apparently, interrupt animations at all (it only interrupts orders, which usually causes animation interruption if the unit is not disabled somehow). So what I'm asking for is *any* known workaround that applies to *every* conceivable unit with a Walk animation. |
| 05-06-2009, 01:05 AM | #2 |
Set the walk animation speed very slow (SetUnitMoveSpeed()) and with the periodic timer (0.25 seconds period could work) order him to walk to the caster. |
| 05-06-2009, 02:48 AM | #3 | ||
Quote:
Quote:
|
| 05-06-2009, 04:20 AM | #4 |
First, I'd like to thank you just for trying to help. Mostly just to offset the ungrateful tone I'm inevitably going to end up with. Sorry about that. While ordering the unit *could* work...
In all honesty, I think creating a huge if/else chain inside a function would be more feasible than trying to troubleshoot the above three issues. Now, I wouldn't necessarily object to a different approach, but I'd rather not trade one known bug for three unknowns. I hope you understand. |
| 05-06-2009, 09:18 AM | #5 |
If you are set on being able to play the walk animation of any unit, you can accomplish that by attaching the proper walking index to every unit-type that's used on your map, and using a function like GetUnitWalkIndex. There are probably easier solutions than this, but it would let you do what you want. |
