Help with jump spell animation

darth_ilidan

New Member
Reaction score
0
i made a jump spell for a hero with Thrall model, and it works fine but i want it to play the walk animation as it jumps so it looks better, nbody knows how to do this?
 

Azlier

Old World Ghost
Reaction score
461
Sadly, units are hard coded to play the walk animation only while actually walking.
 

Viikuna

No Marlo no game.
Reaction score
265
It is possible. Just use SetunitAnimationByIndex -function.

Note that you need to use SetUnitX and SetUnitY -functions instead of SetUnitPosition, because SetUnitPosition cancels your animation.

Edit. If you are using GUI, you can of course do it by using few custom scripts.
 

darth_ilidan

New Member
Reaction score
0
well actally im using gui and i dont know nothing about jass so plz could u post me the custom scripts needed
 

Viikuna

No Marlo no game.
Reaction score
265
ok, here they come:

custom script: call SetUnitAnimationByIndex(udg_Unit,someinteger)

When you use GUI variables in Jass they get udg_ prefix.
Replace udg_Unit with udg_<yourVariableName>

Different models have different integers for animations, so you need to test which integer is walk for your model.


try: 0, 1, 2, 3 ... etc.

Just like this:
custom script: call SetUnitAnimationByIndex(udg_Unit,1)
custom script: call SetUnitAnimationByIndex(udg_Unit,2)

Then you need to make your Jump not to cancel animation.

You are probably using PolarProjection for calculating next point where unit will move.
You need to find out that locations x and y coordinates.

You need 2 real variables: PointX and PointY


Then you store points x and y to those variables:

custom script: set udg_PointX=GetLocationX(udg_Point)
custom script: set udg_PointY=GetLocationY(udg_Point)

After this you have x and y cordinates.

This is how you set your units location without cancelling animation:

custom script: call SetUnitX(udg_Unit,udg_PointX)
custom script: call SetUnitY(udg_Unit,udg_PointY)
 

YourFace

<span style="color:#9C9C9C;"><strong>Runner Up - T
Reaction score
91
lol upload the map, ill try doing what he said, or cna he that
 

darth_ilidan

New Member
Reaction score
0
srry but long ago i used to make another map, i uploaded it and some1 stole it so, im not uploading my map without lock
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top