Hello, I have this trigger that a player can set a message, and when he dies/kills a unit that message will display in floating text above the dead/killing unit. It works for a little bit when I test, but then it just stops displaying.
I assume this is because I hit the 99 text limit but aren't these all destroyed?
I've also tried NOT using native functions as this guy did, but result was the same thing
http://www.hiveworkshop.com/forums/world-editor-help-zone-98/problem-multiplayer-floating-texts-227135/
I assume this is because I hit the 99 text limit but aren't these all destroyed?
I've also tried NOT using native functions as this guy did, but result was the same thing
http://www.hiveworkshop.com/forums/world-editor-help-zone-98/problem-multiplayer-floating-texts-227135/
JASS:
function Trig_Messages_Actions takes nothing returns nothing
local unit k=GetKillingUnit()
local unit d=GetDyingUnit()
local real H=16.00 // Height - Default = 16
local real h=0.023 // Size - Default = 0.023
local real T=0 // Transparency
local real L=6.00 // Lifespan
local real F=3.00 // Fade Point
local real v=0.0355 //Velocity - Default = 0.0355
local real xv=(v)*Cos(90*bj_DEGTORAD)
local real xy=(v)*Sin(90*bj_DEGTORAD)
local real w=8.0
local real s=32.0
local real sk=RMinBJ(StringLength(udg_kmsg[GetPlayerId(GetOwningPlayer(k))+1])*(w),(s))
local real sd=RMinBJ(StringLength(udg_dmsg[GetPlayerId(GetOwningPlayer(d))+1])*(w),(s))
local texttag t=CreateTextTag()
local texttag Tt=CreateTextTag()
if udg_kmsg[GetPlayerId(GetOwningPlayer(k))+1]!="" then
call SetTextTagText((t),udg_kmsg[GetPlayerId(GetOwningPlayer(k))+1],(h))
call SetTextTagPos((t),GetUnitX(k)-(sk),GetUnitY(k),(H))
call SetTextTagColor((t),PercentToInt(100,255),PercentToInt(100,255),PercentToInt(100,255),PercentToInt(100.0-(T),255))
call SetTextTagPermanent((t),false)
call SetTextTagVisibility((t),true)
call SetTextTagLifespan((t),(L))
call SetTextTagFadepoint((t),(F))
call SetTextTagVelocity((t),(xv),(xy))
set udg_kmsg[GetPlayerId(GetOwningPlayer(k))+1]=""
endif
if udg_dmsg[GetPlayerId(GetOwningPlayer(d))+1]!="" then
call SetTextTagText((Tt),udg_dmsg[GetPlayerId(GetOwningPlayer(d))+1],(h))
call SetTextTagPos((Tt),GetUnitX(d)-(sd),GetUnitY(d),(H))
call SetTextTagColor((Tt),PercentToInt(100,255),PercentToInt(100,255),PercentToInt(100,255),PercentToInt(100.0-(T),255))
call SetTextTagPermanent((Tt),false)
call SetTextTagVisibility((Tt),true)
call SetTextTagLifespan((Tt),(L))
call SetTextTagFadepoint((Tt),(F))
call SetTextTagVelocity((Tt),(xv),(xy))
set udg_dmsg[GetPlayerId(GetOwningPlayer(d))+1]=""
endif
set k=null
set d=null
set t=null
set Tt=null
endfunction
//===========================================================================
function InitTrig_Messages takes nothing returns nothing
local integer i=0
set gg_trg_Messages=CreateTrigger()
loop
exitwhen i==bj_MAX_PLAYER_SLOTS
call TriggerRegisterPlayerUnitEvent(gg_trg_Messages,Player(i),EVENT_PLAYER_UNIT_DEATH,null)
set i=i+1
endloop
call TriggerAddAction(gg_trg_Messages,function Trig_Messages_Actions)
endfunction
Last edited: