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

To "stuck" an Unit Animation.

Level 6
Joined
Apr 15, 2016
Messages
118
Is it possible to kinda stop the unit middle-animation, but even so be able to walk?

Let's say if you want to have a flying Blademaster during his Attack Slam animation, walking around everywhere.
This is for a periodic Trigger. The caster must be still in one of his animations, with his blade pointed foward (from attack animation) but he is able to walk (and NOT attack). Right now the closest I could get was to make the caster repeatedly play an animation during the 0.03 periodic timer. This fit perfectly for this Marine, but not so much for someone like Samuro/Blademaster.


Marine.gif
 
IIRC, there is an "animation speed" trigger that you can set to 0% to make the unit "stop".
Then to make the unit not able to attack you'd need to cast a modified silence that disables attacking (you likely want to disable spells too).

I don't have WorldEdit available until later, so can not get the exact name of triggers or test stuff right now.
 
Level 6
Joined
Apr 15, 2016
Messages
118
IIRC, there is an "animation speed" trigger that you can set to 0% to make the unit "stop".
Then to make the unit not able to attack you'd need to cast a modified silence that disables attacking (you likely want to disable spells too).

I don't have WorldEdit available until later, so can not get the exact name of triggers or test stuff right now.
There is a trigger like that, Animation - Set [Unit] animation speed to [X]% of base animation speed.

Now you gave me an idea, perhaps doing that and then moving the Unit vis Triggers. Gonna try that.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
There is a trigger like that, Animation - Set [Unit] animation speed to [X]% of base animation speed.

Now you gave me an idea, perhaps doing that and then moving the Unit vis Triggers. Gonna try that.
When you Move a unit using the "Move unit instantly" Action it issues a Stop order which messes with the unit's animations. To avoid this you can rely on code and use the SetUnitX() and SetUnitY() functions:
  • Set Variable U = (Some unit)
  • Set Variable P = (Some point)
  • Custom script: call SetUnitX( udg_U, GetLocationX( udg_P ) )
  • Custom script: call SetUnitY( udg_U, GetLocationY( udg_P ) )
Note that this ignores all collision and basically makes your unit act like a Flying unit. You'll generally want to accompany it with some kind of pathing system that checks for collisions. I usually rely on a hidden Item to do this. The idea is to position an Item where you want to move your unit, then store the Item's new position (which may have moved if it was placed somewhere unpathable), and then move your unit to that new position instead. You could also prevent any movement from taking place at all -> If distance between ItemPoint and TargetPoint is Greater than 5.00 then DO NOT MOVE.
 
Last edited:
Level 6
Joined
Apr 15, 2016
Messages
118
When you Move a unit using the "Move unit instantly" Action it issues a Stop order which messes with the unit's animations. To avoid this you can rely on code, in particular you have the SetUnitX() and SetUnitY() functions:
  • Set Variable U = (Some unit)
  • Set Variable P = (Some point)
  • Custom script: call SetUnitX( udg_U, GetLocationX( udg_P ) )
  • Custom script: call SetUnitY( udg_U, GetLocationY( udg_P ) )
Note that this ignores all collision and basically makes your unit act like a Flying unit. You'll generally want to accompany it with some kind of pathing system that checks for collisions. I usually rely on a hidden Item to do this as it gets the job done fairly well, the idea is to position an Item where you want to move your unit, then store the Item's new position (which may have moved if it was placed somewhere unpathable), and then move your unit to that new position instead. You could also determine that the Item has been repositioned and prevent any movement from taking place.
For a nasty coincidence, the Trigger that I require this has the collision off for the Unit (Unit turn colission off). I guess if SetPosition does that by itself, then I won't be needing that line. It's a Dota Sukuchi like Spell, and it was bothering me to collide with everyone in the way.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
For a nasty coincidence, the Trigger that I require this has the collision off for the Unit (Unit turn colission off). I guess if SetPosition does that by itself, then I won't be needing that line. It's a Dota Sukuchi like Spell, and it was bothering me to collide with everyone in the way.
You would generally rely on "phasing" for that type of effect, which is done through the Wind Walk ability. Wind Walk with -1 as transition time and proper duration seems to be the trick. In the case of DotA, Shukuchi was simply Wind Walk without the backstab damage and with instant fade time.
 
Top