• 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] Simple Text Tag does not work?

Status
Not open for further replies.
I want:
A simple text tag that fades from first second and disappears after 5 seconds.

JASS:
local unit u = GetTriggerUnit()
local location l
local real x
local real y
local texttag k
local real d = GetEventDamage()

set l = GetUnitLoc(u)
set x = GetLocationX(l)
set y = GetLocationY(l)
call RemoveLocation(l)

set k = CreateTextTag()
call SetTextTagText(k,"-"+I2S(R2I(d)),0.05)
call SetTextTagPos(k, x, y, 75.00)
call SetTextTagVelocity(k, 64, 90)
call SetTextTagColor(k, 255, 255, 255, 255)
call SetTextTagPermanent(k,false)
call SetTextTagFadepoint(k, 0.00)
call SetTextTagLifespan(k,5.00)
call SetTextTagVisibility(k,true)

call DisplayTextToPlayer(Player(0),0,0,"This function has been executed!")

whats wrong? :(

It says the text btw.

Edit: I see no texttag..
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,257
JASS:
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local texttag k = CreateTextTag()
local real d = GetEventDamage()

call SetTextTagText(k,"-"+I2S(R2I(d)),0.023)
call SetTextTagPos(k, x, y, 75)
call SetTextTagVelocity(k, 0, 0.03)
call SetTextTagColor(k, 255, 255, 255, 255)
call SetTextTagPermanent(k,false)
call SetTextTagFadepoint(k, 0)
call SetTextTagLifespan(k,5)

set u = null
set k = null

Optimized version . . .
 
New Problem

JASS:
function CreateTT takes string TTtext, real TTsize, string TTcolor, real TTheight, real TTPosX, real TTPosY, real TTPosZ, real TTtime, real TTfadepoint returns texttag
local texttag tt

set tt = CreateTextTag()

call SetTextTagText(tt,TTtext,TTheight)
call SetTextTagPos(tt, TTPosX, TTPosY, TTPosZ)
call SetTextTagVelocity(tt, 64, TTsize)

if TTcolor == "white" then
call SetTextTagColor(tt, 255, 255, 255, 255)
else
call SetTextTagColor(tt, 255, 255, 255, 255)
endif

call SetTextTagPermanent(tt,false)
call SetTextTagFadepoint(tt, TTfadepoint)
call SetTextTagLifespan(tt, TTtime)
call SetTextTagVisibility(tt,true)

return tt
endfunction


Another function
JASS:
set k = CreateTT(I2S(R2I(d)), 0.03,"white", 75.00, x, y, 75.00, 2.00, 0.00)

that causes the functions to stop ...
 
Status
Not open for further replies.
Top