• 🏆 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 to access blank tooltip field? PLEASE HELP

Level 7
Joined
Sep 16, 2016
Messages
185
1706566942706.png


How do I access these fields? I want to check if they are null, but nothing works, its like wc3 doesn't parse these empty fields so you can't touch them at all. I tried:

JASS:
if BlzGetAbilityStringLevelField(abil, ABILITY_SLF_TOOLTIP_NORMAL_EXTENDED, lvl-1) == ""

Please help, can be GUI, Jass, simple world editor tricks, I just need a way to check if this field is null or not
lvl - 1 is the ability level, but I also tried hardcoding it, and "abil" is valid, I printed its name and stuff
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,563
View attachment 460283

How do I access these fields? I want to check if they are null, but nothing works, its like wc3 doesn't parse these empty fields so you can't touch them at all. I tried:

JASS:
if BlzGetAbilityStringLevelField(abil, ABILITY_SLF_TOOLTIP_NORMAL_EXTENDED, lvl-1) == ""

Please help, can be GUI, Jass, simple world editor tricks, I just need a way to check if this field is null or not
lvl - 1 is the ability level, but I also tried hardcoding it, and "abil" is valid, I printed its name and stuff
Can you store it in a string variable and test that?
vJASS:
local string str = BlzGetAbilityStringLevelField(abil, ABILITY_SLF_TOOLTIP_NORMAL_EXTENDED, lvl-1)
Perhaps something like this?
vJASS:
local string str = "!"
set str = BlzGetAbilityStringLevelField(abil, ABILITY_SLF_TOOLTIP_NORMAL_EXTENDED, lvl-1)
if str == "!" then
    // it failed
endif
 
Level 7
Joined
Sep 16, 2016
Messages
185
Can you store it in a string variable and test that?
vJASS:
local string str = BlzGetAbilityStringLevelField(abil, ABILITY_SLF_TOOLTIP_NORMAL_EXTENDED, lvl-1)
Perhaps something like this?
vJASS:
local string str = "!"
set str = BlzGetAbilityStringLevelField(abil, ABILITY_SLF_TOOLTIP_NORMAL_EXTENDED, lvl-1)
if str == "!" then
    // it failed
endif

It doesn't work :( it seems it still has the value from the last working "field"

JASS:
                local string str = "!"
                set str = BlzGetAbilityStringLevelField(abil, ABILITY_SLF_TOOLTIP_NORMAL_EXTENDED, lvl-1)
                if str == "!" then
                    print("null: "+str) // this is bjdebugmsh
                else
                    print("not null: "+str)

What value prints BlzGetAbilityStringLevelField(abil, ABILITY_SLF_TOOLTIP_NORMAL_EXTENDED, lvl-1)?

It printed the value from the last working field, when I try to fetch a field that doesn't exist (eg. lvl 4 tooltip in an ability that has 5 levels)

print(BlzGetAbilityStringLevelField(abil, ABILITY_SLF_TOOLTIP_NORMAL_EXTENDED, lvl-1), 3) // print is bjdebugmsg
But I still can't seem to compare "" or null, doesn't work
 
Last edited:
Level 7
Joined
Sep 16, 2016
Messages
185
Apparently something like this works, because the empty field apparently retains the old value from the last working field

JASS:
            BlzSetAbilityTooltip(skill, COLOR_BLUE+"Ability 6"+COLOR_RESET, lvl-1)
            BlzSetAbilityExtendedTooltip(skill, COLOR_GOLD+
            "This ability does not have a description yet. Will change with time."+
            "\n\n• Damage Output: "+COLOR_LIGHT_RED+dmg.toString()+COLOR_GOLD+
            "\n• Cast Range: "+COLOR_LIGHT_RED+castRange.toString()+COLOR_GOLD+
            "\n• Cooldown: "+COLOR_LIGHT_RED+cd.toString()+COLOR_GOLD+
            "\n\nFormula: "+COLOR_LIGHT_RED+"(30 • lvl) + (0.4 • stat • lvl)"+COLOR_RESET,
            lvl-1)
            if BlzGetAbilityStringLevelField(abil, ABILITY_SLF_TOOLTIP_NORMAL_EXTENDED, lvl-1) == BlzGetAbilityStringLevelField(abil, ABILITY_SLF_TOOLTIP_NORMAL_EXTENDED, 2-lvl)
                print("A Decrease 1")
                lvl = lvl - 1
            if BlzGetAbilityStringLevelField(abil, ABILITY_SLF_TOOLTIP_NORMAL_EXTENDED, lvl-1) == BlzGetAbilityStringLevelField(abil, ABILITY_SLF_TOOLTIP_NORMAL_EXTENDED, 2-lvl)
                print("B Decrease 1")
                lvl = lvl - 1
            if BlzGetAbilityStringLevelField(abil, ABILITY_SLF_TOOLTIP_NORMAL_EXTENDED, lvl-1) == BlzGetAbilityStringLevelField(abil, ABILITY_SLF_TOOLTIP_NORMAL_EXTENDED, 2-lvl)
                print("C Decrease 1")
                lvl = lvl - 1
            BlzSetAbilityTooltip(skill, COLOR_BLUE+"Ability 6"+COLOR_RESET, lvl-1)
            BlzSetAbilityExtendedTooltip(skill, COLOR_GOLD+
            "This ability does not have a description yet. Will change with time."+
            "\n\n• Damage Output: "+COLOR_LIGHT_RED+dmg.toString()+COLOR_GOLD+
            "\n• Cast Range: "+COLOR_LIGHT_RED+castRange.toString()+COLOR_GOLD+
            "\n• Cooldown: "+COLOR_LIGHT_RED+cd.toString()+COLOR_GOLD+
            "\n\nFormula: "+COLOR_LIGHT_RED+"(30 • lvl) + (0.4 • stat • lvl)"+COLOR_RESET,
            lvl-1)

edit: Nevermind, doesn't really work fully
 
Last edited:
Top