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

[General] Learn Skill Menu ID

Status
Not open for further replies.
Hi.

I would like to know if the Learn Skill Menu has a id?
I need to hide this ability temporarily using the new natives, but I do not know if has a ID.

thanks for read.

I'm not sure if it has it's own raw code like attack ('Aatk' ) and move ('Amov' ). I couldn't find it. You can always simulate learning hero abilities through spellbooks, but it is tedious.

You can find some of the data here: theQuazz/wc3-devkit
 
Level 39
Joined
Feb 27, 2007
Messages
5,023
That button will disappear automatically while either of the following is true:
  • All learnable hero abilities for the hero are at max level and the hero doesn't have any extra skill points
  • The hero has no learnable abilities at all (generally the same case as above, unless the unit has no abilities in the editor)
You can abuse this to temporarily hide the the learn skill button by doing the following:
  1. Store the current level of all learned abilities of the hero.
  2. Store information about which abilities haven't been learned yet at all.
  3. Store the current number of unspent skill points.
  4. For every ability in step 1, set its level to the max possible level
  5. For every ability found in step 2 do the following
    • Increase the hero's number of unspent skill points by 1
    • Force the hero to learn the skill (Hero - Learn skill action)
    • Set its level to max level
    • Disable the ability for the hero (Unit - for <unit>, <ability>, Disable ability: true, Hide UI: true)
  6. Set the current number of unspent skill points for the hero to 0
  7. Wait until you want to show the button again; during this time all abilities will be at maximum level, which may be important for auras and tooltips
  8. For every ability found in step 2 (same as 5) do the following:
    • Remove the ability from the hero (it will still be learnable after this)
    • Enable the ability for the hero
  9. For every ability modified in step 4, set it back to its original level
  10. Set the hero's number of unspent skill points to the number stored in step 3
Not the greatest but it does work.
 
Level 8
Joined
Oct 4, 2016
Messages
208
I'm not sure if it has it's own raw code like attack ('Aatk' ) and move ('Amov' ). I couldn't find it. You can always simulate learning hero abilities through spellbooks, but it is tedious.

You can find some of the data here: theQuazz/wc3-devkit
Interesting link you provided, i will search in the whole page thanks.

That button will disappear automatically while either of the following is true:
  • All learnable hero abilities for the hero are at max level and the hero doesn't have any extra skill points
  • The hero has no learnable abilities at all (generally the same case as above, unless the unit has no abilities in the editor)
You can abuse this to temporarily hide the the learn skill button by doing the following:
  1. Store the current level of all learned abilities of the hero.
  2. Store information about which abilities haven't been learned yet at all.
  3. Store the current number of unspent skill points.
  4. For every ability in step 1, set its level to the max possible level
  5. For every ability found in step 2 do the following
    • Increase the hero's number of unspent skill points by 1
    • Force the hero to learn the skill (Hero - Learn skill action)
    • Set its level to max level
    • Disable the ability for the hero (Unit - for <unit>, <ability>, Disable ability: true, Hide UI: true)
  6. Set the current number of unspent skill points for the hero to 0
  7. Wait until you want to show the button again; during this time all abilities will be at maximum level, which may be important for auras and tooltips
  8. For every ability found in step 2 (same as 5) do the following:
    • Remove the ability from the hero (it will still be learnable after this)
    • Enable the ability for the hero
  9. For every ability modified in step 4, set it back to its original level
  10. Set the hero's number of unspent skill points to the number stored in step 3
Not the greatest but it does work.

Interesting solution, but its hard to deal with it, i think that this method messed up the Learn Skill event, if i working on set datas based on learned skills.

I wil do some experiments today, thanks.
 
Level 39
Joined
Feb 27, 2007
Messages
5,023
i think that this method messed up the Learn Skill event, if i working on set datas based on learned skills.
Use a boolean variable as a flag that you set before you force-level-up abilities, then check for that boolean in your learned skill triggers:

  • -------- Example --------
  • Set ForcedSkillFlag = true
  • Hero - Learn skill for Archmage 0001 <gen>: Summon Water Elemental
  • Set ForcedSkillFlag = false
  • Unit - Set level of Summon Water Elemental for Archmage 0001 <gen> to 3
  • Hero - Modify unspent skill points of Archmage 0001 <gen>: Set to 0 points
  • Unit - For Archmage 0001 <gen>, Ability Summon Water Elemental, Disable ability: True, Hide UI: True
  • Wait 2.00 seconds
  • Unit - For Archmage 0001 <gen>, Ability Summon Water Elemental, Disable ability: False, Hide UI: False
  • Unit - Remove Summon Water Elemental from Archmage 0001 <gen>
  • Hero - Modify unspent skill points of Archmage 0001 <gen>: Set to 3 points
  • -------- In your other trigger --------
  • Conditions
    • ForcedSkillFlag equal to false
Here's a testmap. Press escape to disable the hero abilities button on the Archmage for 2 seconds.
 

Attachments

  • teeest.w3x
    22.4 KB · Views: 55
Level 8
Joined
Oct 4, 2016
Messages
208
Use a boolean variable as a flag that you set before you force-level-up abilities, then check for that boolean in your learned skill triggers:

  • -------- Example --------
  • Set ForcedSkillFlag = true
  • Hero - Learn skill for Archmage 0001 <gen>: Summon Water Elemental
  • Set ForcedSkillFlag = false
  • Unit - Set level of Summon Water Elemental for Archmage 0001 <gen> to 3
  • Hero - Modify unspent skill points of Archmage 0001 <gen>: Set to 0 points
  • Unit - For Archmage 0001 <gen>, Ability Summon Water Elemental, Disable ability: True, Hide UI: True
  • Wait 2.00 seconds
  • Unit - For Archmage 0001 <gen>, Ability Summon Water Elemental, Disable ability: False, Hide UI: False
  • Unit - Remove Summon Water Elemental from Archmage 0001 <gen>
  • Hero - Modify unspent skill points of Archmage 0001 <gen>: Set to 3 points
  • -------- In your other trigger --------
  • Conditions
    • ForcedSkillFlag equal to false
Here's a testmap. Press escape to disable the hero abilities button on the Archmage for 2 seconds.

I understand, works perfectly, but has bad side effect, hide abilities.

I found a very useful trick now and apparently works neat.

With this thread:
Is there any way to hide/disable the hero "lear skill" icon?

I found the "Hero" ability here:
theQuazz/wc3-devkit

The "Hero" ability is the skill menu with id 'Aher'

and i disabled it with the new natives.
call BlzUnitDisableAbility(hero,'AHer',true,true)
call BlzUnitDisableAbility(hero,'AHer',false,false)

Result:
before
image1-png.305889

after
image2-png.305890


I do not notice any bug, unused skill points remain as before hiding the menu.
(The blue icon is a feature of my map)
 

Attachments

  • image1.png
    image1.png
    254 KB · Views: 225
  • image2.png
    image2.png
    237.6 KB · Views: 224
Status
Not open for further replies.
Top