• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Overcoming the 5 hero ability limitation

Level 12
Joined
Jul 5, 2014
Messages
551
I came up with the genius idea of having alternative choices for skills, allowing more versatility for the player. The only wrench in this genius idea is that the hero skill option can only hold 5 skills, so I can't put the options there directly.

My best solution would be setting up a dummy skill that opens up a dialog upon click that asks the player which of the 2 they want to pick. Then adding the skill of choice via trigger. Is there a more efficient way or this is my best bet?
 
Level 30
Joined
Aug 29, 2012
Messages
1,385
There is a trick, hit shift+enter on the ability list and you can input much more, you just need the raw code of your abilities

1721829173836.png
 
Level 29
Joined
Sep 26, 2009
Messages
2,596
There is a trick, hit shift+enter on the ability list and you can input much more, you just need the raw code of your abilities

View attachment 481103
Sadly, this does not work (at least on Reforged). You can input more hero abilities than the limit, however in World Editor and in game you will have access only to first 5 abilities in the list (in case of WE, I am talking about modifying hero ability level of preplaced units).
Even trying things like disabling the first four abilities in game does not help - the hero in question will then have access only to the fifth ability in the list.
 
Level 12
Joined
Jul 5, 2014
Messages
551
Sadly, this does not work (at least on Reforged). You can input more hero abilities than the limit, however in World Editor and in game you will have access only to first 5 abilities in the list (in case of WE, I am talking about modifying hero ability level of preplaced units).
Even trying things like disabling the first four abilities in game does not help - the hero in question will then have access only to the fifth ability in the list.
Yeah, I have classic warcraft and it's not working with that either. Any suggestions? Or should I stick to dummy abilities leading to dialog that asks which ones the player wants?
 
Level 29
Joined
Sep 26, 2009
Messages
2,596
You cannot add hero ability via trigger, as far as I know. Or to be more precise, you can add them via trigger, but it will add them like it does with normal abilities - it will be immediately learned level 1 ability and it will not appear in the 'Learn skill' submenu.

In theory, you could try to get rid of hero abilities altogether. Instead imitate the 'Learn skill' submenu using Spellbook and dummy abilities. Dummy abilities would only serve to show the description of the spell while learning it, and to detect which skill you selected.
Then via trigger detect when dummy skill has been clicked and add/level up the actual non-hero skill.
However compared to the default 'Learn skill' menu, in Spellbook you would not see the level of the ability as a number in lower-right corner of the ability's icon.

Edit: Also, since the dummy skills for detecting which spell to learn would still be actual skills, they would interfere with unit's current order
 
Level 12
Joined
Jul 5, 2014
Messages
551
You cannot add hero ability via trigger, as far as I know. Or to be more precise, you can add them via trigger, but it will add them like it does with normal abilities - it will be immediately learned level 1 ability and it will not appear in the 'Learn skill' submenu.

In theory, you could try to get rid of hero abilities altogether. Instead imitate the 'Learn skill' submenu using Spellbook and dummy abilities. Dummy abilities would only serve to show the description of the spell while learning it, and to detect which skill you selected.
Then via trigger detect when dummy skill has been clicked and add/level up the actual non-hero skill.
However compared to the default 'Learn skill' menu, in Spellbook you would not see the level of the ability as a number in lower-right corner of the ability's icon.

Edit: Also, since the dummy skills for detecting which spell to learn would still be actual skills, they would interfere with unit's current order
Ah, man, I really shot myself in the foot with that, it seems. That turned out even more complicated than I thought.
 
Hmm, I saw multiple skills option on the map Necris (frozen project) in cyrillic language, they used spellbook and in there they clicked the ability to learn it.
For example player clicks the red button to level up or learn ability and there are 11 spellbooks named "melee" "arcane" "fire" "ice" etc, inside of them there are variety of abilities with different requirements.
 
Level 12
Joined
Jul 5, 2014
Messages
551
Hmm, I saw multiple skills option on the map Necris (frozen project) in cyrillic language, they used spellbook and in there they clicked the ability to learn it.
For example player clicks the red button to level up or learn ability and there are 11 spellbooks named "melee" "arcane" "fire" "ice" etc, inside of them there are variety of abilities with different requirements.
I'm not sure how they would look like in action. These aren't seem to be hero abilities or if they are, I'm not sure about how it would properly make them learn the ability.
 
I'm not sure how they would look like in action. These aren't seem to be hero abilities or if they are, I'm not sure about how it would properly make them learn the ability.
Well they somehow did it, but you should try out the map to experience. Also I can suggest fantasy life but there abilities are fixed to the class system it has
 
Level 12
Joined
Nov 13, 2010
Messages
277
you need to make a shop with items that can be use with Engineering Upgrade and Spell Book then the hero can pick a aiblity from a shop learn it
  • Events
    • Unit - A unit Acquires an item
  • Conditions
    • (Owner of (Triggering unit)) Not equal to Neutral Passive
  • Actions
    • -------- --------
    • Set VariableSet Skill_Unit = (Triggering unit)
    • Set VariableSet Skill_Item_Acquired = (Item being manipulated)
    • Set VariableSet Skill_Item_Acquired_Type = (Item-type of Skill_Item_Acquired)
    • Set VariableSet Skill_Found_Slot = 0
    • -------- --------
    • For each (Integer Skill_Index) from 1 to Skill_Total_Amount, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Skill_Item_Acquired_Type Equal to Skill_Item_Type[Skill_Index]
          • Then - Actions
            • For each (Integer Skill_Inv_Slot) from 1 to 4, do (Actions)
              • Loop - Actions
                • Set VariableSet Skill_Item_Other = (Item carried by Skill_Unit in slot Skill_Inv_Slot)
                • -------- --------
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • Skill_Item_Acquired_Type Equal to (Item-type of Skill_Item_Other)
                    • Skill_Item_Acquired Not equal to Skill_Item_Other
                  • Then - Actions
                    • Set VariableSet Skill_Found_Slot = 0
                    • Game - Display to (Player group((Owner of Skill_Unit))) for 10.00 seconds the text: |cffff0000You canno...
                    • Player - Add Skill_Lumber_Cost[Skill_Index] to (Owner of Skill_Unit).Current lumber
                    • Item - Remove Skill_Item_Acquired
                    • Skip remaining actions
                  • Else - Actions
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • Skill_Item_Acquired Equal to Skill_Item_Other
                        • Skill_Found_Slot Equal to 0
                      • Then - Actions
                        • Set VariableSet Skill_Found_Slot = Skill_Inv_Slot
                        • Set VariableSet Skill_Found_Index = Skill_Index
                      • Else - Actions
          • Else - Actions
    • -------- --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Skill_Found_Slot Greater than 0
      • Then - Actions
        • Unit - Add Skill_Abil_Spellbook[Skill_Found_Index] to Skill_Unit
        • Unit - Set level of Skill_Abil_Engineering[Skill_Found_Index] for Skill_Unit to Skill_Found_Slot
        • Player - Disable Skill_Abil_Spellbook[Skill_Found_Index] for (Owner of Skill_Unit)
      • Else - Actions
  • Events
    • Time - Elapsed game time is 0.00 seconds
  • Conditions
  • Actions
    • -------- Set this to the total number of skills: --------
    • Set VariableSet Skill_Total_Amount = what ever u need !!
    • -------- --------
    • -------- First skill: --------
    • Set VariableSet Skill_Item_Type[1] = Dash
    • Set VariableSet Skill_Abil_Engineering[1] = Dash - Engineering
    • Set VariableSet Skill_Abil_Spellbook[1] = Dash - Spell Book
    • Set VariableSet Skill_Lumber_Cost[1] = 1
    • -------- --------
    • -------- Second skill: --------
    • Set VariableSet Skill_Item_Type[2] = Battle Roar
    • Set VariableSet Skill_Abil_Engineering[2] = Battle Roar - Engineering
    • Set VariableSet Skill_Abil_Spellbook[2] = Battle Roar - Spell Book
    • Set VariableSet Skill_Lumber_Cost[2] = 1
    • -------- --------
    • -------- Third skill: --------
    • Set VariableSet Skill_Item_Type[3] = Book of Teleportation
    • Set VariableSet Skill_Abil_Engineering[3] = Book of Teleportation - Engineering
    • Set VariableSet Skill_Abil_Spellbook[3] = Book of Teleportation - Spell Book
    • Set VariableSet Skill_Lumber_Cost[3] = 1
    • -------- --------

and now you need when he is done picking to remove the items that give him the abilitys and the number of caried items and move the hero etc

but evey with this you cant get pass 5 but i have not test it
 
Level 12
Joined
Jul 5, 2014
Messages
551
you need to make a shop with items that can be use with Engineering Upgrade and Spell Book then the hero can pick a aiblity from a shop learn it
  • Events
    • Unit - A unit Acquires an item
  • Conditions
    • (Owner of (Triggering unit)) Not equal to Neutral Passive
  • Actions
    • -------- --------
    • Set VariableSet Skill_Unit = (Triggering unit)
    • Set VariableSet Skill_Item_Acquired = (Item being manipulated)
    • Set VariableSet Skill_Item_Acquired_Type = (Item-type of Skill_Item_Acquired)
    • Set VariableSet Skill_Found_Slot = 0
    • -------- --------
    • For each (Integer Skill_Index) from 1 to Skill_Total_Amount, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Skill_Item_Acquired_Type Equal to Skill_Item_Type[Skill_Index]
          • Then - Actions
            • For each (Integer Skill_Inv_Slot) from 1 to 4, do (Actions)
              • Loop - Actions
                • Set VariableSet Skill_Item_Other = (Item carried by Skill_Unit in slot Skill_Inv_Slot)
                • -------- --------
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • Skill_Item_Acquired_Type Equal to (Item-type of Skill_Item_Other)
                    • Skill_Item_Acquired Not equal to Skill_Item_Other
                  • Then - Actions
                    • Set VariableSet Skill_Found_Slot = 0
                    • Game - Display to (Player group((Owner of Skill_Unit))) for 10.00 seconds the text: |cffff0000You canno...
                    • Player - Add Skill_Lumber_Cost[Skill_Index] to (Owner of Skill_Unit).Current lumber
                    • Item - Remove Skill_Item_Acquired
                    • Skip remaining actions
                  • Else - Actions
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • Skill_Item_Acquired Equal to Skill_Item_Other
                        • Skill_Found_Slot Equal to 0
                      • Then - Actions
                        • Set VariableSet Skill_Found_Slot = Skill_Inv_Slot
                        • Set VariableSet Skill_Found_Index = Skill_Index
                      • Else - Actions
          • Else - Actions
    • -------- --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Skill_Found_Slot Greater than 0
      • Then - Actions
        • Unit - Add Skill_Abil_Spellbook[Skill_Found_Index] to Skill_Unit
        • Unit - Set level of Skill_Abil_Engineering[Skill_Found_Index] for Skill_Unit to Skill_Found_Slot
        • Player - Disable Skill_Abil_Spellbook[Skill_Found_Index] for (Owner of Skill_Unit)
      • Else - Actions
  • Events
    • Time - Elapsed game time is 0.00 seconds
  • Conditions
  • Actions
    • -------- Set this to the total number of skills: --------
    • Set VariableSet Skill_Total_Amount = what ever u need !!
    • -------- --------
    • -------- First skill: --------
    • Set VariableSet Skill_Item_Type[1] = Dash
    • Set VariableSet Skill_Abil_Engineering[1] = Dash - Engineering
    • Set VariableSet Skill_Abil_Spellbook[1] = Dash - Spell Book
    • Set VariableSet Skill_Lumber_Cost[1] = 1
    • -------- --------
    • -------- Second skill: --------
    • Set VariableSet Skill_Item_Type[2] = Battle Roar
    • Set VariableSet Skill_Abil_Engineering[2] = Battle Roar - Engineering
    • Set VariableSet Skill_Abil_Spellbook[2] = Battle Roar - Spell Book
    • Set VariableSet Skill_Lumber_Cost[2] = 1
    • -------- --------
    • -------- Third skill: --------
    • Set VariableSet Skill_Item_Type[3] = Book of Teleportation
    • Set VariableSet Skill_Abil_Engineering[3] = Book of Teleportation - Engineering
    • Set VariableSet Skill_Abil_Spellbook[3] = Book of Teleportation - Spell Book
    • Set VariableSet Skill_Lumber_Cost[3] = 1
    • -------- --------

and now you need when he is done picking to remove the items that give him the abilitys and the number of caried items and move the hero etc

but evey with this you cant get pass 5 but i have not test it
That looks rather complicated for something that may or may not work.
 
Level 12
Joined
Nov 13, 2010
Messages
277
Learn it as you can upgrade it from skill points? My goal is not to really exceed the 5 ability, only to have 8 ability option from which the player could choose 4.
yes he will to be able to level it from skill points

you can try download my map call Mystical Survival V1.3 you cant open it but you can test it out in single player and see for yourself
 
Level 12
Joined
Nov 13, 2010
Messages
277
It doesn't even show up on the list of maps.
 
Level 12
Joined
Jul 5, 2014
Messages
551
I meant the list of in-game maps. I placed it inside and when I opened the game I didn't see it.
 
Level 12
Joined
Jul 5, 2014
Messages
551
heem the map is a w3x-fil normal you can play that in both and w3m-fil is for reforged but i can be worng.

so i open it op and made ss for you
I see. I found something similar here:

 
Level 12
Joined
Jul 5, 2014
Messages
551
it seams more complicated then what i got
How is that more complicated?

  • get Holy Light
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Glyph of Purification
    • Actions
      • Item - Remove (Item being manipulated)
      • Unit - Add Give Holy Light to (Triggering unit)
      • Unit - Remove Give Holy Light from (Triggering unit)
 
Level 12
Joined
Nov 13, 2010
Messages
277
How is that more complicated?

  • get Holy Light
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Glyph of Purification
    • Actions
      • Item - Remove (Item being manipulated)
      • Unit - Add Give Holy Light to (Triggering unit)
      • Unit - Remove Give Holy Light from (Triggering unit)
i was looking ad Spell Menu System 1.2c
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
The sky is the limit if you don't want to rely on the Hero Skill Menu. Of course, you can still rely on Hero Skill Points as a visual indicator, these can be modified via triggers.

When limited to 1.26, I would probably try something like this:

1) Import a custom CommandFunc.txt file to hide unwanted buttons from the command card. I'm pretty sure you can still use the Hotkeys even when the ability is hidden. This gives us more room on a Hero's command card. (May not work on older versions?)

2) Have an "Open Menu" ability on the hero, which once activated, disables all of their "active" abilities (hiding them from the command card) and enables all of their respective "learn" abilities (which would have been added but disabled by default) - assuming that the "active" isn't at max level yet.

3) You can then manage these learn abilities via triggers:
  • Learn Bash
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Learn Bash
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unspent skill points of (Triggering unit)) Greater than 0
        • Then - Actions
          • Hero - Modify unspent skill points of (Triggering unit): Subtract 1 points
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Bash for (Triggering unit)) Equal to 0
            • Then - Actions
              • Unit - Add Bash to (Triggering unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Bash for (Triggering unit)) Less than 5
                • Then - Actions
                  • Unit - Increase level of Bash for (Triggering unit)
                • Else - Actions
                  • -------- Reached max level, prevent it from being learned again --------
                  • Unit - Increase level of Bash for (Triggering unit)
                  • Player - Disable Learn Bash for (Owner of (Triggering unit))
        • Else - Actions
          • -------- ERROR - Not enough skill points! --------
      • Unit - Order (Triggering unit) to Stop.
4) Activate the "Open Menu" ability again to undo this process, enabling "active" abilities and disabling "learn" abilities.

Of course you could turn this into a system by using Array variables. That would be nice for automating the whole process and keeping things organized. You could also move all of this off to another Unit if you wanted the Hero to remain fully functional while picking a skill to learn, plus it would avoid the need for hiding command buttons.

This is just my approach, do whatever feels best to you.
 
Last edited:
Level 12
Joined
Jul 5, 2014
Messages
551
The sky is the limit if you don't want to rely on the Hero Skill Menu. Of course, you can still rely on Hero Skill Points as a visual indicator, these can be modified via triggers.

When limited to 1.26, I would probably try something like this:

1) Import a custom CommandFunc.txt file to hide unwanted buttons from the command card. I'm pretty sure you can still use the Hotkeys even when the ability is hidden. This gives us more room on a Hero's command card. (May not work on older versions?)

2) Have an "Open Menu" ability on the hero, which once activated, disables all of their "active" abilities (hiding them from the command card) and enables all of their respective "learn" abilities (which would have been added but disabled by default) - assuming that the "active" isn't at max level yet.

3) You can then manage these learn abilities via triggers:
  • Learn Bash
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Learn Bash
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unspent skill points of (Triggering unit)) Greater than 0
        • Then - Actions
          • Hero - Modify unspent skill points of (Triggering unit): Subtract 1 points
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Bash for (Triggering unit)) Equal to 0
            • Then - Actions
              • Unit - Add Bash to (Triggering unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Bash for (Triggering unit)) Less than 5
                • Then - Actions
                  • Unit - Increase level of Bash for (Triggering unit)
                • Else - Actions
                  • -------- Reached max level, prevent it from being learned again --------
                  • Unit - Increase level of Bash for (Triggering unit)
                  • Player - Disable Learn Bash for (Owner of (Triggering unit))
        • Else - Actions
          • -------- ERROR - Not enough skill points! --------
      • Unit - Order (Triggering unit) to Stop.
4) Activate the "Open Menu" ability again to undo this process, enabling "active" abilities and disabling "learn" abilities.

Of course you could turn this into a system by using Array variables. That would be nice for automating the whole process and keeping things organized. You could also move all of this off to another Unit if you wanted the Hero to remain fully functional while picking a skill to learn, plus it would avoid the need for hiding command buttons.

This is just my approach, do whatever feels best to you.
I found this system that's fairly simple and works with items. However, I struggle to make it more elegant. I wanted it to open a dialog of choice between two skills upon learning a dummy skill but it don't seem to like it.
 

Attachments

  • AddHeroSkills.w3x
    17.8 KB · Views: 1

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
I see, Engineering Upgrade has some neat tricks. They actually broke it in ~1.31 so this solution isn't usable anymore but it seems like a good choice for you.

Anyway, you can change the Events to anything you want, it's only these 2 Actions that matter for adding the abilities:
  • Actions
    • Unit - Add Give Critical Strike to (Triggering unit)
    • Unit - Remove Give Critical Strike from (Triggering unit)
Here's a dialog example for the Paladin. When he levels up the menu will appear and offer him a choice between two abilities:
  • Paladin Dialog Show
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Triggering unit) Equal to Paladin 0000 <gen>
    • Actions
      • Dialog - Clear Pal_Skill_Dialog
      • -------- --------
      • Set Pal_Skill_Ability[1] = Give Critical Strike
      • Set Pal_Skill_Ability[2] = Give Mana Shield
      • Set Pal_Skill_Ability_Real[1] = Critical Strike
      • Set Pal_Skill_Ability_Real[2] = Mana Shield
      • -------- --------
      • For each (Integer Dialog_Loop) from 1 to 2, do (Actions)
        • Loop - Actions
          • Dialog - Create a dialog button for Pal_Skill_Dialog labelled (Name of Pal_Skill_Ability[Dialog_Loop])
          • Set Pal_Skill_Dialog_Button[Dialog_Loop] = (Last created dialog Button)
      • -------- --------
      • Dialog - Show Pal_Skill_Dialog for (Owner of (Triggering unit))
Upon clicking one of the buttons, the Paladin will either learn the ability or increase it's level by 1:
  • Paladin Dialog Click
    • Events
      • Dialog - A dialog button is clicked for Pal_Skill_Dialog
    • Conditions
    • Actions
      • For each (Integer Dialog_Loop) from 1 to 2, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to Pal_Skill_Dialog_Button[Dialog_Loop]
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Pal_Skill_Ability_Real[Dialog_Loop] for Paladin 0000 <gen>) Equal to 0
                • Then - Actions
                  • Unit - Add Pal_Skill_Ability[Dialog_Loop] to Paladin 0000 <gen>
                  • Unit - Remove Pal_Skill_Ability[Dialog_Loop] from Paladin 0000 <gen>
                • Else - Actions
                  • Unit - Increase level of Pal_Skill_Ability_Real[Dialog_Loop] for Paladin 0000 <gen>
            • Else - Actions
1721863807602.png

This doesn't account for max level cap, but that's an easy addition.

You can also scrap this "increase level" Action if you don't want the Dialog to increase existing ability levels:
  • Else - Actions
    • Unit - Increase level of Pal_Skill_Ability_Real[Dialog_Loop] for Paladin 0000 <gen>
But if it's a one-time "learn new ability" sort of thing then it's even more simple, you can get rid of the Ability_Real variable and do this:
  • Paladin Dialog Click
    • Events
      • Dialog - A dialog button is clicked for Pal_Skill_Dialog
    • Conditions
    • Actions
      • For each (Integer Dialog_Loop) from 1 to 2, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to Pal_Skill_Dialog_Button[Dialog_Loop]
            • Then - Actions
              • Unit - Add Pal_Skill_Ability[Dialog_Loop] to Paladin 0000 <gen>
              • Unit - Remove Pal_Skill_Ability[Dialog_Loop] from Paladin 0000 <gen>
            • Else - Actions
 
Last edited:
Level 12
Joined
Jul 5, 2014
Messages
551
I see, Engineering Upgrade has some neat tricks. They actually broke it in ~1.31 so this solution isn't usable anymore but it seems like a good choice for you.

Anyway, you can change the Events to anything you want, it's only these 2 Actions that matter for adding the abilities:
  • Actions
    • Unit - Add Give Critical Strike to (Triggering unit)
    • Unit - Remove Give Critical Strike from (Triggering unit)
Here's a dialog example for the Paladin. When he levels up the menu will appear and offer him a choice between two abilities:
  • Paladin Dialog Show
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Triggering unit) Equal to Paladin 0000 <gen>
    • Actions
      • Dialog - Show Pal_Skill_Dialog for (Owner of (Triggering unit))
      • Dialog - Clear Pal_Skill_Dialog
      • -------- --------
      • Set Pal_Skill_Ability[1] = Give Critical Strike
      • Set Pal_Skill_Ability[2] = Give Mana Shield
      • Set Pal_Skill_Ability_Real[1] = Critical Strike
      • Set Pal_Skill_Ability_Real[2] = Mana Shield
      • -------- --------
      • For each (Integer Dialog_Loop) from 1 to 2, do (Actions)
        • Loop - Actions
          • Dialog - Create a dialog button for Pal_Skill_Dialog labelled (Name of Pal_Skill_Ability[Dialog_Loop])
          • Set Pal_Skill_Dialog_Button[Dialog_Loop] = (Last created dialog Button)
Upon clicking one of the buttons, the Paladin will either learn the ability or increase it's level by 1:
  • Paladin Dialog Click
    • Events
      • Dialog - A dialog button is clicked for Pal_Skill_Dialog
    • Conditions
    • Actions
      • For each (Integer Dialog_Loop) from 1 to 2, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to Pal_Skill_Dialog_Button[Dialog_Loop]
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Pal_Skill_Ability_Real[Dialog_Loop] for Paladin 0000 <gen>) Equal to 0
                • Then - Actions
                  • Unit - Add Pal_Skill_Ability[Dialog_Loop] to Paladin 0000 <gen>
                  • Unit - Remove Pal_Skill_Ability[Dialog_Loop] from Paladin 0000 <gen>
                • Else - Actions
                  • Unit - Increase level of Pal_Skill_Ability_Real[Dialog_Loop] for Paladin 0000 <gen>
            • Else - Actions
View attachment 481219

This doesn't account for max level cap, but that's an easy addition.
I did change the event. This is what I did:

  • Choice
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learning Hero) Equal to Hero
    • Actions
      • Trigger - Turn off (This trigger)
      • Dialog - Change the title of Dialog1 to Which one you pick?
      • Dialog - Create a dialog button for Dialog1 labelled Haemorrhage
      • Set Yes = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog1 labelled Shield Bash
      • Set No = (Last created dialog Button)
      • Dialog - Show Dialog1 for Player 2 (Blue)
  • Choice Copy
    • Events
      • Dialog - A dialog button is clicked for Dialog1
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Yes
        • Then - Actions
          • Unit - Add Add Haemorrhage to Hero
          • Unit - Remove Add Haemorrhage from Hero
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to No
            • Then - Actions
              • Unit - Add Add Shield Bash to Hero
              • Unit - Remove Add Shield Bash from Hero
            • Else - Actions
              • Do nothing
That however, resulted weird outcomes. It added Shield Bash but not Haemorrhage. When I tried with Siphon Mana, it turned it into some Channel-like, no target ability that didn't work. Ideally, this should change the dummy ability into the choice of ability upon learning but I'm not sure what's wrong.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
Yes. With the item solution, all of them worked fine. But when I set the event to learning the skill, that's when it turned weird.
Well, it worked fine for me using my above triggers (I updated the post since you last replied). Which was actually unexpected, I guess the bug is fixed or maybe I was thinking of a different bug.

Did you just rename those abilities or are they new? Because all of the Object Editor data must be setup properly.
 
Level 12
Joined
Jul 5, 2014
Messages
551
Well, it worked fine for me using my above triggers (I updated the post since you last replied).

Did you just rename those abilities or are they new? Because all of the Object Editor data must be setup properly.
They're custom abilities. But I don't get why it bugs out when I activate or learn manually the dummy ability and with that, triggering the choice.

The goal should be to decide which one the player wants upon learning. After that, it would level up normally, no need to using trigger for more levels.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
They're custom abilities. But I don't get why it bugs out when I activate or learn manually the dummy ability and with that, triggering the choice.

The goal should be to decide which one the player wants upon learning. After that, it would level up normally, no need to using trigger for more levels.
Can you send me what you have? I can open older maps, you just can't open mine.

It really sounds like an Object Editor issue since your trigger is adding/removing the abilities properly.

Also, my post shows how to handle a "just for initial learning" setup at the bottom.
 
Level 12
Joined
Jul 5, 2014
Messages
551
Can you send me what you have? I can open older maps, you just can't open mine.

It really sounds like an Object Editor issue since your trigger is adding/removing the abilities properly.

Also, my post shows how to handle a "just for initial learning" setup at the bottom.
I made a test map instead, I don't want to put here my work in progress. The same thing happens when I tie the event to the "learn skill".
 

Attachments

  • choice test.w3x
    18.6 KB · Views: 1

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
Okay, so you're changing the way it's supposed to work. The PLACEHOLDER abilities are meant to be hidden and you replace them with the Real abilities by adding/removing the Spellbooks. The PLACEHOLDER ability is not meant to be learned, seen, or interacted with in any way by the user.

Here's one setup that may work for you. I gave the Paladin a normal unit ability called Open Skill Menu which brings up the Dialog:
  • Dialog Open
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Open Skill Menu
    • Actions
      • Unit - Order (Triggering unit) to Stop.
      • Dialog - Clear Dialog1
      • Dialog - Change the title of Dialog1 to Which one you pick?
      • Dialog - Create a dialog button for Dialog1 labelled Siphon Mana
      • Set VariableSet Yes = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog1 labelled Defend
      • Set VariableSet No = (Last created dialog Button)
      • Dialog - Show Dialog1 for Player 1 (Red)
  • Dialog Click
    • Events
      • Dialog - A dialog button is clicked for Dialog1
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Yes
        • Then - Actions
          • Unit - Add Unlock Siphon Mana to Paladin 0000 <gen>
          • Unit - Remove Unlock Siphon Mana from Paladin 0000 <gen>
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to No
            • Then - Actions
              • Unit - Add Unlock Defend to Paladin 0000 <gen>
              • Unit - Remove Unlock Defend from Paladin 0000 <gen>
            • Else - Actions
The Object Editor data is pretty much identical to what the original map used with the addition of my new Open ability:
1721868528716.png
1721868560697.png

Note that I had to change the Art - Button positions of my (Placeholder) abilities to make them hidden:
1721868731052.png

I don't know why I needed to do this when it was unnecessary in the original map... Weird mechanics at work here.

Oh and remember that the Channel ability has some weird functionality to begin with. You should almost always set "Disable Other Abilities" to False, otherwise it will Pause the caster and cause all sorts of weird side effects.
 
Last edited:
Level 12
Joined
Jul 5, 2014
Messages
551
Okay, so you're changing the way it's supposed to work. The PLACEHOLDER abilities are meant to be hidden and you replace them with the Real abilities by adding/removing the Spellbooks. The PLACEHOLDER ability is not meant to be learned, seen, or interacted with in any way by the user.

Here's one setup that may work for you. I gave the Paladin a normal unit ability called Open Skill Menu which brings up the Dialog:
  • Dialog Open
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Open Skill Menu
    • Actions
      • Unit - Order (Triggering unit) to Stop.
      • Dialog - Clear Dialog1
      • Dialog - Change the title of Dialog1 to Which one you pick?
      • Dialog - Create a dialog button for Dialog1 labelled Siphon Mana
      • Set VariableSet Yes = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog1 labelled Defend
      • Set VariableSet No = (Last created dialog Button)
      • Dialog - Show Dialog1 for Player 1 (Red)
  • Dialog Click
    • Events
      • Dialog - A dialog button is clicked for Dialog1
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Yes
        • Then - Actions
          • Unit - Add Unlock Siphon Mana to Paladin 0000 <gen>
          • Unit - Remove Unlock Siphon Mana from Paladin 0000 <gen>
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to No
            • Then - Actions
              • Unit - Add Unlock Defend to Paladin 0000 <gen>
              • Unit - Remove Unlock Defend from Paladin 0000 <gen>
            • Else - Actions
The Object Editor data is pretty much identical to what the original map used with the addition of my new Open ability:
View attachment 481225View attachment 481226
Note that I had to change the Art - Button positions of my (Placeholder) abilities to make them hidden:
View attachment 481227
I don't know why I needed to do this when it was unnecessary in the original map... Weird mechanics at work here.

Oh and remember that the Channel ability has some weird functionality to begin with. You should almost always set "Disable Other Abilities" to False, otherwise it will Pause the caster and cause all sorts of weird side effects.
I know the placeholder meant to be replaced but I don't understand why it's a problem to interact with it. They're supposed to be replaced anyway and under normal circumstances the Goblin Tinker's abilities are being used before being replaced by their upgrades. So why does it make a difference whether they are visible or being interacted with?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
I know the placeholder meant to be replaced but I don't understand why it's a problem to interact with it. They're supposed to be replaced anyway and under normal circumstances the Goblin Tinker's abilities are being used before being replaced by their upgrades. So why does it make a difference whether they are visible or being interacted with?
I don't know, the fact that this works in the first place is witchcraft. Why would adding and then removing an ability cause ONE of the four Placeholder abilities to suddenly get replaced with a different ability, permanently. We're exploiting unintended mechanics here.

But you can try to mess with it some more, I believe the Stop order I introduced in the first trigger may help with some of your previous issues, since you were Pausing the Hero with Channel.

This solution doesn't even bypass the 5 Hero Ability limit as far as I understand. Although, I suppose it allows for more than 5 choices, but you're still limited to 5 in total.
 
Last edited:
Level 12
Joined
Jul 5, 2014
Messages
551
I don't know, the fact that this works in the first place is witchcraft. Why would adding and then removing an ability cause ONE of the four Placeholder abilities to suddenly get replaced with a different ability, permanently. We're exploiting unintended mechanics here.

You can try to mess with it some more, I believe the Stop order I introduced in the first trigger may help with some of your previous issues.
Unfortunately, I cannot use "open skill menu" ability. My hero has every slots occupied (4 skills and 2 special abilities). That's why I tried to use the placeholder for some efficiency. But if a level 67 moderator doesn't know what's this, I really don't have high hopes solving the issue.
 
Top