• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

How can I get if a unit successfully casted a spell?

Status
Not open for further replies.
Maybe I'm not understanding but you know a spell is successful when this Event happens:
  • Unit - A unit Starts the effect of an ability
I don't think you can detect when the Targets Allowed failed, because that happens before Order/Spell Events.
Thinking well, I could do something like:
1) Issues the order: set a boolean to false.
2) Spell Effect: set that boolean to true.
3) Spell Finish: check the value of the boolean.
But you just said that the fail happens before the Order/Spell Events, right?
 
The order onto unit function returns a boolean, which tells you if the order is going to be done (Mana, cooldown, valid target, silenced, ....).
Oh, really?
Maybe a better way to approach this is by figuring out a different path to what you want. What do you intend to do with this information if you had it?
I'm creating a system that when you press a button, a dummy caster cast a spell to the main selected unit, but I have to know that it happened because the button could be wasted in nothing, and need to know if there is a general way to achieve that.

If you are curious this thread is connected with these other 3:
 
Then yes checking that the order issued to the dummy returned true will confirm that the unit was able to cast the spell at the time it was issued. If, say, the unit gets stunned between the order and when it is actually cast (and then reordered something else so the spell is never cast)… then the order would have returned true but the spell was never cast. That seems unlikely with dummy units but in principle it could happen with an immobile dummy unit and the target leaving vision before the cast goes off.
 
Status
Not open for further replies.
Back
Top