• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Loads for a skill

Level 3
Joined
Apr 8, 2023
Messages
23
Hey guys, do you know how I can get charges on an ability? I specifically need three charges.

Are you familiar with the Shrapnel ability for the sniper in Dota 1? Well, I need charges for it.
 
You can't do it normally as far as I know. Only some abilities, like Huntress's Sentinel, support charges.
However if you are on ~1.31+ version, it could be possible to create a custom UI frame that represents the number of charges and show it on the icon of the ability in command panel.
The logic could work like this:
  • When unit is trained/created, store its initial number of charges in a global variable/array
  • The custom frame would show value/number from the global variable
  • When unit casts the spell, decrease value in global variable
  • When value in global variable becomes 0, then disable that ability using 'Unit - Disable ability' action or outright remove it.
 
If it is exactly 1 unit with this ability in game at the time, it's possible make 4 icons where you just have the number of charges as part of the icon (need to make multiple version of the icon) and then change the icon with the Ability - Set Ability Icon trigger-action. Of course, this will chance the icon for all units having this ability, making this a terrible solution if more than 1 unit can have the ability.
Making custom UI, adding a small number to that ability is probably a better solution, but also pretty annoying.
 
Back
Top