• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Move a Unit without interrupting an animation?

Status
Not open for further replies.
Level 6
Joined
Aug 22, 2005
Messages
113
I want a custom arrow key movement system in my game, to be able to have on-the-fly movement using the ''Move (instantly)'' action. How can I do this without having their animation be reset to Stand?

EDIT: Bah. Wish I could delete this post.
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
You can use two JASS lines, it's really simple:

  • Actions
    • Set YourUnit = ...
    • Set YourUnitLoc = Position of YourUnit
    • Set NewLoc = YourUnitLoc offset by bla bla
    • Custom script: call SetUnitX(udg_YourUnit, GetLocationX(udg_NewLoc))
    • Custom script call SetUnitY((udg_YourUnit, GetLocationY(udg_NewLoc))
Those two functions don't stop the animation, afaik. You can name your variables whatever you want, but be sure to change the parts after "udg_" too.

If something isn't clear, I can explain further.
 
Status
Not open for further replies.
Top