• 🏆 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!

[JASS] Permanent Texttag problem

Status
Not open for further replies.
Level 4
Joined
Apr 14, 2007
Messages
31
Hello, i have a problem with texttags, the actual code for it is:
local texttag t
local integer w

call CreateTextTagUnitBJ( "TRIGSTR_1665", gg_unit_nwgt_0007, 20.00, 10, 100, 100, 0.00, 0 )
set t = GetLastCreatedTextTag()
set udg_ShopsTTexts[w] = t
set w = ( w + 1 )
call SetTextTagPermanentBJ( t, true )
call CreateTextTagUnitBJ( "TRIGSTR_1904", gg_unit_nwgt_0006, 20.00, 10, 0.00, 100.00, 0.00, 0 )
set t = GetLastCreatedTextTag()
set udg_ShopsTTexts[w] = t
set w = ( w + 1 )
.....
the trigger is activated after initialization of the map, but only some of the texttags work, the others dont even show up 14 texttags are used, but often just 4 show up or 1 but jsut when setting a very high delay between, or all texttags are shown but not for all players.

Can someone please help me?
 
Last edited:
Level 21
Joined
Aug 21, 2005
Messages
3,699
Why are you using locals in this case?

JASS:
local integer w = 0 // w must be initialized or you can't say "w = w + 1". You forgot to do so.

set udg_ShopsTTexts[w] = CreateTextTagUnitBJ( "TRIGSTR_1665", gg_unit_nwgt_0007, 20.00, 10, 100, 100, 0.00, 0 )
call SetTextTagPermanentBJ( udg_ShopsTTexts[w], true )
set w = w + 1

set udg_ShopsTTexts[w] = CreateTextTagUnitBJ( "TRIGSTR_1904", gg_unit_nwgt_0006, 20.00, 10, 0.00, 100.00, 0.00, 0 )
call SetTextTagPermanentBJ( udg_ShopsTTexts[w], true )
set w = ( w + 1 )
...
 
Level 4
Joined
Apr 14, 2007
Messages
31
the variable texttag and w arent really needed and it still did not work with "local integer w = 0".
I just thought they give a bigger chance to let the texttag stay permanent

function Trig_TTexts_Actions takes nothing returns nothing
local texttag t
local integer w = 0

call CreateTextTagUnitBJ( "TRIGSTR_1665", gg_unit_nwgt_0007, 20.00, 10, 100, 100, 0.00, 0 )
set t = GetLastCreatedTextTag()
set udg_ShopsTTexts[w] = t
set w = ( w + 1 )
call SetTextTagPermanentBJ( t, true )
call CreateTextTagUnitBJ( "TRIGSTR_1904", gg_unit_nwgt_0006, 20.00, 10, 0.00, 100.00, 0.00, 0 )
set t = GetLastCreatedTextTag()
set udg_ShopsTTexts[w] = t
set w = ( w + 1 )
call SetTextTagPermanentBJ( t, true )
call CreateTextTagUnitBJ( "TRIGSTR_1905", gg_unit_nwgt_0032, 20.00, 10, 100.00, 0.00, 0.00, 0 )
set t = GetLastCreatedTextTag()
set udg_ShopsTTexts[w] = t
set w = ( w + 1 )
call SetTextTagPermanentBJ( t, true )
call CreateTextTagUnitBJ( "TRIGSTR_1911", gg_unit_nwgt_0031, 20.00, 10, 100.00, 0.00, 0.00, 0 )
set t = GetLastCreatedTextTag()
set udg_ShopsTTexts[w] = t
set w = ( w + 1 )
call SetTextTagPermanentBJ( t, true )
call CreateTextTagUnitBJ( "TRIGSTR_1910", gg_unit_nwgt_0009, 20.00, 10, 0.00, 100.00, 0.00, 0 )
set t = GetLastCreatedTextTag()
set udg_ShopsTTexts[w] = t
set w = ( w + 1 )
call SetTextTagPermanentBJ( t, true )
call CreateTextTagUnitBJ( "TRIGSTR_1909", gg_unit_nwgt_0008, 20.00, 10, 100.00, 100.00, 0.00, 0 )
set t = GetLastCreatedTextTag()
set udg_ShopsTTexts[w] = t
set w = ( w + 1 )
.....


but thanks for your help
 
Level 4
Joined
Apr 14, 2007
Messages
31
It can be a gui or jass solution for this bug, it did not work in both it often just show one of about 25 texttags or max 4, which were in the same region, the others just did not get created and in earlier versions where they worked it was possible that they could not be seen by all players somehow
 
Status
Not open for further replies.
Top