• 🏆 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] Hiding Ability With Cooldown

Status
Not open for further replies.
Level 15
Joined
Jul 6, 2009
Messages
889
What would be the best way to hide an ability but still having it in cooldown?

Removing the ability and readding it again will cause the cooldown to be reset. Disabling the ability for that player will cause the spell to be unavailable completely for that player.

Triggering the cooldown seems to also be an option, but for situations where no cooldown on spells is desired for fun, this wouldn't work. Implementation would be harder for people.

The reason I need to do this is because I'm making a spell which allows the caster to cast the spell again to do another effect (It's LeBlanc's Distortion :grin:). I plan to remove the ability and add the cancel ability, then the opposite when it ends. Triggering it like that seems the best option, unless anyone knows of an toggleable target-unit spells such as Immolation.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
But if you used Disable ability function, it would affect the Player, how to affect a Unit ?
I mean, the ability is disabled only for that unit (to keep MUI), else it would just be MPI.
Truth be told that if you disable an ability, it would hide it from UI and when we enable it back, it still retains the cooldown, problem is, it affects Player, not Unit.
I have been trying to find a solution to this.
 
Level 15
Joined
Jul 6, 2009
Messages
889
Immolation is an immediate order, not a target. Think of the ability I'm making as a Blink.

The posts so far are what I've expected; there isn't any feasible solution to this. I just wanted to hear some thoughts or any new ideas on it. Hmm, I think I may just trigger the cooldown so that my spellpack abides by the rules for the spell section.

P.S. Hoorah for 5 minute post intervals!
 
No you don't understand.
I mean this:

  • Test
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Issued order) Equal to (Order(immolation))
        • Then - Actions
          • Game - Display to (All players) the text: ON
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Issued order) Equal to (Order(unimmolation))
            • Then - Actions
              • Game - Display to (All players) the text: OFF
            • Else - Actions
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
And he meant this;
  • Unit - A unit Is issued an order targeting a point
There's no other toggle-able ability as to target a point, unlike Immolation, it requires no target (Instant).
Yes, Immolation can be toggled on/off but there is no other ability (Point target) could imitate the behavior of Immolation.
 
Level 15
Joined
Jul 6, 2009
Messages
889
The hero dashes to the target point dealing damage to things in an area around h target point. During the next few seconds the hero can return to the location before the dash by casting the spell again (replaced with an immediate/instant spell temporarily).

I wish to hide the the actual spell and add the ability that allows for returning. Adding the sub ability with a different hot key isn't the best way because the hero can have two instances of this spell in their command card, meaning that there won't be any free slots left (hero has 5 abilities).
 
Last edited:
Level 5
Joined
Jun 16, 2004
Messages
108
You can probably use channel in the way I detail in a post over at wc3c (http://www.wc3c.net/showpost.php?p=1029039&postcount=86)

It is an alternative to disabling the ability for the player, though it only works on channel as far as I am aware. Since channel is not capable of doing casts that do not interrupt orders, it is not as flexible as it could be, but for your case it might be fine.
 
Level 15
Joined
Jul 6, 2009
Messages
889
You can probably use channel in the way I detail in a post over at wc3c (http://www.wc3c.net/showpost.php?p=1029039&postcount=86)

It is an alternative to disabling the ability for the player, though it only works on channel as far as I am aware. Since channel is not capable of doing casts that do not interrupt orders, it is not as flexible as it could be, but for your case it might be fine.

This is interesting. I'll play around with it at a later date when I have time to. Thanks!

I think the available options for now have been covered. If anyone else has an alternative, I'd like to hear it. Thanks everyone.
 
Level 17
Joined
Feb 11, 2011
Messages
1,860
You can probably use channel in the way I detail in a post over at wc3c (http://www.wc3c.net/showpost.php?p=1029039&postcount=86)

It is an alternative to disabling the ability for the player, though it only works on channel as far as I am aware. Since channel is not capable of doing casts that do not interrupt orders, it is not as flexible as it could be, but for your case it might be fine.

I tried this and it works! Thanks for that, now I can use it :grin:
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Mr. Bean, I'd like to know how you did it, I tried to understand it, but failed to do so.
I have been searching for this solution for a long time, to hide ability temporarily and when unhide back, the cooldown is still retain in any way.
 
Level 17
Joined
Feb 11, 2011
Messages
1,860
JASS:
scope HideAbility initializer onInit

    globals
        private constant integer SPELL_ID       = 'A000'
    endglobals

    private function SpellActions takes nothing returns nothing
        call SetUnitAbilityLevel(GetTriggerUnit(), SPELL_ID, 999)
        call IncUnitAbilityLevel(GetTriggerUnit(), SPELL_ID)
    endfunction
    
    private function onInit takes nothing returns nothing
        call RegisterSpellEffectEvent(SPELL_ID, function SpellActions)
    endfunction
    
endscope
Doing this will hide the ability.

Example: The ability ('A000') has 4 levels. If you use GetUnitAbilityLevel after the spell is cast, it will return 5. I presume you set it back to 4 to show the ability again.

I only tested it with a unit ability (non-hero). It MUST also be based of Channel.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
So this method will replace Player Disable Ability, cool :)

Only 1 thing I wanna ask, why do you set it to 999 level and then increase the spell ability ?
Just set it to 999 makes sense, you don't need the Increase level function ?
 
Level 5
Joined
Jun 16, 2004
Messages
108
My post does state that you can achieve the same ability hiding effect without the max level+1 glitch:
I am aware, of course, that you can simply have a level of channel that is not visible by your own settings. The first method above seems like it'd be more convenient, as it can be used with the default hero ability leveling system without showing the hidden level.
Though it also states the motivation behind not doing so (using it as a hero ability).

Though the level max+1 idea for channel the spell does disappear from the hero learn menu while the channel ability is set to the max+1 level, which can be undesirable. The most flexible solution would probably use dummy hero abilities so that hidden abilities and the hero learn menu are truly separate, but that probably is the most work to do. Though if one were to dedicate one level of channel to toggling the "visible" flag off, there would need to be some additional triggering to make sure players cannot learn the ability up to the level that hides it.

All depends on how much work you want to put in, I suppose.

There is little benefit to be gained by using the glitch if it is not for a hero ability, though I suppose it can save you some time in the object editor.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
You can edit channel ability and set level 1 to invisible >.>
If we do this, let's say we have an ability that has overall 4 level.

What you said was, something like add 1 more level to that ability via Object Editor, so now that ability has 5 levels now, right ?

And at the 5th level, we make it Invisible so that whenever we set the ability to level 5, it will become invisible right ?

What do you think if you make the spell has 5 levels, the Player can learn that ability via red cross mark to Level 5, it would look weird ?

It should only learnable up until level 4, but since you made that method, Player can learn up until level 5, where 5th level is invisible.

So i think viable solution is max+1 method.
 
Level 15
Joined
Jul 6, 2009
Messages
889
Has anyone gotten it to be able to store the cooldown as well?

Seems it won't work on spell effect event. You'll need to do it after the event, so the first tick of some periodic timer or just a 0.00s timer. I guess that is what was meant by "The ability level must be changed after the ability is cast - after the cooldown already applies".
 
Status
Not open for further replies.
Top