• 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.

Looping Animations

Status
Not open for further replies.
Level 6
Joined
Apr 20, 2007
Messages
232
I am making a map , where player character is controlled by Arrow Keys (on keyboard). I need to make that animation loops , while pressing Up Arrow. Here's what I do :

  • FowardStart
    • Events
      • Player - Player 1 (Red) Presses the Up Arrow key
    • Conditions
    • Actions
      • Trigger - Turn on Foward <gen>
      • Animation - Play Shaman 0026 <gen>'s walk animation
      • Animation - Queue Shaman 0026 <gen>'s walk animation
  • Foward
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit - Move Shaman 0026 <gen> instantly to ((Position of Shaman 0026 <gen>) offset by 2.00 towards (Facing of Shaman 0026 <gen>) degrees)
      • Animation - Play Shaman 0026 <gen>'s walk animation


It sucks because it stops at the middle of animation. So how should I make/fix this trigger huh ?
(it moves as it should , but it doesn't play animations)
 
Uhm first of all , you know sth about leaks?
u would create each 0.01 sec a leak bc of " ((Position of Shaman 0026 <gen>) offset by 2.00 towards (Facing of Shaman 0026 <gen>) degrees)"

Maybe do not move the unit per trigger - order it to move to the new position , i think thats better because all effects like stun and slow would be disabled with the trigger movement

Try sth like this
JASS:
local location loc1 = GetUnitLoc(YourUnit)
local location loc2 = PolarProjectionBJ(loc1), 2.00, GetUnitFacing(YourUnit))
call IssuePointOrderLocBJ( YourUnit, "move", loc2)
call RemoveLocation(loc1)
call RemoveLocation(loc2)
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Uhm first of all , you know sth about leaks?
u would create each 0.01 sec a leak bc of " ((Position of Shaman 0026 <gen>) offset by 2.00 towards (Facing of Shaman 0026 <gen>) degrees)"

Maybe do not move the unit per trigger - order it to move to the new position , i think thats better because all effects like stun and slow would be disabled with the trigger movement

Try sth like this
JASS:
local location loc1 = GetUnitLoc(YourUnit)
local location loc2 = PolarProjectionBJ(loc1), 2.00, GetUnitFacing(YourUnit))
call IssuePointOrderLocBJ( YourUnit, "move", loc2)
call RemoveLocation(loc1)
call RemoveLocation(loc2)

o_O

JASS:
local real a = GetUnitFacing(YourUnit) * bj_DEGTORAD
call SetUnitX( YourUnit, GetUnitX(YourUnit) + 2 * Cos(a) )
call SetUnitY( YourUnit, GetUnitY(YourUnit) + 2 * Sin(a) )

SetUnitX/Y don't interrupt orders or anything else of the like.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
SetUnitX/Y don't exist in GUI

Howabout this?

  • Pie
  • Events
  • Conditions
  • Actions
    • Custom script: local real a = GetUnitFacing(someone) * bj_DEGTORAD
    • ---- stuff happens here ----
    • Custom script: call SetUnitX( someone, GetUnitX(someone) + 2 * Cos( a ) )
    • Custom script: call SetUnitY( someone, GetUnitY(someone) + 2 * Sin( a ) )
 
You could look which duration the animation has and then repeat it each time that it looks like a normal loop
But i think using the blizzard movement is the best way!
"SetUnitX/Y" does not interrupt the unit which could be abuse too . For example u could move while channeling a spell...
Or maybe just look in the spell section im sure there are MANY movement systems
 
Status
Not open for further replies.
Top