• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

[General] Displaying ability level in a different ability tooltip

Status
Not open for further replies.

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
This works:
  • Update Tooltip
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Learned Hero Skill) Equal to Divine Shield
          • (Learned Hero Skill) Equal to Holy Light
    • Actions
      • Set VariableSet HolyLight_Level = (Level of Holy Light for (Triggering unit))
      • Set VariableSet DivineShield_Level = (Level of Divine Shield for (Triggering unit))
      • -------- --------
      • Set VariableSet HolyLight_String_1 = (Restores + ((String((200 x HolyLight_Level))) + Hit Points plus an additional 100 per level of Divine Shield.))
      • Set VariableSet HolyLight_String_2 = (|n|cff80ff80Heal Amount: |r + (String(((200 x HolyLight_Level) + (100 x DivineShield_Level)))))
      • Set VariableSet HolyLight_String_3 = (|n|cff80ff80Divine Shield Level: |r + (String(DivineShield_Level)))
      • -------- --------
      • -------- Update the extended tooltip (this applies universally): --------
      • Ability - Set Extended Tooltip of Holy Light to (HolyLight_String_1 + (HolyLight_String_2 + HolyLight_String_3)) for level (HolyLight_Level - 1)
I'm updating the Extended Tooltip which is the description of the ability outside of the Hero Skill Menu. You need to subtract 1 from the Level when updating these Ability fields due to an odd/lazy choice by the Blizzard devs (0 = 1, 1 = 2, 2 = 3, etc).
 

Attachments

  • Tooltip Example 1.w3m
    17.1 KB · Views: 4
Level 4
Joined
Feb 2, 2023
Messages
28
I am currently using this command
Ability - Set Ability: (Unit: Tester's Ability with Ability Code: Display Grunt )'s String Level Field: Tooltip - Normal - Extended ('aub1') of Level: 0 to Test Text.

It is the exact same trigger I used on another unit and it works just fine on that one, but when trying to change the dialogue of another skill it's not having any effect in game, even with that as the only trigger I run to test. Is there any obscure thing that would prevent an ability from accepting new tooltips? The one it was working on is based on Berserk, the new ability is based on Channel.
 
Is there any obscure thing that would prevent an ability from accepting new tooltips?
I've started only updating level 0, and clearing out (having completely empty text) on all levels except for level 0.
I've had the feeling that it works more often, but I haven't really understood when it was required etc.
 

Remixer

Map Reviewer
Level 31
Joined
Feb 19, 2011
Messages
1,957
Is there any obscure thing that would prevent an ability from accepting new tooltips? The one it was working on is based on Berserk, the new ability is based on Channel.
Hi. I just tested the function with both Berserk and Channel and it works - so it has something to do with how you executed the function. Did you for example remember to change the ability code integer in the code line?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
When manipulating an individual Unit's specific ability you often run into issues where it either doesn't work at all (unfinished) or you need to "refresh" the ability:
  • Unit - Increase level of X ability for YourUnit
  • Unit - Decrease level of X ability for YourUnit
Decreasing the level may not be necessary. If there's a Buff like from an Aura you may even need to Disable/Enable the ability and possibly Remove the buff.

If you search around the forums you'll find plenty of threads on this topic which discuess what does and doesn't work.

Also, my above example can possibly be made MPI by using GetLocalPlayer() so the changes only apply to a specific Player. That may cause a desync though so be warned of that.
 
Level 4
Joined
Feb 2, 2023
Messages
28
Thx guys I got it working, wasn't able to get it working with set level field, no matter what i did, enable/disable, remove/add ability, so I ended up just changing the base ability tooltip, less then ideal for me, but much less frustrating, regardless, I appreciate the help.
 

Remixer

Map Reviewer
Level 31
Joined
Feb 19, 2011
Messages
1,957
Thx guys I got it working, wasn't able to get it working with set level field, no matter what i did, enable/disable, remove/add ability, so I ended up just changing the base ability tooltip, less then ideal for me, but much less frustrating, regardless, I appreciate the help.
You could also post your whole triggers here so we can check them out. In the editor you can just select "copy as text" and paste them here using the "Warcraft 3 Trigger" option - or alternatively you can just take screenshots of your triggers.
 
Level 4
Joined
Feb 2, 2023
Messages
28
If I had thought the issue was in the trigger I would have, but like I said, it wasn't working with that as the only running function, where in a different trigger it worked fine, so likely not an issue in the trigger. It ended up being the ability having multiple levels was an issue for some reason.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
If I had thought the issue was in the trigger I would have, but like I said, it wasn't working with that as the only running function, where in a different trigger it worked fine, so likely not an issue in the trigger. It ended up being the ability having multiple levels was an issue for some reason.
We might be able to tell you that reason if you post your triggers. But no worries if you don't want to, ain't gonna force you.
 
Status
Not open for further replies.
Top