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

How can I swap Hero abilities?

Status
Not open for further replies.
I would like to swap a Hero ability for another one when it turns night. I have a trigger that removes and adds abilities, but it only removes and adds the ability, not the one that you can learn, and that makes you able to have both abilities at once:
  • D and WS D to N
    • Events
      • Game - The in-game time of day becomes Greater than 18.00
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Werewolf
            • Then - Actions
              • Game Cache - Store (Level of Dodge for (Picked unit)) as DodgeAbility of Werewolf in GameCache
              • Unit - Remove Dodge from (Picked unit)
              • Unit - Add Weak Spot to (Picked unit)
              • Unit - Set level of Weak Spot for (Picked unit) to (Load WeakSpotAbility of Werewolf from GameCache)
            • Else - Actions
and
  • D and WS N to D
    • Events
      • Game - The in-game time of day becomes Less than 18.00
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Werewolf
            • Then - Actions
              • Game Cache - Store (Level of Weak Spot for (Picked unit)) as WeakSpotAbility of Werewolf in GameCache
              • Unit - Remove Weak Spot from (Picked unit)
              • Unit - Add Dodge to (Picked unit)
              • Unit - Set level of Dodge for (Picked unit) to (Load DodgeAbility of Werewolf from GameCache)
            • Else - Actions

+rep will be given!
 
Level 13
Joined
Nov 4, 2006
Messages
1,239
why don't you just change the hero, just save its current ability levels and experience maybe in variables or game cache (don't know which one is easier) and swap the units, then learn all the abilities he had before, and set the level of the changing ability to the level the other one was before, might be a lot of work if you use it for more then one unit
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
Its imossiable via that method. If you add a hero ability to a hero it can not level it up and thus it has its own problem. However you can disable the hero ability and add a dummy to look graphically the same. Infact using that method you could give the hero both abilities and simply switch between the 2 while handeling their levels with another trigger which should produce the wanted affect.
 
So that the Ability I'm leveling up would be elveling both abilities at the same rate? That the ability would have to be something like: "Dodge (Day) / Weak Spot (Night)"?
And another trigger to manioulate the level of the dummy ability? Am I getting theis right? If I am, that's not how it's done in Enfo's, but it's fully usable, thanks! :D
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
use the... the... the... enginering update or whatever it is
or DSG's idea is good
give both abilities
when hero levels one set others level to its level
enable-disable them with trigger
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
make 2 "engineering update"s (unit ability)
make one change your ability to second
and other one change second to first
when its day add and remove first
when its night add and remove second

I think things in DotA work like that
 
Ok, to be honest, I don't understand shit... I've never used the Engineering Upgrade before. But my guess is: I would have to make one ability version for each level of both abilities..? but how am I going to add 6 hero abilities..? and which ability is to be a Hero one, here..? (Sorry, can't give you rep, it says: "You have to spread som rep around before giving it to Need_O2 again. :'( )


EDIT: I got it partfully to work. I used the Engineer Upgrade ability to change the abilities. Visually it worked perfectly: It showed the Weak Spot ability instead of the Dodge ability both in Research and where you can cast it, with correct levels, too. The only thing is: Dodge gives evasion and Weak Spot gives Crit. When it changed to Weak Spot, it didn't give crit chance, but 100%evasion chance..? What could cause this..?
The trigger:
  • Dodge and WS D to N
    • Events
      • Game - The in-game time of day becomes Greater than 18.00
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Werewolf
            • Then - Actions
              • Unit - Add Upgrade to Weak Spot to (Picked unit)
              • Unit - Remove Upgrade to Weak Spot from (Picked unit)
            • Else - Actions
 
Last edited:
Atleast I can level your Pokemon ^^ :p

Change.JPG

Is it right..?
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
Im not sure..
is it how its done at tinker ?
if its then I have no idea

try making evasion and weak spot based on something else
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
The engeneering upgrade does not let you change abilities if I remember. It only lets you change the icon or stats of that ability with a new one. Changing the ability results in the icon upating but the stats not as it is not the same ability, thus it bugs.

Method 3.
Have 3 abilities.
1 - The learn
2 - The night one
3 - The day one

As the learn levels up, you level up the day / night ones.
The day / night ones are controled via a trigger that enables and disables them depending on time of day.
 
I just figured it out, I think. If I use an ability that can give both evasion and critical strike, like Combat Mastery in Enfo's. Then if it uses the same ability, it should not bug, right..?
Else, if that doesn't work, I'll use your method, Dr. Super Good! ^^


Thanks alot, folks! It worked now, I just had to use two versions of one ability, instead of two completely different ones. I'll rep if I can ^^
 
Last edited:
Status
Not open for further replies.
Top