HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

TextTag not showing up

10-14-2009, 06:16 PM#1
Tot
Collapse why does the f***ing texttag not show up?:
globals
constant real TT_HEIGHT=10
constant real TT_HEIGHT_OFFSET=10
constant integer TT_RED=255
constant integer TT_GREEN=255
constant integer TT_BLUE=255
constant integer TT_ALPHA=255 //Tried also with TT_ALPHA=0
constant force TT_SHOW_FORCE=GetPlayeresAll()
endglobals

function blah takes nothing returns nothing
local texttag tt=CreateTextTag()
local string temp="test"

call SetTextTagText(tt,temp,TT_HEIGHT)
call SetTextTagPosUnit(tt,this.base,TT_HEIGHT_OFFSET)
call SetTextTagColor(tt,TT_RED,TT_GREEN,TT_BLUE,TT_ALPHA)
call SetTextTagVisibility(tt,IsPlayerInForce(GetLocalPlayer(),TT_SHOW_FORCE))
endfunction

the func is called, everything i can remember is done, but it doesn't show up ingame

10-15-2009, 01:31 AM#2
Zerzax
It might have to do with the height - height goes through 1 or two conversion factors, try using the BJ functions or imitating what they do precisely.
10-15-2009, 07:33 AM#3
Anachron
Output of my documentation. (Link)

Collapse JASS:
    //: Sets the default textsize
    //: of the texttag.
    //: Note: This is the wc3 size,
    //:       not the normal word one,
    //:       so we recalculate it with
    //:       the formula.
    TT_DEFAULT_SIZE            = 7.5 * 0.023 / 10
Its not height by setting text, its the text size, which has to be
a very very small number in wc3 format.

Just add this
Collapse JASS:
* 0.023 / 10
to yours and it will work.

If you have any questions about texttags further, just check my system.
10-15-2009, 01:54 PM#4
Rising_Dusk
Collapse JASS:
globals
constant real TT_HEIGHT=10
constant real TT_HEIGHT_OFFSET=10
constant integer TT_RED=255
constant integer TT_GREEN=255
constant integer TT_BLUE=255
constant integer TT_ALPHA=255 //Tried also with TT_ALPHA=0
constant force TT_SHOW_FORCE=GetPlayeresAll()
endglobals
You shouldn't use GetPlayersAll() because it doesn't actually initialize the force. Consider that bj_FORCE_ALL_PLAYERS, the force your typoed function refers to, is initialized after the global declaration phase. That means that your force is null right now. You should set it equal to bj_FORCE_ALL_PLAYERS in a scope initializer.
10-15-2009, 02:29 PM#5
Tot
fixed prob of not showing up, but now...look for your self

Expand Full code of TBars:

Doing:
now some strange bars appear and he's performing random actions

Should do:
One bar named "GradientBar" and one named "StaticBar" should at least appear for the mountainking
the bars value depends on the units stat (one Bar depends on Life, the other one on Mana of the mountainking)


help is needed an welcome
10-15-2009, 03:39 PM#6
Anachron
Just one question? How is your system better as mine? You have just removed all my default stuff, and made everything in a few function calls only, which really sucks horribly.

As for the problem, I am checking it right now.

Edit:
Collapse JASS:
call this.UpdateFunc.evaluate()
UMm? Are you joking? Why do you evaluate and don't save the return, neither check whether its true or false?

Edit2:
Yours is worse, compared to mine. Sorry for being rough, I just see that its not giving you anything better, but removing much of my functionality I wanted the user to allow.

Edit3:
Expand JASS:
what the hell? You REALLY think this is more userfriendly as mine is?

Expand JASS:

Initialize that stuff, so its...

Expand JASS:
10-15-2009, 03:53 PM#7
Tot
The only funcs the user has to use are
Collapse JASS:
function UnitAddBar takes unit u, string name, real max, ARGB startcol, ARGB endcol,integer length, boolean gradient, boolean full, barfunc UpdateFunc returns nothing
    call GetUnitTextBar(u).addBar(Bar.create(name,max,startcol,endcol,length,gradient,full,UpdateFunc))
call BJDebugMsg("Bar added")
endfunction

function UnitRemoveBarById takes unit u, integer id returns nothing
    local TextBar tb=GetUnitTextBar(u)
    call tb.remBar(tb.getBarById(id))
endfunction

function UnitRemoveBarByName takes unit u, string name returns nothing
    local TextBar tb=GetUnitTextBar(u)
    call tb.remBar(tb.getBarByName(name))
endfunction

function GetBarUnit takes nothing returns unit
    return FUNCTION_UNIT
endfunction

function GetBar takes nothing returns Bar
    return FUNCTION_BAR
endfunction

//! textmacro FUNC takes NAME,TYPE
function SetBar$NAME$ takes $TYPE$ new returns nothing
    call FUNCTION_BAR.set$NAME$(new)
endfunction

function GetBar$NAME$ takes nothing returns $TYPE$
    return FUNCTION_BAR.get$NAME$()
endfunction
//! endtextmacro

//! runtextmacro FUNC("Name","string")
//! runtextmacro FUNC("Max","real")
//! runtextmacro FUNC("Current","real")
//! runtextmacro FUNC("StartColor","ARGB")
//! runtextmacro FUNC("EndColor","ARGB")
//! runtextmacro FUNC("Length","integer")
//! runtextmacro FUNC("Gradient","boolean")

and all except the first three funcs are only used for the UpdateFuncs

Quote:
UMm? Are you joking? Why do you evaluate and don't save the return, neither check whether its true or false?

they return nothing --> nothing to save

Quote:
You have just removed all my default stuff, and made everything in a few function calls only, which really sucks horribly.

In my oppinion to much defaults only confuse the user, when setting up a system and you've to set hundrets of Defaults, you get only confused.
what's wrong with only having 1 func to call?

Quote:
Yours is worse, compared to mine. Sorry for being rough, I just see that its not giving you anything better, but removing much of my functionality I wanted the user to allow.

It has not to be functional, it has to show x bars for a unit and nothing more.
Due to the fact that I need it for my MOW-project it has to be foolproof, cause some of my helpers have even problemes with GUI
--> being foolproof is important for this sys
10-15-2009, 03:58 PM#8
Anachron
Quote:
The only funcs the user has to use are
Collapse JASS:
function UnitAddBar takes unit u, string name, real max, ARGB startcol, ARGB endcol,integer length, boolean gradient, boolean full, barfunc UpdateFunc returns nothing
    call GetUnitTextBar(u).addBar(Bar.create(name,max,startcol,endcol,length,gradient,full,UpdateFunc))
call BJDebugMsg("Bar added")
endfunction

function UnitRemoveBarById takes unit u, integer id returns nothing
    local TextBar tb=GetUnitTextBar(u)
    call tb.remBar(tb.getBarById(id))
endfunction

function UnitRemoveBarByName takes unit u, string name returns nothing
    local TextBar tb=GetUnitTextBar(u)
    call tb.remBar(tb.getBarByName(name))
endfunction

function GetBarUnit takes nothing returns unit
    return FUNCTION_UNIT
endfunction

function GetBar takes nothing returns Bar
    return FUNCTION_BAR
endfunction

//! textmacro FUNC takes NAME,TYPE
function SetBar$NAME$ takes $TYPE$ new returns nothing
    call FUNCTION_BAR.set$NAME$(new)
endfunction

function GetBar$NAME$ takes nothing returns $TYPE$
    return FUNCTION_BAR.get$NAME$()
endfunction
//! endtextmacro

//! runtextmacro FUNC("Name","string")
//! runtextmacro FUNC("Max","real")
//! runtextmacro FUNC("Current","real")
//! runtextmacro FUNC("StartColor","ARGB")
//! runtextmacro FUNC("EndColor","ARGB")
//! runtextmacro FUNC("Length","integer")
//! runtextmacro FUNC("Gradient","boolean")
Yeah,... Yes, but the parameters... Really, awful.

Quote:
and all except the first three funcs are only used for the UpdateFuncs
...


Quote:
they return nothing --> nothing to save
So why evaluating them, why not just .execute() ?


Quote:
In my oppinion to much defaults only confuse the user, when setting up a system and you've to set hundrets of Defaults, you get only confused.
what's wrong with only having 1 func to call?
Too much parameters and my defaults are actually giving him the posability to make all textbars to looks the same for default.

Btw, you can't do that with your system. How can the user fade texttags with your system? Or get the texttagtext?

Quote:
It has not to be functional, it has to show x bars for a unit and nothing more.
Due to the fact that I need it for my MOW-project it has to be foolproof, cause some of my helpers have even problemes with GUI
--> being foolproof is important for this sys
Whats so worse about Deoads or mine systems?
10-15-2009, 04:54 PM#9
Tot
Quote:
Yeah,... Yes, but the parameters... Really, awful.
awful?

Quote:
So why evaluating them, why not just .execute() ?
oh....

Quote:
Btw, you can't do that with your system. How can the user fade texttags with your system? Or get the texttagtext?

He doesn't need to get the texttag's text and fading for always present bars?

Quote:
Whats so worse about Deoads or mine systems?
they are too complicated for this noobs
10-15-2009, 05:55 PM#10
Rising_Dusk
Deaod's is actually incredibly intuitive. I would use it before Anachron's or yours, personally.
10-15-2009, 07:49 PM#11
Anachron
Quote:
Originally Posted by Rising_Dusk
Deaod's is actually incredibly intuitive. I would use it before Anachron's or yours, personally.
Mine is advanced, what points against that?^^
10-15-2009, 07:56 PM#12
Rising_Dusk
The word advanced being used in a sentence to describe something without support means nothing. Deaod's does everything it needs to do and does it well and in a way that is easy to understand. That's as 'advanced' as it should be.
10-15-2009, 07:58 PM#13
Tot
Quote:
Originally Posted by Rising_Dusk
Deaod's is actually incredibly intuitive. I would use it before Anachron's or yours, personally.

hrrmpf.....
10-16-2009, 07:41 AM#14
Anachron
Quote:
Originally Posted by Rising_Dusk
The word advanced being used in a sentence to describe something without support means nothing. Deaod's does everything it needs to do and does it well and in a way that is easy to understand. That's as 'advanced' as it should be.
Well, Deaods system is easy to understand, thats true, but with increasing functionality, the complexity increases to and I mean really, my calls for creating a bar are less (below 4 calls for your normal CustomBar) and its highly customizeable!