• 🏆 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!

Ability with charges

Status
Not open for further replies.
Level 4
Joined
Apr 28, 2017
Messages
112
Hi, I would like to create ability that has <x> charges, each charge has it's own cooldown, and after it charge regenerates back. (similar to ember spirit's ulti fire remnant from Dota).


I want the charges cooldown to be seen on the spell icon, and while a charge is recharging and spell is cast I don't want it to reset the cd, but finish the one it had.

Example of spell (ill use shockwave to make it simple):
Shockwave has 3 charges:
If i cast it once, has 2 charges left, and 3rd charge starts "charge cooldown". If I cast it again, it has 1 charge left, but gains 1 more as soon as "charge cooldown" ends, (then it has 2 charges again), and starts a new charge cooldown to regenerate the last charge... etc...

If there are no charges left you can't cast shockwave.

I've seen similar spells like this, but none of them had what I want, each lacked a part of my requirement.

Can anyone help me ?

P.S. here's the map that came closest to what I want, but it has 2 problems:
1) charge cooldown resets if you recast the spell
2) unit spots moving when a charge is recharged (i believe this is only the case if you spend more than 1 charge)
 

Attachments

  • Charged Spell System v.01.w3x
    72.3 KB · Views: 140
Level 15
Joined
Mar 25, 2016
Messages
1,327
In case you have only 2 of 3 charges, "charge cooldown" is running to get the third charge. In this case it is not possible to have the normal cooldown indicator, because as long as the normal cooldown indicator is active, you cannot cast the spell. The only exceptions I know are Immolation and Mana Shield, which can always be deactivated, because their cooldown only affects the activation.

The reasons for the problems are:
1) Unfortunately warcraft's UI is very limited in what you can change. If you use the spell, its cooldown will start and there is nothing you can do about it.
2) Apparently using triggers to activate/deactivate mana shield or immolation causes the unit to stop, whereas if you as a player use such an ability, the unit will not interrupt its current action.
You can deactivate immolation/mana shield by removing their buff without interrupting current actions. I don't think you can activate it without interrupting actions.

You could try playing around with enabling/disabling abilities to "save" cooldowns.
When your hero uses immolation, you disable it, enable a second immolation, use this as well, disable it and enable your first immolation again. Now you have two immolations running with the same cooldown. When the first one is deactivated, you do this disable/enable stuff again to hide your first abiltiy and replace it with your second ability. The second ability will have the cooldown of the first one, before deactivating it.

I tried it and it should work. Take a look at the map to understand how to do this enable/disable thing.
 

Attachments

  • ChargeSaveCooldown.w3x
    18.5 KB · Views: 106
Level 4
Joined
Apr 28, 2017
Messages
112
In case you have only 2 of 3 charges, "charge cooldown" is running to get the third charge. In this case it is not possible to have the normal cooldown indicator, because as long as the normal cooldown indicator is active, you cannot cast the spell. The only exceptions I know are Immolation and Mana Shield, which can always be deactivated, because their cooldown only affects the activation.

The reasons for the problems are:
1) Unfortunately warcraft's UI is very limited in what you can change. If you use the spell, its cooldown will start and there is nothing you can do about it.
2) Apparently using triggers to activate/deactivate mana shield or immolation causes the unit to stop, whereas if you as a player use such an ability, the unit will not interrupt its current action.
You can deactivate immolation/mana shield by removing their buff without interrupting current actions. I don't think you can activate it without interrupting actions.

You could try playing around with enabling/disabling abilities to "save" cooldowns.
When your hero uses immolation, you disable it, enable a second immolation, use this as well, disable it and enable your first immolation again. Now you have two immolations running with the same cooldown. When the first one is deactivated, you do this disable/enable stuff again to hide your first abiltiy and replace it with your second ability. The second ability will have the cooldown of the first one, before deactivating it.

I tried it and it should work. Take a look at the map to understand how to do this enable/disable thing.

How would i implement all this with ability I wanna use? Lets say shockwave for example or carrion swarm
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
It's difficult. I tried it today and not everything worked. Maybe I will give it a try some other day. It's to complicated to explain and I don't know how to exactly do it now.
 
Level 4
Joined
Apr 28, 2017
Messages
112
It's difficult. I tried it today and not everything worked. Maybe I will give it a try some other day. It's to complicated to explain and I don't know how to exactly do it now.

Did you check the map I attached in my first post ? Could you maybe edit something there to make it work so the recharge cooldown doesn't restart itself ?
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
I did take a look at the map. It's not that easy sadly. I still need to do the recharging thing. Using the ability already works quite nicely and the cooldown does not restart.
I am afraid the stop problem can't be avoided. There is a possible solution for it, but it's entirely unrelated to this spell.
 
Level 4
Joined
Apr 28, 2017
Messages
112
I did take a look at the map. It's not that easy sadly. I still need to do the recharging thing. Using the ability already works quite nicely and the cooldown does not restart.
I am afraid the stop problem can't be avoided. There is a possible solution for it, but it's entirely unrelated to this spell.

Well if you fix the cooldown part, I'll try and do the rest with an order that forces the unit to continue moving in a way it was before with another trigger
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
Ok, so I managed to do a charged ability with charge cooldown indicator. Only problem apart from that stop order is, that in order to make that immolation thing work, the unit needs buffs. Which means, that for different numbers of charges a different number (0-2) of buffs is displayed in the unit's status bar. Sadly you cannot hide buffs.
I guess you could make it, so that it has one buff per charge remaining, or make it, so that it has a constant number of two buffs and you write something general about that ability there: "This unit has Shockwave" for example.
 

Attachments

  • ChargeSaveCooldown.w3x
    20.2 KB · Views: 108
Level 4
Joined
Apr 28, 2017
Messages
112
Ok, so I managed to do a charged ability with charge cooldown indicator. Only problem apart from that stop order is, that in order to make that immolation thing work, the unit needs buffs. Which means, that for different numbers of charges a different number (0-2) of buffs is displayed in the unit's status bar. Sadly you cannot hide buffs.
I guess you could make it, so that it has one buff per charge remaining, or make it, so that it has a constant number of two buffs and you write something general about that ability there: "This unit has Shockwave" for example.

Thanks, charges work like a charm!
I know it's a lot of ask, but 1 more thing. How would I attach a spell (lets say shockwave) to work with it. I must be able to target a point with the spell same like shockwave can. I tried doing it but it doesn't work
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
I must be able to target a point with the spell same like shockwave can.
Impossible. Really. This system is based on immolation or mana shield being the only two abilities that can be "used" while on cooldown. They have no target point, so there is no way to make this ability work with a target point.
You could make it so it is cast in the direction the unit faces, you will have to be creative. Just remember that immolation is the base spell and you can do with this charged ability, what you can do with immolation, so no target, no cast animation, no mana cost (yes, because in this system deactivating immolation is used as cast event and deactivating does not cost mana)
Take a look at the triggers and look for game messages: use 3->2. Whenever use -> is displayed one charge is used.
 
Level 4
Joined
Apr 28, 2017
Messages
112
Impossible. Really. This system is based on immolation or mana shield being the only two abilities that can be "used" while on cooldown. They have no target point, so there is no way to make this ability work with a target point.
You could make it so it is cast in the direction the unit faces, you will have to be creative. Just remember that immolation is the base spell and you can do with this charged ability, what you can do with immolation, so no target, no cast animation, no mana cost (yes, because in this system deactivating immolation is used as cast event and deactivating does not cost mana)
Take a look at the triggers and look for game messages: use 3->2. Whenever use -> is displayed one charge is used.

Thanks. I guess i'll use this system then for abilities that don't need target. Edited fan of knives will be perfect! Gonna make it similar to skywrath's mage spell from dota (the one that auto aquires the target).

Again ty so much, cheers! Would give you more rep, but there's a restriction

EDIT: 1 more question. Can I still use immolation (neutral hostile) for other units? or will it interfere ?
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
Yes you can use immolation for other units. I think you could even use it for the same unit, because the strongest immolation would be used I guess. Not sure about it though.
 
Level 4
Joined
Apr 28, 2017
Messages
112
Yes you can use immolation for other units. I think you could even use it for the same unit, because the strongest immolation would be used I guess. Not sure about it though.

I have a small problem that I dunno how to solve. When I cast the spell 2/3 times, when it's recharging it will automaticly cast the spell again even tho I didn't use it (probably because order trigger). Do you know how to solve that ?
Here I attached the map so you can see what I'm talking about. Knight has the spell, but don't click on fan of knives, click on that scrolls.
 

Attachments

  • ChargeSaveCooldown(1).w3x
    21.1 KB · Views: 108
Level 15
Joined
Mar 25, 2016
Messages
1,327
Fixed it. I added a cast event trigger, so you only have to do the cast actions once and don't have to deal with the system triggers.
 

Attachments

  • ChargeSaveCooldown(2).w3x
    21.2 KB · Views: 123
Level 4
Joined
Apr 28, 2017
Messages
112
Fixed it. I added a cast event trigger, so you only have to do the cast actions once and don't have to deal with the system triggers.

Perfection! I guess the thread is solved :). Thank you for everything!
 
Level 4
Joined
Apr 28, 2017
Messages
112
Hmm an issue occured I didn't think of before. When charges are just about to come off coldown and I use a channeling spell, as soon as the charge comes off cd, my spell gets interrupted. Is there any way to solve this ? This issue happens because hero is ordered to immolation.
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
Is there any way to solve this ?
You could prevent the system from ordering using immolation, but that would break the system to some extent. You would no longer get charges while you are channeling.
I would recommend not using channeling abilities for that unit, if possible.
Another idea would be to trigger your channeling abilities, so you can decide whether they are interrupted or not.
 
Level 4
Joined
Apr 28, 2017
Messages
112
You could prevent the system from ordering using immolation, but that would break the system to some extent. You would no longer get charges while you are channeling.
I would recommend not using channeling abilities for that unit, if possible.
Another idea would be to trigger your channeling abilities, so you can decide whether they are interrupted or not.

How would i make them interruptable ?
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
check, if the unit is ordered to do something else (here you have to exclude the system's orders to use immolation), check for buffs (stun, silence, entagling roots, ...), check position. The unit can be moved by scroll of town portal, staffs and mass teleport for example.
Then there are some spell specific reasons to interrupt. Life Drain: target dies, Mana drain: target runs out of mana, both drains + aerial shackles: target becomes invulnerable, target is staffed, target becomes spell immune, etc.
It's probably more work to be worth it.
 
Level 4
Joined
Apr 28, 2017
Messages
112
check, if the unit is ordered to do something else (here you have to exclude the system's orders to use immolation), check for buffs (stun, silence, entagling roots, ...), check position. The unit can be moved by scroll of town portal, staffs and mass teleport for example.
Then there are some spell specific reasons to interrupt. Life Drain: target dies, Mana drain: target runs out of mana, both drains + aerial shackles: target becomes invulnerable, target is staffed, target becomes spell immune, etc.
It's probably more work to be worth it.

Hmm could this spell be made with 3 channel spells, and using disabling/enabling abilities ? Or must it be immolation/mana shield ?
 
Level 4
Joined
Apr 28, 2017
Messages
112
Must be immolation or mana shield. Other abilities cannot be used while on cooldown.

How did they pull ember's spirit ulti then :S ? When his charges recharge, they don't cause stopping actions like movement, interrupting teleport etc
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
I don't know this ability. If you can send me a map with this ability I can take a look at it.
 
Level 4
Joined
Apr 28, 2017
Messages
112
I don't know this ability. If you can send me a map with this ability I can take a look at it.

It's a dota map: Dota 6.88f download

when game starts, type -ap then find "Ember spirit / Xin" hero and pick him. His ultimate functions on charges. I think there's a cheat to lvl hero in singleplayer like -hero lvl or smth. Or just type 'whosyourdady' and one shot everything untill you're lvl 6
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
That abiltiy in dota has no cooldown indicator for the charge cooldown. If you don't need a cooldown indicator it's easy. Just use variables to keep track of the charges and disable the ability, when no charges are left. Enable it, when it has recharged.
 
Level 4
Joined
Apr 28, 2017
Messages
112
That abiltiy in dota has no cooldown indicator for the charge cooldown. If you don't need a cooldown indicator it's easy. Just use variables to keep track of the charges and disable the ability, when no charges are left. Enable it, when it has recharged.

Hmm it does show number of charges, with those little paws tho.... Anyway would smth like that be possible ? Without cooldown indicators
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
Didn't see it. I guess the ability is just changed then to show a different icon. That is not hard as I said. As long as you do not need a cooldown indicator.
 
Level 4
Joined
Apr 28, 2017
Messages
112
Didn't see it. I guess the ability is just changed then to show a different icon. That is not hard as I said. As long as you do not need a cooldown indicator.

Would it be too much to ask of you to make it ? Since you probably know exactly how to do it. Just the charge system. Don't need his ability
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
If you currently want to cast this ability and it recharges, the cast will be canceled. In the dota ability it's the same problem.
 

Attachments

  • Charges.w3x
    18 KB · Views: 113
Level 4
Joined
Apr 28, 2017
Messages
112
If you currently want to cast this ability and it recharges, the cast will be canceled. In the dota ability it's the same problem.

Wow this is excellent! I spent 3 hours yday trying to edit your last triger to do this, but I messed up with timers every time. What if I have dummy cast the ability? Will it be cancelled then ?
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
If you have a point target ability and you use the hotkey, you get this aiming cursor. Now while you are aiming, if the ability recharges, the aiming process is canceled and you have to use the hotkey once more. I guess it could also cancel it while you are performing the cast animation.
That cursor thing cannot be changed, because you never know if someone is currently aiming. You can however fix that it does not cancel the cast animation.
 
Level 4
Joined
Apr 28, 2017
Messages
112
If you have a point target ability and you use the hotkey, you get this aiming cursor. Now while you are aiming, if the ability recharges, the aiming process is canceled and you have to use the hotkey once more. I guess it could also cancel it while you are performing the cast animation.
That cursor thing cannot be changed, because you never know if someone is currently aiming. You can however fix that it does not cancel the cast animation.

I'll just use ability with no target like I did in that previous map and it should work out fine :).
Thank you for everything! I'll make sure to add you in map credits for this! Would give you more rep but gotta wait 24 hours xd
 
Status
Not open for further replies.
Top