Texttags are bugging! leak?

Rushhour

New Member
Reaction score
46
Hi there. I have a problem with these stupid texttags. At first it works perfectly. I use them to display damage dealt and suffered and so there are a lot of texttags created over gameplay.

After a time ( I don't know how many are exactly created, could be some hundreds) they start bugging. To be exact that means they vanish after one second. Vanish after another one has been created. Start moving even if they shouldn't,... .

I guess this has something to do with only having some hundreds of texttags preallocated per player...
Well I thought I could 'recyle' them by destroying them (attached to a struct and destroyed after lifespan).
It doesn't work! I nulled the variables, disabled permanence, set lifespan and that's pretty much all I can imagine. How can I make this work for longer games?
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
You can have only 100 texttag simultaneously on each machine.
You can create a textag locally with GetLocalPlayer without any desync.

EDIT : Hide a texttag doesn't help, only destroy them with SetTextTagLifespan or ofc DestroyTextTag.
Also i had never use SetTextTagPermanent, but maybe it prevents the destroy of the texttag with the Set...LifeSpan function.

You can see how many more textags you can create by displaying the id of your texttag with GetHandleId.
The first will be "99", and the last "0".
That's one more weird thing for jass, the last valid id for texttag is "0" but that's also the same for an invalid texttag when you reach the limit of 100.
 

Rushhour

New Member
Reaction score
46
Well: I do not have 100 texttags in my map at the same time.
I guess I display around 800-1000 correctly (it's a single player map) until they first start bugging.

Now I tried to preallocate a stack of texttags myself, save them in an array and get them just by increasing the stackindex...

Something weird came out.:

JASS:
globals
        constant integer PreAllocAmount=50
        integer CurrStackIndex=0
       texttag array TextStack
endglobals

function CreateTextTagEx takes /*lot of things*/ returns nothing
   if TextStack[CurrStackIndex] == null then
        call BJDebugMsg("there is no text! index is: "+I2S(CurrStackIndex))
    else
        call BJDebugMsg("there is one! index is: "+I2S(CurrStackIndex)) //displayed
    endif

   //setting texttag stuff here...

        set CurrStackIndex=CurrStackIndex+1
        if CurrStackIndex>=PreAllocAmount then
            set CurrStackIndex=0
        endif
call BJDebugMsg("Text should be there") //displayed
endfunction

function StackInit takes nothing returns nothing
    local integer index=0
        loop
            exitwhen index>=PreAllocAmount
            set TextStack[index]=CreateTextTag()
            set index = index+1
        endloop
call BJDebugMsg("Init successful") //displayed
endfunction

this setup DOESN'T work! The marked debug messages are displayed, but there is no text ingame.

----------------------------------------------------------------------------------------------------------------------------------
But if I only change this to the following:

JASS:
globals
        constant integer PreAllocAmount=50
        integer CurrStackIndex=0
endglobals

function CreateTextTagEx takes /*lot of things*/ returns nothing
   set TextStack[CurrStackIndex]=CreateTextTag()
   if TextStack[CurrStackIndex] == null then
        call BJDebugMsg("there is no text! index is: "+I2S(CurrStackIndex))
    else
        call BJDebugMsg("there is one! index is: "+I2S(CurrStackIndex)) //displayed
    endif

   //setting texttag stuff here...

        set CurrStackIndex=CurrStackIndex+1
        if CurrStackIndex>=PreAllocAmount then
            set CurrStackIndex=0
        endif
call BJDebugMsg("Text should be there") //displayed
endfunction

function StackInit takes nothing returns nothing
    local integer index=0
        loop
            exitwhen index>=PreAllocAmount
            set TextStack[index]=CreateTextTag()
            set index = index+1
        endloop
call BJDebugMsg("Init successful") //displayed
endfunction

then it works... the functions for setting the texttag stuff weren't touched.

What the hell?

Edit: Ok when I have more than 100 texttags allocated/created at the same time I get the effects I described. But I do not have these many texts all the time. Maybe in a rare situation, but I still have these effects when fighting solo units afterwards...

The last thing I can think of is that there is maybe a situation where more than 100 texttags are in the map, but would this screw up everything? Even future situations where there are less texttags?
And why doesn't the first setup work while the second one does? :O
 

Bribe

vJass errors are legion
Reaction score
67
You don't need to destroy texttags as they are auto-destroyed once the 100 limit is reached.

CreateTextTag 1-99: as you'd expect

CreateTextTag 100: destroys texttag 1
CreateTextTag 101: destroys texttag 2
etc.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
[del]Hmm, not really the destroyed texttag is kinda random if i remember correctly.[/del]
And still, it's good to know the limit.

After a short test it seems in this case it works like a stack, the last created is destroyed, so it's kinda lame, isn't it ?

I'm also totally sure that you can only have 100 texttag per player, no more.
And no the limit is 100 not 99.

EDIT : Recycling texttags is a really really lame idea.
Just create and destroy them when you don't need it.

Also, i was always wondering if the textags created by the game itself does matter in the hardcoded limit of 100 texttags.
You know when a peon bring a resource gold/wood, or when an unit takes a critic damage, and so one.
I had never tested because i don't use texttags that much, but maybe it's your problem.
 

Rushhour

New Member
Reaction score
46
I couldn't reproduce the bug when doing a stresstest, damaging 50 units 4 times a second...

Afterwards everything went on fine 0o

The strange thing is that I do all my texttag creation with one base function. It's not like I created a stack of texttags, saved them and forgot about them...

Will have to look through my script then.. man I hate stuff like that :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/
  • The Helper The Helper:
    Here is another comfort food favorite - Million Dollar Casserole - https://www.thehelper.net/threads/recipe-million-dollar-casserole.193614/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top