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

[Solved] Force abilities to go on cooldown

Status
Not open for further replies.
Level 20
Joined
Jul 10, 2009
Messages
474
Hey folks!
My current map contains a building which lets the player spawn one out of 6 minions once every 20 seconds. Upon choosing a minion, all 6 shall go on cooldown at the same time.
My current method implements this building as a item-shop so that I can easily trigger any unit to buy all 6 items at any time.
This solution works as intended, but causes some minor bugs, which are not relevant here.

I would like now to use abilities instead of items.
That means, I try to let 6 abilities have a shared cooldown.
My tries have been:

  • To let the building use all 6 abilities in a row. I can easily disable ability effects, because they are all triggered. But issueing 6 orders in a row doesn't work, because every order cancels the prior one.
  • To let the building use all 6 abilities in a row with zero-time-waits in between. This is better than my first try, because all abilities go on cooldown. But they go on cooldown with delay that adds up to something about a half second between the first and the sixth :( (All abilities are based on channel, and have all values set to zero - especially "Follow Through Time" and all duration fields.)
  • Add a unit inventory to the building that is able to use items, and then give a rune-like instant-use item to it that uses an ability with the same order id as my desired ability. This method was suggested by cohadar in the wc3c forum here, but I can't get it to work.

Is someone familiar with the third approach? It sounds quite promising :)

Or what other possibilities do I have to let all abilities go on cooldown?

Any help is appreciated :)

Best regards!
 
Make all of the abilities based off of the same ability - not channel. IIRC channel does not send other channels into cooldown when it is cast.

When one of your new abilities is cast, then they should all go into cooldown. Make them have different names, icons, etc.

Another way to do it is to simply have the building use all of the abilities when the action happens. This will send them all into cooldown. You want to make sure they have a 0.00 casting time. Disable all of the create unit triggers before casting the spells, then re-enable them right after.

Finally, you can make the building sell units. When a unit is sold it will have a cooldown. Trigger the building to sell all of the other units to a dummy buyer from an unused team and remove them all instantly.
 
Level 20
Joined
Jul 10, 2009
Messages
474
@Flux:
Thanks for your answer!
It's a bunch of active skills that I use.
Your second link provides a working method, although the icons of the dummy abilities are passive, so the "button clicked" animation doesn't appear.

Your Passive Cooldown System works great (good work actually), but I'd love to write something in GUI for myself, so that I can change it later, if required.

I noticed that your system works by giving a spellshield ability to the unit and then let a dummy cast "slow" on it. By testing, I found out that this spellshield ability can also be hardcast, thereby doing nothing (except going on cooldown). Also, the spellshield can be ordered immediately before another order and still gets executed. That means, a code like this:
  • Set TempUnit = some unit with warstomp and spellshield
  • Custom script: call IssueImmediateOrderBJ( udg_TempUnit, "spellshield" )
  • Custom script: call IssueImmediateOrderBJ( udg_TempUnit, "stomp")
would indeed let the spellshield ability and the warstomp ability go on cooldown (I stated in my first post that this method didn't work with instant-cast spells based on channel).

Are there more abilities like spellshield that can be ordered without trigger waiting time and still get executed? Like 6 different of them would completely solve my problem :)
P.S.: While testing your system, I noticed two things that might not be intended:
First of all, the triggered Blink on-damage-cooldown replaced its actual cooldown and was shorter than it. So you could shorten the actual Blink cooldown by attacking Maiev after using it.
Second, the triggered Blink on-damage-cooldown sometimes didn't set the ability on cooldown, but completely refreshed it instead (at least optically). It only happened, when I cast the real Blink somewhere, and attacked Maiev immediately afterwards. I guess there was a problem with the "slow"-casting dummy unit, and the spellshield just didn't trigger.


@LegalEase:
Making multiple abilities based on the same ability does not work. They share a cooldown afterwards, but you can't distinguish between them in a trigger.
That means, a unit with two abilities based on warstomp and a trigger like this:
  • Some Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Conditions
          • (Ability being cast) Gleich Warstomp1
        • 'THEN'-Actions
          • Game - Display to (All players) for 30.00 seconds the text: 1
        • 'ELSE'-Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Conditions
          • (Ability being cast) Gleich Warstomp2
        • 'THEN'-Actions
          • Game - Display to (All players) for 30.00 seconds the text: 2
        • 'ELSE'-Actions
would always display "1" and "2", when either Warstomp1 or Warstomp2 are used. That makes it useless ;)

Your second suggestion, selling the units, is quite similiar to my current solution (selling them as items), and I suspect it to cause the same bugs (which I didn't list in this thread).

Your third suggestion, using all abilities at once, was already tested by me and initially didn't work (see point 1 and 2 of my original post). As I found out now, channel-based abilities do not seem to be suitable for that method, but other abilities (like spellshield) seem to be.

So, indeed, finding 6 abilities that can be ordered and executed without waits would solve my problem :)
Do you know any?
 
I am a bit confused now. Let's be sure, we know what you want.

You want a player to order a unit form a building.
When this happens, you want all of the units available at the building to go into cooldown.
Am I right so far?
Then you want that unit to appear every 20 seconds.
Every 20 seconds, when a unit appears, you want the cooldown to run again for all available units.
Right?

The only thing that is not working for you currently is the cooldown. Did I get that all correctly?
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
To let the building use all 6 abilities in a row. I can easily disable ability effects, because they are all triggered. But issueing 6 orders in a row doesn't work, because every order cancels the prior one.
Not necessarily true.
If you put cast point and cast backswing to 0, and maybe also set prop window to 0, you then can cast abilities instantly, so they will be cast at the moment that you order it.

To let the building use all 6 abilities in a row with zero-time-waits in between. This is better than my first try, because all abilities go on cooldown. But they go on cooldown with delay that adds up to something about a half second between the first and the sixth :( (All abilities are based on channel, and have all values set to zero - especially "Follow Through Time" and all duration fields.)
0s waits are not good... you could use 0s timers, but then you still have to get the cast points right.

Best regards!
hya

Make all of the abilities based off of the same ability - not channel. IIRC channel does not send other channels into cooldown when it is cast.
1, channel does have the same effect as the other abilities.
2, there is no reason you want multiple abilities with the same order ids on the same unit... it is more useless than airconditioner in Iceland.
 
Level 20
Joined
Jul 10, 2009
Messages
474
I am a bit confused now. Let's be sure, we know what you want.

You want a player to order a unit form a building.
When this happens, you want all of the units available at the building to go into cooldown.
Am I right so far?
Then you want that unit to appear every 20 seconds.
Every 20 seconds, when a unit appears, you want the cooldown to run again for all available units.
Right?

The only thing that is not working for you currently is the cooldown. Did I get that all correctly?
Almost!
A player should be able to order a unit of his choice every 20 seconds. Every order only spawns one unit (not repeated) and lets go every unit on cooldown.

Wietlol said:
Not necessarily true.
If you put cast point and cast backswing to 0, and maybe also set prop window to 0, you then can cast abilities instantly, so they will be cast at the moment that you order it.
That's a good hint. I'll try that tomorrow.
However, not all abilities seem to refer to these stats. Spellshield for example always gets cast instantly (and I mean the spellshield ability that you can actively cast).
I would really appreciate some more instant-cast abilities, if you know any. They might come handy in the future, when editing the cast points of units is not an option.
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
@Eikonium
I don't get it, why do you need 6 of them? But if you want instant abilities, as mentioned all toggleable abilities (ManaShield, Immolation, Defend), Berserk and I'm not sure if Fan of Knives is instant.
P.S.: While testing your system, I noticed two things that might not be intended:
First of all, the triggered Blink on-damage-cooldown replaced its actual cooldown and was shorter than it. So you could shorten the actual Blink cooldown by attacking Maiev after using it.
Completely intentional.
Second, the triggered Blink on-damage-cooldown sometimes didn't set the ability on cooldown, but completely refreshed it instead (at least optically). It only happened, when I cast the real Blink somewhere, and attacked Maiev immediately afterwards. I guess there was a problem with the "slow"-casting dummy unit, and the spellshield just didn't trigger.
optically? So meaning it doesn't appear on cooldown but you can't use it?
 
Level 20
Joined
Jul 10, 2009
Messages
474
I don't get it, why do you need 6 of them? But if you want instant abilities, as mentioned all toggleable abilities (ManaShield, Immolation, Defend), Berserk and I'm not sure if Fan of Knives is instant.
I need 6 abilities, because the main building shall offer 6 different units, each of them represented by one ability. I can't use 6 times the same base ability, because that causes bugs. And I wanted them to be instant cast, because that allows me to cast all of them instantly (making them go on cooldown), whenever one of them gets used by a player.

optically? So meaning it doesn't appear on cooldown but you can't use it?
That's right. The cooldown seems to be refreshed, but when I try to use the spell, I get a "this spell is not ready yet" error.
Just do the following to reproduce it:
Level Maievs Blink to level 1, use it to blink in front of the archer, order archer to attack Maiev, select Maiev to look at the ability cooldown, wait until it happens. I feel that the refresh happens more often, when Maiev and archer stand very close to each other.

Wietlol said:
If you put cast point and cast backswing to 0, and maybe also set prop window to 0, you then can cast abilities instantly, so they will be cast at the moment that you order it.
That fixed it. Thanks!

So my problem is solved now. Thank you for all of your answers!

But I'd like to extend this topic on cohadar's suggestion which I already mentioned in my initial post.
cohadar said:
You can force a unit to use an order if you make a rune item with a dummy ability with that order.
The instant you give rune to the hero it will activate the desired order.

This method is much better than using IssueImmediateOrder because it cannot be interrupted with bash or stun.
Does anyone know more about this? As said, I tried it, but couldn't get it to work. I would really appreciate more knowledge here :)
 
Status
Not open for further replies.
Top