• 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.

[JASS] Floating Text glitches

Status
Not open for further replies.
Level 3
Joined
Oct 31, 2007
Messages
30
Well I have this problem, that when I am creating 100 floating text, not all show up. Interestingly how many show up depends on where I put the texttag creation in the code and on my random starting position on the map which is in no way connected to this trigger except for maybe my initial camera position. This would be the code I use for creating the tags. They are meant to be permanent so there is really no need to store them.

JASS:
function Trig_GameInit_Actions takes nothing returns nothing
    local texttag TempTag
    local rect TempRect
    local integer ForA = 0
    local integer ForB
    loop
        exitwhen ForA > 9
        set ForB = 0
        loop
            exitwhen ForB > 9
            set TempTag = CreateTextTag()
            call SetTextTagText(TempTag, (I2S(ForA) + ":"  + I2S(ForB)), 0.0414)
            set TempRect = udg_gam_planets[( ( ForA * 10 ) + ForB )]
            call SetTextTagPos(TempTag, GetRectCenterX(TempRect), GetRectCenterY(TempRect), 36.0)
            call SetTextTagColor(TempTag, 220, 220, 220, 255)    
            set ForB = ForB + 1
        endloop
        set ForA = ForA + 1
    endloop
    set TempTag = null
    set TempRect = null
   //rest of the trigger
 //===========================================================================
function InitTrig_GameInit takes nothing returns nothing
    set gg_trg_GameInit = CreateTrigger(  )
    call TriggerRegisterTimerEvent( gg_trg_GameInit, 0.4, false )
    call TriggerAddAction( gg_trg_GameInit, function Trig_GameInit_Actions )
endfunction
Two more things: Apparently not all players are missing the same texts. And sometimes when I am spawned in the lower edge of the map (9th or 10th row if that matters or means anything to you) all texts are visible/there (for me).

I have already tried a recursive trigger and waits to no avail. Should I try timers or is there any other explanation for this behavior?

Thanks in advance.
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
Sorry, my bad, didn't see the rect thingy.

Well slap me in the face and call me Susan, I have no idea, sorry. I hate the little devils anyways.

P.S. This probably won't help, but can you post where you declared those regions?
 
Level 3
Joined
Oct 31, 2007
Messages
30
JASS:
    set udg_gam_planets[0] = gg_rct_Region_000
    set udg_gam_planets[1] = gg_rct_Region_001
    set udg_gam_planets[2] = gg_rct_Region_002
   ...
    set udg_gam_planets[99] = gg_rct_Region_099
Not very interesting. :p
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
It seems there is no fixed limate on floating text, instead it is the quanity of text that you have floating at once which points towards a graphic memory allocation thing.
In skibi TD, well over 100 floating text objects are created and displayed at once, but they consist entirly of a single character (l).

In heroes and empires 2, there were only llike 8-15 text tags on display at once but it bugged and started not to display them all. They were like blocks of text thou (many sentences each).
 
Level 11
Joined
Feb 18, 2004
Messages
394
It seems there is no fixed limate on floating text, instead it is the quanity of text that you have floating at once which points towards a graphic memory allocation thing.
In skibi TD, well over 100 floating text objects are created and displayed at once, but they consist entirly of a single character (l).

In heroes and empires 2, there were only llike 8-15 text tags on display at once but it bugged and started not to display them all. They were like blocks of text thou (many sentences each).

... Errrr... .... ... ... the limit is 100 texttag objects. Skibi's TD's |'s are many |'s in a single texttag object. as for HAE2, they're likely only displaying some texts locally, so the limit is actually hit even if you can't see all the texts as a single player.
 
Level 11
Joined
Feb 18, 2004
Messages
394
JASS:
library abc initializer init

function H2I takes handle h returns integer
    return h
    return 0
endfunction

function init takes nothing returns nothing
    local texttag tag
    local integer i = 0
    
    loop
        exitwhen i == 110
        
        set tag = CreateTextTag()
        call BJDebugMsg("H2I: " + I2S(H2I(tag)))
        
        if tag == null then
            call BJDebugMsg("Null at: " + I2S(i+1))
            exitwhen true
        endif
        
        set i = i + 1
    endloop
endfunction

endlibrary

a null texttag is of course 0. the first texttag is 100. the final texttag is 1. There is a hard limit of 100 text tags, and the IDs are assigned decrementing from 100.
 
Level 3
Joined
Oct 31, 2007
Messages
30
Level 40
Joined
Dec 14, 2005
Messages
10,532
Would a recursive trigger be executed in a new thread every time it calls itself?
Only trigger actions and ExecuteFunc result in a new thread (if there are more, I can't think of them), so no.

Hrm, that's an evil bug. Not sure where it might be originating from.

You could always try to get a modeler to make you 11 different SFX (0,1,2,3,4,5,6,7,8,9,:) and just display SFX instead of texttags, if worst comes to worst.

And yeah, EF's right in that it would be way saner to create the rects in a loop.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
True, there are some systems (such as that one) which I have rather irrational biases against.

However, I'm under the impression that it constantly updates the text (Obviously for dynamic, but I'm not sure for Static, never really dug around the code much), in which case simple SFX should be way more efficient.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Earth-Fury, the only thing I can think is wrong with that system is that it was made back in the time of normal WE (no JNGP) thus it could be optimized a bit more. However there might be a JNGP version but I never fully checked thread.

Still, he should only use it if ihe absolutly needs to.
 
Status
Not open for further replies.
Top