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

[Solved] Unit Turns On Ability Detection?

Status
Not open for further replies.
Level 14
Joined
Jul 1, 2008
Messages
1,314
To my knowledge, a function like this does not exist. You would have to detect manually for the unit to enable its ability and then keep track via a boolean variable, that you have to set to false, once the ability is disabled again (or unit dies and so on).
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
Those arent turned on, they are set to auto-cast.
Turning on would be immolation, mana shield, etc.

In either case, you have to check orders.
If your unit is ordered to "healon", you know that he is now auto-casting it.
If your unit is ordered to "healoff", you know that he is not auto-casting any more.
You should use a unit indexer and a boolean array to keep track of all units.
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
if you are not going to use the unit indexer, you might use a hashtable, and store the boolean values (as wietlol suggested) to the unit handle id as parent value.

you should also think of the possibilities that could stop the unit from using the ability like death. Reset the value, if a unit dies. I think, once the mana is running out, the order "orderOff" is used. Atleast I hope ...
 
I have the Unit Indexer,just dun know how to use it. I'll just stick with good ol' GUI. Thanks for the auto-cast orders.

Should read the thread with it, it tells you how to use it. You just have to put the trigger somewhere in your map, don't have to modify/edit it at all. Then you can use custom value of units to properly do stuff like storing values uniquely.
 
Status
Not open for further replies.
Top