• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

[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