HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Walk animation

01-09-2006, 02:40 AM#1
Hemlock
I have a little question.

*First of all I have two triggers to make things clear
*I hid them in order to not confuse poeple, hope that does not bother you

Hidden information:
Trigger1
Events
Map initialization
Conditions
Actions
Unit Group - Add all units of (Units in Cavalry Charge1 <gen>) to HorseArmy1
Player - Make Player 1 (Red) treat Player 2 (Blue) as an Ally with shared vision
Player - Make Player 2 (Blue) treat Player 1 (Red) as an Ally with shared vision
Wait 4.50 seconds
Unit Group - Pick every unit in HorseArmy1 and do (Actions)
Loop - Actions
Animation - Change (Picked unit)'s animation speed to 30.00% of its original speed
Animation - Play (Picked unit)'s Walk animation
Wait 0.50 seconds
Set HorsesWalk = True
Wait 5.00 seconds
Set HorsesWalk = False
Trigger - Turn off Horse walk animation <gen>



Hidden information:
Trigger2
Events
Time - Every 0.03 seconds of game time
Conditions
HorsesWalk Equal to True
Actions
Unit Group - Pick every unit in HorseArmy1 and do (Actions)
Loop - Actions
Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 5.00 towards 50.00 degrees), facing 50.00 degrees



What happens is that I order all units (in this case knights) from a unitgroup to slide over the landscape, but the slide off course looks unnatural so I added a walk animation to the horses, but the thing is, it is just not being animated.

(side note: I made this cause the normal knight movement, gets messup up and they don't run in a clear line)
(side note: With other animations it is possible, seems like only the walk animation is bugging.)


So is there anything advisable or is there something that I am missing or doing wrong.
01-09-2006, 02:43 AM#2
Tiki
Use the trigger tags for triggers.
01-09-2006, 02:45 AM#3
Hemlock
You mean unit animation tags ??

else can you explain what trigger tags are....
01-09-2006, 02:50 AM#4
PCPharaoh
Instead of wrapping your GUI triggers in [ hidden ], wrap them in [ trigger ] tags. Makes them look VERY pretty. I wuv it. Anyway, I could be wrong, but I think moving a unit with the GUI line "Unit - Move Unit" interrupts animations. What you need to be using is the JASS lines SetUnitX and SetUnitY. Regardless of this thing, JASS is a handy thing to know, and is worth learning if you don't know it already. Only takes a couple hours to learn too, thanks to all the awesome tutorials that are floating around the internet.
01-09-2006, 02:55 AM#5
Hemlock
well I found it already in GUI, but thank for the replies.

as simple trigger like this was needed

Trigger2
Events
Time - Every 0.01 seconds of game time
Conditions
HorsesWalk Equal to True
Actions
Unit Group - Pick every unit in HorseArmy1 and do (Actions)
Loop - Actions
Animation - Play (Picked unit)'s Walk animation
01-09-2006, 03:09 AM#6
PCPharaoh
If you're going to be running that every .01 seconds, (which you could probably increase to .03 or more, since almost nobody is running wc3 at 100 frames/second) I suggest you get rid of the unit group leak.
Trigger2
Trigger:
Events
Time - Every 0.01 seconds of game time
Conditions
HorsesWalk Equal to True
Actions
Set MyUnitGroupVariable = (Every unit in HorseArmy1)
Unit Group - Pick every unit in (MyUnitGroupVariable) and do (Actions)
Loop - Actions
Animation - Play (Picked unit)'s Walk animation
Custom Script: call RemoveGroup( udg_MyUnitGroupVariable)
Custom Script: set udg_MyUnitGroupVariable = null

Should fix it, but I'm not all that great at memory leaks myself, so that might not cover all leaks/handle the leak correctly.
01-09-2006, 03:24 AM#7
Hemlock
don't get the point here, I removed the loop if that is what you are refering at
01-09-2006, 10:53 AM#8
ShadowDragon
There is no leak Pharaoh, it's a group variable.