| 04-19-2007, 02:05 AM | #1 |
Is it possible to play any unit's "walk" animation continually while moving it periodically? Or is there a way to find any units "walk" animation ID to use in the SetUnitAnamationByID()? Reason I ask is that the system will use multiple unit models and each unit doesn't have the walk animation in the same "slot" so to speak. I could make a giant array with each unit's walk animation ID stored, but thats too much of a hassle for such a small thing. Ideas? |
| 04-19-2007, 12:30 PM | #2 |
I needed to do that, so I just swapped the units Walk and Stand animations in the models. |
| 04-19-2007, 12:34 PM | #3 |
If the units are paused or something akin to that where they can't react to orders, just SetUnitAnimation() for walk will do the trick. Most units have walk as a looping animation. Also remember you can QueueUnitAnimation(), so doing that in a loop or periodic timer callback works wonders. (I did that myself for a few spells) Play around with that and SetUnitTimeScale(), usually it's just a matter of configuring the unit type to what you need. If not paused then no. Units will persist in changing animations to their current orders. You could change the models animation names... But that's a lot of unnecessary KB for a map. If I'm still totally off, more detail please. xD |
| 04-19-2007, 02:25 PM | #4 |
Will try pausing the units. Edit: You're correct but pausing doesn't seem to help... The test function:globals unit u endglobals function test_child takes nothing returns nothing call SetUnitPosition(u, GetUnitX(u)-10, GetUnitY(u)-10) endfunction function test takes unit whichUnit returns nothing set u = whichUnit call TimerStart(CreateTimer(), 0.05, true, function test_child) call PauseUnit(u, true) call SetUnitAnimation(u, "walk") endfunction Tried SetUnitX/Y and changing the order of pausing and animation call, but the unit still reverted to its stand animation. I also tried the queue method with no success... |
