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

Show ability icon if only 1 unit has the ability and a group is selected

Level 10
Joined
Apr 27, 2012
Messages
241
Say I have several units of the same unit type. Now I give 1 of them an ability via trigger. The others of the same type do not have that ability. Now I select them all, and the icon DOES NOT show in the UI.
Is there abilities that work differently? Is there a trick to make it so that 1 unit having the ability is enough for it to show when selecting a group?
 
Level 10
Joined
Apr 27, 2012
Messages
241
I was experimenting with spell books, giving all the units that don't have the ability a spellbook-hidden version of the ability, but it did not seem to work either.
What I'm trying to do is to make a charge attack system, wherein the first attack of a unit deals extra damage, and then the ability is 'replaced' with a greyed-out version that reads 'leave combat' as requirement. A timer attached to the unit is then started and refreshed whenever it attacks or is attacked. When that doesn't happen the timer runs out and the activated version of the ability is re-added.
This leaves me with any number of units of that type at any time having either of the 2 ability versions (activated or deactivated).

I guess I could try silence to grey out the ability, and only use 1 shared ability instead of 2.
Or I could experiment with that item lighting orb ability that also creates a grey out button.

Any other ideas? A way to grey out a button like silence does, but without a status buff icon, would be nice.
 
Level 29
Joined
Sep 26, 2009
Messages
2,595
are you on newer versions of the game? There are gui actions for starting ability cooldown like this which could work for you good as well:
  • Unit - For your_unit unit, start cooldown of ability your_ability " over "5.00 seconds. //Unit - Start Unit Ability Cooldown action
If you want to grey out the skill, you can disable an ability on a unit like so:
  • Unit - For your_unit, Ability your_ability, Disable ability: True, Hide UI: False //Unit - Disable Ability action
 
Level 10
Joined
Apr 27, 2012
Messages
241
No, I'm on the 'folk' version (1.26 I think?)
Anyways, I just solved it. ツ

Here's the trick:
  • Make passive base ability
  • make Lighting orb based ability (the one that lets you set another ability to be cast upon attack)
  • in the new Lighting Orb ability, set the field for the used ability to the passive ability from step 1
--> There are now 2 version of the ability, one that gives a normal icon, and a 2nd one, the Lighting Orb one, that creates a greyed-out icon
--> If there are 2 units of the same type, and one unit has the 1st ability, and another one has the 2nd ability, and you select them both, the icon of the primary ability is displayed!

Haha! How did I do that?! ツ
 
Level 24
Joined
Feb 27, 2019
Messages
833
Since youre on old version you could check this too. If you need it for anything else. Its exactly what you said, using silence to disable/enable abilities. Its pretty cool.
 
Top