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

Make spell greyed out retaining whatever cooldown it has

Status
Not open for further replies.
Level 10
Joined
Apr 27, 2012
Messages
241
Hello again!
So, I have a unit with 2 abilities:
1) Berserk-based 'Sprint'
2) Defend-based 'Defensive Stance'

When the unit goes into defend mode, I want the sprint ability to be greyed out. Sprint has 30 sec cooldown, so if it is currently cooling down, I want that to be visible in the greyed out ability icon.
One way to do this is by having a dummy cast a silence/drunken haze based ability on the unit once it uses 'defend'. But there is a problem with this method: It makes the unit's icon RED in the unit panel of the UI, as if it was affected by 'Curse' or any other negative buff.
I also experimented with the 'orb of lightning' item ability, which results in a greyed out icon of whatever ability you attach to it (by default has 'Purge' attached to it)... but to no avail so far...

Any suggestions, ideas, recommendations?
I am using version 1.26.
 
Level 30
Joined
Aug 29, 2012
Messages
1,383
I would've gone with tech tree requirements like an upgrade that you set level to 1/0 when the spell is ready/on cooldown but I think in 1.26 we couldn't substract upgrade levels, so I guess you can use unit requirements instead

1712840719493.png


You create a dummy unit called whatever you want and add it as a requirement for the ability. Once you use the ability, you remove the unit, so the ability is greyed out as if locked behind an upgrade requirement, and then you create it back for the player after X seconds

I'm not 100% sure about the cooldown though, I would suppose it keeps record of it since the ability itself isn't touched by anything
 
Level 10
Joined
Apr 27, 2012
Messages
241
Then I can't use it because of the messy delay of the 'unit is selected' event.
Example: If one unit is in defend mode, the other isn't, then I would need a trigger that fires each time a unit of that type is selected, and that checks if it is in defend mode, activating or deactivating the tech accordingly. That would result in a weird delay before the spell is greyed out, due to the aforementioned inherent delay of the 'unit is selected' event.
 
Status
Not open for further replies.
Top