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

ability effect

Status
Not open for further replies.
Level 9
Joined
Dec 31, 2016
Messages
320
How to detect whether an ability has been actually cast? Because when I set "A unit starts the effect of an ability" it triggers too soon and when I order the unit to do something else after this event it cancels the casting.

So it doesn't really start the effect of an ability. But when I add wait 0.5 and then order it it works fine.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
It goes in this order:
1) A unit begins casting an ability
2) A unit starts the effect of an ability
3) A unit finishes casting an ability
4) A unit stops casting an ability

A 0 second Wait after Starts the effect should allow most things to work. Unfortunately, Waits have a minimum of like 0.2 or 0.3 seconds + the multiplayer delay that comes with syncing them.

You can use finishes/stops casting Events but they lack most of the desired control that you get with begins/starts (like Target point of ability being cast). Finishes casting would most likely be the best option with those problems aside.

And a workaround to Finishes Casting not having access to important information:

With a Unit Indexer, save the Target point of ability being cast, Target unit, and whatever other information you want to keep track of to your casting unit. Then you can reference these variables in the Finishes Casting Event.

  • Events:
  • A unit starts the effect of an ability
  • Actions:
  • Set CV = Custom value of Triggering Unit
  • Set TargetPoint[CV] = Target point of ability being cast
  • Set TargetUnit[CV] = Target unit of ability being cast
  • Events:
  • A unit finishes casting an ability
  • Actions:
  • Set CV = Custom value of Triggering Unit
  • You can now reference TargetPoint[CV] and TargetUnit[CV] and any other variables you stored beforehand.
  • Just make sure to remove the leaks (TargetPoint[CV])
 
Last edited:
Status
Not open for further replies.
Top