• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Unit immobilized after using custom ability

Level 3
Joined
Apr 21, 2024
Messages
14
Hi, I am working on a map in which I have a custom unit that uses a custom ability. My custom unit uses the Stonemaul Ogre as a base and the custom ability uses Hurl Boulder as a base. I am trying to make it so that when my unit uses its ability, it loses the ability (so, basically, it can only use the ability once until a later event gives it the ability back). The unit can successfully use the ability and the ability is removed as expected, but, for some reason, the unit becomes completely immobile afterwards. I can still select it and issue commands to it, but it won't move anywhere or do anything. The trigger I'm using is below. Does anyone know why this might be happening? Thanks!

1715730154014.png
 
Level 3
Joined
Apr 21, 2024
Messages
14
That seems to have done the trick, thank you very much!

I have another question. If I have a custom ability whose base ability is Heal, can I somehow make the ability castable on units at full HP?
 

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,688
You don't want to use the Stops casting Event. These Events work in stages:

Stage 1: A unit Begins casting an ability. The unit has begun playing it's cast animation, mana cost hasn't been spent yet, cooldown hasn't started yet, and none of the effects of the ability have actually executed. The time spent doing this is tied directly to a unit's Art - Animation - Cast Point field. This can be interrupted with a newly issued "Stop" order or a disable (stun, silence, etc).

Stage 2: A unit Starts the effect of an ability. The unit has finished it's cast animation, the mana cost has been spent, the cooldown has started, and the effects of the ability SHOULD take place. However, you can interrupt the effects at this stage by removing the ability being cast from the unit. Note that doing this will still spend mana even though nothing else happens.

Stage 3: A unit Finishes casting an ability. This is useful for detecting when Channeling abilities finish. Unfortunately, it loses track of most ability-related Event Responses like (Target unit of ability being cast) and can be completely skipped if you issue an Order after Stage 2 has taken place (unless the ability is channeled). That's why you shouldn't use this outside of it's intended purposes!

So all 3 Stages can be interrupted in one way or another. Stage 1 can be interrupted by normal game mechanics like orders and disables, Stage 2 can be interrupted if you remove the ability, and Stage 3 can be skipped entirely if used incorrectly.

A unit Stops casting an ability will depend on what happens. If everything goes as planned then this will occur after Stage 3. Otherwise, it will occur when Stage 1 or 2 are interrupted.

With all of that in mind, you'll want to use this trigger:
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Boulder Hurl (Fel Orc)
  • Actions
    • Wait 0.01 game-time seconds
    • Unit - Remove Boulder Hurl (Fel Orc) from (Triggering unit)
This will occur after the effects of the ability have executed and will avoid the aforementioned "remove on cast" interruption thanks to the Wait.
 
Last edited:
Top