- Joined
- Dec 17, 2017
- Messages
- 39
hello,
im trying to show the damage a unit deals in text tags, but only for the player that deals it (white color) and the player which owns the unit suffering it (red color).
this is the function. it is run after damage-detection once for each unit (the target and the damage-dealer at location p. r1 is the amount of damage and rgb are the color-values.):
but it doesnt work. i always see both, the white and the red texttag. i even added the
line and force f2 but it didnt help. Is there anything im missing?
greetings
im trying to show the damage a unit deals in text tags, but only for the player that deals it (white color) and the player which owns the unit suffering it (red color).
this is the function. it is run after damage-detection once for each unit (the target and the damage-dealer at location p. r1 is the amount of damage and rgb are the color-values.):
JASS:
function score1 takes location p, unit u, real r1, real r, real g, real b returns nothing
//defining
local force f
local force f2
local real r2
local real scale
local string str
//operations
set r2 = I2R(GetHeroLevel(udg_avatar[GetConvertedPlayerId(GetOwningPlayer(u))]))
set scale = ( Pow(( ( r1 + udg_FloatingSize1 + (r2*80) ) / udg_FloatingSize2 + (r2*4) ), udg_FloatingSizePow - (0.1*r2)) * udg_FloatingSize3 )
set str = I2S(R2I(r1))
if (r1 > (0.2+(4*r2))) then
set f = GetForceOfPlayer(GetOwningPlayer(u))
set f2 = GetPlayersAll()
call ForceRemovePlayerSimple( GetOwningPlayer(u), f2 )
if ( udg_ScoreDmg1[GetConvertedPlayerId(GetOwningPlayer(u))] == 1 ) then
call CreateTextTagLocBJ( str, p, 50.00, scale, r, g, b, 0 )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), ( scale * 10.00 ), 90 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), ( ( scale + 25.00 ) / 100.00 ) )
call ShowTextTagForceBJ( true, GetLastCreatedTextTag(), f )
call ShowTextTagForceBJ( false, GetLastCreatedTextTag(), f2 )
else
if (( udg_ScoreDmg1[GetConvertedPlayerId(GetOwningPlayer(u))] == 2 ) and (udg_avatar[GetConvertedPlayerId(GetOwningPlayer(u))] == u)) then
call CreateTextTagLocBJ( str, p, 50.00, scale, r, g, b, 0 )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), ( scale * 10.00 ), 90 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), ( ( scale + 25.00 ) / 100.00 ) )
call ShowTextTagForceBJ( true, GetLastCreatedTextTag(), f )
call ShowTextTagForceBJ( false, GetLastCreatedTextTag(), f2 )
endif
endif
endif
// clearing
call DestroyForce(f)
call DestroyForce(f2)
set f=null
set f2=null
endfunction
but it doesnt work. i always see both, the white and the red texttag. i even added the
JASS:
call ShowTextTagForceBJ( false, GetLastCreatedTextTag(), f2 )
greetings