• 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.
  • Vote for the theme of Hive's HD Modeling Contest #7! Click here to vote! - Please only vote if you plan on participating❗️

Texttag sometimes do not appear for no reason

Level 10
Joined
May 24, 2016
Messages
339
Hello.

Sometimes texttags do not appear in my map

The script is pretty simple

JASS:
function TextTagSize2HeightJ takes real size returns real
    return size * 0.023 / 10
endfunction


function SetTextTagTextJ takes texttag tt, string s, real size returns nothing
    local real textHeight = TextTagSize2HeightJ(size)

    call SetTextTagText(tt, s, textHeight)
endfunction

function texttagcreate takes nothing returns nothing
local texttag TX 
local string S
set S = ""


if IsPlayerInForce(GetLocalPlayer(),UndeadForce)
set S = "-> Teleportation" //|c00FBE14F-
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 250, 94, 250, 250) //250
call SetTextTagTextJ(TX, S, 13 ) //14 05
call SetTextTagPos(TX, 12900, 10000, 10)
set TX = null
endfunction
 
Last edited:
Level 43
Joined
Feb 27, 2007
Messages
5,456
  • There can only be 99 texttags at a time in a map; it's a special type of handle.
  • You create two texttags every time the texttag function is run (one in the declaration of TX and again below). The first is an error.
  • Neither of the texttags you create are destroyed. The second one should have its permanence disabled and then be given a lifetime (the order matters).
  • Since you never destroy those two texttags, once the 99 have been made no more will show (I think it just overwrites the oldest ones to stay at the 99 cap).

  • Most of this could be inlined; there's no real reason to call two sub-functions here.
  • texttag is a horrible name for a function. You should not give functions names that are defined types or other JASS keywords.
 
Last edited:
Level 10
Joined
May 24, 2016
Messages
339
  • There can only be 99 texttags at a time in a map; it's a special type of handle.
  • You create two texttags every time the texttag function is run (one in the declaration of TX and again below). The first is an error.
  • Neither of the texttags you create are destroyed. The second one should have its permanence disabled and then be given a lifetime (the order matters).
  • Since you never destroy those two texttags, once the 99 have been made no more will show (I don't think it just overwrites the old ones).

  • Most of this could be inlined; there's no real reason to call two sub-functions here.
  • texttag is a horrible name for a function. You should not give functions names that are defined types or other JASS keywords.
Im sorry. I named it "texttag" as function name only for cosmetic purposes to show code on hive

There's also no actual 2 texttag creations. That was also made for cosmetic purposes, to show that I declare a local for that. I made this mistake only in this message, not in actual map function.

About life spam. The textag is intended to be permament, so there's no reason to give life time.
 
Level 10
Joined
May 24, 2016
Messages
339
  • There can only be 99 texttags at a time in a map; it's a special type of handle.
  • You create two texttags every time the texttag function is run (one in the declaration of TX and again below). The first is an error.
  • Neither of the texttags you create are destroyed. The second one should have its permanence disabled and then be given a lifetime (the order matters).
  • Since you never destroy those two texttags, once the 99 have been made no more will show (I don't think it just overwrites the old ones).

  • Most of this could be inlined; there's no real reason to call two sub-functions here.
  • texttag is a horrible name for a function. You should not give functions names that are defined types or other JASS keywords.
I found that texttag may appear for second team,but it's complete random. IDK why, I do not use any GetLocalPlayer things as you can see.
 
Level 43
Joined
Feb 27, 2007
Messages
5,456
The textag is intended to be permament, so there's no reason to give life time.
There can only be 99 texttags at a time in a map; it's a special type of handle. … Since you never destroy those two texttags, once the 99 have been made no more will show (I think it just overwrites the oldest ones to stay at the 99 cap).
Bruh, did you read? That is the fundamental problem with what you’re doing. Why do you need >> 99 permanent texttags in your map? What is the application that makes this necessary?
 
Level 10
Joined
May 24, 2016
Messages
339
Bruh, did you read? That is the fundamental problem with what you’re doing. Why do you need >> 99 permanent texttags in your map? What is the application that makes this necessary?
I did. There's no >99 texttags in my map. Permament texttags number im my map are around 10-20, that's maximum.

This is why I have not responded to that point.
 

Uncle

Warcraft Moderator
Level 71
Joined
Aug 10, 2018
Messages
7,600
I don't think anyone is experiencing a floating text bug on the current patch, at least nobody has mentioned it, so it's likely one of two things:

1) You're going over the limit. If you have text tags like floating damage numbers, your own custom crit and miss text, etc, those can overwrite and erase your previously created permanent text - as far as I understand.

2) You're using GetLocalPlayer() incorrectly and can't see the text tags even though they exist.

Remember, things don't just happen "for no reason". There's a reason.
 
Last edited:
Top