Good Day, The Goal of the folowing 2 JASS triggers is to create a TextTag and store it in a hashtable, then move it every 33 ms using the second trigger, have a look :
[SOLVED] The problem is that i see no text over my character, what could be the problem.
Also, i need to know if is it possible to merge the two triggers into one "library"? so that it can be configurable and usable in any other map.
Thanks
================================
Problem 1 solved : changed the text size from 10 to 0.023, Thanks to wietlol
JASS:
//Health, Mana and Vision Dummy
library HMVD // v 0.0.0.1
globals
hashtable HMVDHash = InitHashtable()
integer HMVDCount = 0
endglobals
function HMVDAdd takes unit u returns nothing
local player p
local string color
local string s
local location l
local texttag t
local force f
if u != null then
set p = GetOwningPlayer(u)
set f = GetPlayersAll()
set HMVDCount = HMVDCount + 1
call SaveUnitHandle(HMVDHash, 1, HMVDCount, u)
if IsPlayerAlly(p , Player(0)) then
set color = "|c00ff0303"
elseif IsPlayerAlly(p, Player(6)) then
set color = "|c0020c000"
endif
set s = color + "100%" + "|r" + " / " + "|c00540081" + "100%" + "|r"
set l = GetUnitLoc(u)
//set t =
call SaveTextTagHandle(HMVDHash, 2, HMVDCount, CreateTextTagLocBJ(s, l, 196.00, 10, 100, 100, 100, 50.00))
call ShowTextTagForceBJ(true, LoadTextTagHandle(HMVDHash, 2, HMVDCount), f)
call SetTextTagPermanent(LoadTextTagHandle(HMVDHash, 2, HMVDCount), true)
//call SaveBoolean(HMVDHash, 4, HMVDCount, false)
//call SaveStr(HMVDHash, 5, HMVDCount, s)
endif
endfunction
endlibrary
JASS:
function HMVDLoop takes nothing returns nothing
local integer i
local unit u
local location L1
local location L2
local texttag tt
local player p
local string s
local string color
if HMVDCount > 0 then
set i = 1
loop
exitwhen i > HMVDCount
set u = LoadUnitHandle(HMVDHash, 1, i)
set p = GetOwningPlayer(u)
set L1 = GetUnitLoc(u)
set L2 = PolarProjectionBJ(L1, 64, 180)
set tt = LoadTextTagHandle(HMVDHash, 2, i)
call SetTextTagPos(tt, GetLocationX(L2), GetLocationY(L2), 196)
//===================================================================
if IsPlayerAlly(p , Player(0)) then
set color = "|c00ff0303"
elseif IsPlayerAlly(p, Player(6)) then
set color = "|c0020c000"
endif
set s = color + "100%" + "|r" + " / " + "|c00540081" + "100%" + "|r"
//===================================================================
call SetTextTagText(tt, s, 10)
call BJDebugMsg(s)
call BJDebugMsg("HMVDLoop = "+I2S(i)+" On "+GetUnitName(u))
set i = i + 1
endloop
endif
endfunction
//===========================================================================
function InitTrig_HMVDLoop takes nothing returns nothing
set gg_trg_HMVDLoop = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_HMVDLoop, udg_Timer30 )
call TriggerAddAction( gg_trg_HMVDLoop, function HMVDLoop )
endfunction
[SOLVED] The problem is that i see no text over my character, what could be the problem.
Also, i need to know if is it possible to merge the two triggers into one "library"? so that it can be configurable and usable in any other map.
Thanks
================================
Problem 1 solved : changed the text size from 10 to 0.023, Thanks to wietlol
Last edited: