• 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.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

[General] Correct ways to use new natives

Status
Not open for further replies.
Level 5
Joined
Dec 25, 2014
Messages
109
So, i've been confused about how to use some of new natives we got. Especially those Ability Mana and Cooldown parts. I tried using them on trigger like when the unit starts the effect on an ability, periodic timer, etc. But it seems doesn't really work at all.
Anybody knows why? Or i missing something maybe?.
 
Level 5
Joined
Dec 25, 2014
Messages
109
So, it is working on finishes casting an ability?

And oh, this is maybe out of context, but 'Set Unit Mana' is somehow doesn't work like usual. Long time ago, i made an ability similiar to Essence Shift (Dota). While the unit starts the ability, it restores some of its mana, it works perfectly.

As i said above, i tried to do something like this but now i'm using the ability manacost. I thought it is because of the native, but then i test it again to restores like 5 mana, but the unit's mana stuck in total where it has been decreased by the ability manacost (from full mana).
 
Level 7
Joined
Apr 17, 2017
Messages
316
So, it is working on finishes casting an ability?

And oh, this is maybe out of context, but 'Set Unit Mana' is somehow doesn't work like usual. Long time ago, i made an ability similiar to Essence Shift (Dota). While the unit starts the ability, it restores some of its mana, it works perfectly.

As i said above, i tried to do something like this but now i'm using the ability manacost. I thought it is because of the native, but then i test it again to restores like 5 mana, but the unit's mana stuck in total where it has been decreased by the ability manacost (from full mana).
It's definitely working with finishes casting an ability. I don't quite get the problem here. If you use ability manacost, how are you able to restore mana as it only changes the manacost of the spell?
 
Level 5
Joined
Dec 25, 2014
Messages
109
It's definitely working with finishes casting an ability. I don't quite get the problem here. If you use ability manacost, how are you able to restore mana as it only changes the manacost of the spell?
I mean i'm going to restores the mana equal to the manacost.
The UI does not update manacost changes instantly. Reselect the unit or force an repaint of the UI.
Hmm, is that true? I'm gonna test it again later then.
WARNING: Do not use the 2 SetCooldown/SetManacost natives for spells based on any morphing spell, nor raise skeleton spells. The game crashses as soon one tries to use them. Last tested in 1.30.2 (Pre Hotfixes).
Hoo, thanks. I'll be more aware of it.
 
Last edited:
Status
Not open for further replies.
Top