• 🏆 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!

Detect if an ability is passive

Status
Not open for further replies.

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,576
I don't think a condition for that exists, but an idea that comes to mind is to check the abilities Cooldown, Mana Cost, and Cast Range. I imagine if all of these are equal to 0.00 then it's safe to assume that the ability is passive.

And you can guarantee that this is always the case by modifying your active abilities so that they have at least 1 of these fields set to a value > 0.00.

Of course, if a passive ability uses one of these fields it will cause a problem, but these are generally rare enough that it wouldn't be a hassle to manually filter them in your conditions.
 
Last edited:
Level 20
Joined
May 16, 2012
Messages
635
I don't think a condition for that exists, but an idea that comes to mind is to check the abilities Cooldown, Mana Cost, and Cast Range. I imagine if all of these are equal to 0.00 then it's safe to assume that the ability is passive.

And you can guarantee that this is always the case by modifying your active abilities that somehow meet all of these conditions. For example, increase their Cast Range or some other unused field to be > 0.00 so they don't get marked as Passive.

Hmm, that's a good idea, but i was thinking of checking the Order String - Use/Turn On field. As far as i checked, all passive abilities have this field as "none" and active ones have a string
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
You mean a function like: IsAbilityPassive('A000')?

The solutions provided here may only work as long you have that object instance operation natives for get/set.
However without those, (for an older patch) you could list those passives in a list of array for search & lookup.
Although, it would be nice to have that kind of function in the future without sorting into these workarounds.
 
Level 20
Joined
May 16, 2012
Messages
635
You mean a function like: IsAbilityPassive('A000')?

The solutions provided here may only work as long you have that object instance operation natives for get/set.
However without those, (for an older patch) you could list those passives in a list of array for search & lookup.
Although, it would be nice to have that kind of function in the future without sorting into these workarounds.

Yeah. A lot of stuff is only possible thanks to the new natives, so creating system that are compatible to everyone will become harder the more complex they are.
 
Status
Not open for further replies.
Top