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

[Spell] Need an Ability That Can "Charge"

Status
Not open for further replies.
Level 4
Joined
Mar 20, 2014
Messages
67
Hi guys,

Anyone know of a way to create a hero ability that can "charge" and release? So the longer you charge it the more it does, but ideally an ability that can't cancel current orders (like Wind Walk)

Thanks!
- Zach
 
Level 13
Joined
Oct 12, 2016
Messages
769
Unfortunately, using any ability automatically breaks invisibility with wind walk.
I also don't know any standard warcraft 3 editor functions that detect a button being constantly pushed down.
You may have to consult someone with intricate knowledge in vJASS.

The only way I can think about doing this partially is by increasing the casting time for an ability of your choice with each level of that ability, then having a trigger detect when a unit uses the ability.
When detected, create a dummy unit to cast "Invisibility" on the casting unit.
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
There is no way to detect a button being pushed down constantly apart from the arrow keys which have a press and a release event.
If you want to use any letter as button you use abilities, but with those you cannot have that constant button press effect. I guess you could use Immolation or Mana Shield, so you activate the charge effect and deactivate it at some point and then the ability is released. Those abilities do not cancel current orders.
 
Level 21
Joined
Apr 8, 2017
Messages
1,530
Maybe this
Start charging
Event
--If an unit cast "activate" spell
Actions
--Remove "activate" ability
--Add "lautch charge" ability
--Set Xvar: 0
--Turn on "charging" trigger

------

Charging
Event
--Every x second
Actions
--Set Xvar (real): Aritmetic (Xvar+100)

------

Lautch
Event
--If an unit cast "lautch charge" spell

Action
--Remove "lautch charge" ability
--Add "activate" ability
--Here u use the charged amout as you want
--Set Xvar: 0
--Turn off "charging" trigger
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
Exactly.
Only that I would recommend using immolation/mana shield instead, because removing an ability when it is cast can be difficult, because you could cancel it partially, if you remove it instantly. Immolation only works though, if both start charging and releasing should be instant cast abilities.
If you want the start charging to be instant cast and the launch with animation you should do as Diegoit said. Berserk is probably the best ability for instant cast abilities. If you have problems with remvoing an ability when it is cast, you need to remove it later. I think it is best, if you remove the ability "cast backswing point" after the ability has been used, so the animation can be played fully.
 
Level 4
Joined
Mar 20, 2014
Messages
67
@Jampion yes sir Immolation is a great idea actually, because it's not supposed to be charged by holding down the button, but rather cast again (as to cancel the charge and send out the nuke)

Thank you all!
 
Status
Not open for further replies.
Top