[JASS] Why is allways TextTag messing with me

Status
Not open for further replies.
Level 11
Joined
Apr 6, 2008
Messages
760
I have serious buggs with texttags sometimes they work sometimes not.

As for now it wont show for my casting bar system

JASS:
    method CreateCastBar takes nothing returns nothing
        local integer index = 0
        
        set this.Timer = NewTimer()
        set this.BarText = CreateTextTag()
        set this.Text = ""
        set this.Time = CastBar_BarTime
        set this.ElapsedTime = 0
        set this.Count = 0
        set HT[this.Caster] = this
        
        loop
            exitwhen index >= 25
            set this.TextI = this.TextI + CastBar_BarType
            set index = index + 1
        endloop
        
        call SetTextTagPermanent(this.BarText,true)
        call SetTextTagText(this.BarText,this.TextI,CastBar_ZHeight)
        call SetTextTagPosUnit(this.BarText,this.Caster,CastBar_ZHeight)
        call SetTextTagVisibility(this.BarText,true)
        
        call SetTimerData(this.Timer,this)
        call TimerStart(this.Timer,CastBar_BarTime/25,true,function thistype.CallBack)
        
    endmethod

Any1 have a clue why it wont show?

Off Topic: Only me who see Brackets as '& # 9 1 ;' (with out spaces) in a jasstag ? :p
 
Level 11
Joined
Apr 6, 2008
Messages
760
Level 11
Joined
Apr 6, 2008
Messages
760
I have another question regarding texttags

JASS:
native SetTextTagColor takes texttag t, integer red, integer green, integer blue, integer alpha returns nothing

i tryed to use alpha to fade the texttag out when its going to get destroyed, but well nothing happens when i try :/

Is this possible? or that is just some wierd name blizzard did put there?

EDIT

i tryed this "test trigger" to try it out and still nothing happend

JASS:
scope ASD initializer A

globals
    private texttag TEXT
endglobals

function B takes nothing returns nothing
    local string S = GetEventPlayerChatString()
    local string C = SubString(S,6,9)
    local integer i = S2I(C)
    
    call BJDebugMsg(I2S(i))
    
    call SetTextTagColor(TEXT,255,0,0,i)
endfunction

//===========================================================================
function A takes nothing returns nothing
    local trigger s = CreateTrigger(  )
    call TriggerRegisterPlayerChatEvent(s, Player(0), "-test ", false)
    call TriggerAddAction(s, function B )
    
    set TEXT = CreateTextTag()
    call SetTextTagText(TEXT,"TEST",0.05)
    call SetTextTagPermanent(TEXT,true)
    call SetTextTagPos(TEXT,0,0,0.05)
    call SetTextTagVisibility(TEXT,true)
endfunction

endscope
 
Status
Not open for further replies.
Top