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

[Trigger] Channeling Ability

Status
Not open for further replies.
Level 8
Joined
Jul 21, 2015
Messages
143
So I am trying to get an ability (life drain) to halt movement speed to 0 and then reset it back to normal. I created two triggers to do this but they don't seem to work. I altered life drain to mimic aerial shackles. The reason I don't just use that ability is because I am making a maze custom map and if a hero did aerial shackle the units would have to reset their triggers which i don't want to go through the effort of making.
BTW: shackles = my altered ability not Aerial Shackles
First Trigger:
First Trigger
Events
Unit - A unit Begins channeling an ability
Conditions
(Ability being cast) Equal to Shackles
Actions
Set Integer = (Integer((Current movement speed of (Target unit of ability being cast))))
Unit - Set (Target unit of ability being cast) movement speed to 0.00
Trigger - Turn on Second Trigger <gen>
Second Trigger (not initially on):

Second Trigger
Events
Unit - A unit Stops casting an ability
Conditions
(Ability being cast) Equal to Shackles
Actions
Unit - Set (Target unit of ability being cast) movement speed to (Real(Integer))
Trigger - Turn off (This trigger)
 
Level 16
Joined
Mar 25, 2016
Messages
1,327
There are a lot of possibilities to stop a unit from moving, but setting movement speed to 0 is not one of them. There is a minimum movement speed of 150 for units, maybe if you set it to 0 in the gameplay constants it could work.
You can use to prevent movement:
  • order stop 0 seconds after movement was ordered (movement can also be ordered by right click, attack, patrol, spell cast, ...), does not work, if your unit can carry items, because as far as I know you cannot detect when a unit is ordered to drop an item
  • pause the unit
  • use an ability with a dummy caster (stun, ensnare, entangle, shackle)
There are more options, but these are the best ones I could think of.
 
Level 8
Joined
Jul 21, 2015
Messages
143
There are a lot of possibilities to stop a unit from moving, but setting movement speed to 0 is not one of them. There is a minimum movement speed of 150 for units, maybe if you set it to 0 in the gameplay constants it could work.
You can use to prevent movement:
  • order stop 0 seconds after movement was ordered (movement can also be ordered by right click, attack, patrol, spell cast, ...), does not work, if your unit can carry items, because as far as I know you cannot detect when a unit is ordered to drop an item
  • pause the unit
  • use an ability with a dummy caster (stun, ensnare, entangle, shackle)
There are more options, but these are the best ones I could think of.
Thanks a lot worked perfectly
 
Status
Not open for further replies.
Top