- Joined
- Aug 21, 2008
- Messages
- 533
i have a prob with my texttags: at first, they behaving normally. Everytime a unit is damaged by this trigger, there is created a new texttag. But after soem time, suddenly instead of creating a new textag, a old one is changed.
This actually means, that a existing one is removed, and a new one, with the life span and visibly , is created.
So... just like i used a global instead of a local
This actually means, that a existing one is removed, and a new one, with the life span and visibly , is created.
So... just like i used a global instead of a local

JASS:
function PhysicalDamage takes unit attacker, unit target , real dmg,boolean crit returns nothing
local real armor = LoadReal(udg_HashTable, GetHandleId(target), StringHash("armor"))
local real armor2 = armor*0.7
local texttag text = CreateTextTag()
local texttag text2 = CreateTextTag()
//armor
if armor>dmg then
set dmg=dmg*0.3
else
set dmg=dmg-armor2
endif
//dmg
call UnitDamageTarget(attacker,target,dmg,true,false,ATTACK_TYPE_MELEE, DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
//text
if crit==true then
call SetTextTagText(text, I2S(R2I(dmg))+"!", 12* 0.023 / 10)
call SetTextTagColor(text, 255, 0, 0, 0)
else
call SetTextTagText(text, I2S(R2I(dmg)), 8* 0.023 / 10)
call SetTextTagColor(text, 255, 255, 255, 0)
endif
call SetTextTagPos(text, GetUnitX(target)+GetRandomReal(-25,25), GetUnitY(target)+GetRandomReal(-25,25), 50)
call SetTextTagPermanent(text, false)
call SetTextTagVelocity(text, 0, 0.04)
call SetTextTagVisibility(text, true)
call SetTextTagLifespan(text, 3)
call SetTextTagFadepoint(text, 0.01)
set text=null
endfucntion