- Joined
- Feb 4, 2008
- Messages
- 3,511
Basically, this should put a text above a units head telling the players how many bullets is left in their clip, how many bullets they have, ect. But it does not display it. The trigger runs as it shows all the "Parts" in chat correctly. Yet it displays nothing.
Globals:
The function that should show the text:
ConcerateAmmor and GetIS (Should not relevant to the problem)
Setup (Just test values for the system, shouldn't be relevant either)
Globals:
JASS:
globals
integer array PlayerClips[12][5] ///1 = clipsize, 2 = currently in clip, 3= bullets overall, 4 = bulletpertick, 5 = tick interval in seconds/10
texttag array FloatText[12][1] //1 = clip
endglobals
The function that should show the text:
JASS:
function CreateBullets takes nothing returns nothing
local integer i = 0
call DisplayTextToForce( GetPlayersAll(), "Part 2" )
loop
call DisplayTextToForce( GetPlayersAll(), "Part 3" )
set FloatText[i][1] = CreateTextTag()
call SetTextTagText(FloatText[i][1], ConcecrateAmmo(i), (15. * 0.023 * 10.0)) //ConcecrateAmmo(i) /PlayerClips[i][1]
call SetTextTagPosUnit(FloatText[i][1], udg_PlayerUnit[i+1], 60.0)
//if GetLocalPlayer() == Player(i) then
call SetTextTagVisibility(FloatText[i][1], true)
//endif
call DisplayTextToForce( GetPlayersAll(), "Part 4" ) //test
exitwhen i == 11
set i = i + 1
endloop
endfunction
ConcerateAmmor and GetIS (Should not relevant to the problem)
JASS:
function GetIs takes integer ClipSize, integer remainingBullets returns string
local string s = ""
local integer i = 0
local integer o = remainingBullets
loop
if o > 0 then
set s = s + "I"
else
set s = s + "|c00808080I|r"
endif
exitwhen i == ClipSize
set i = i + 1
set o = o -1
endloop
return s
endfunction
function ConcecrateAmmo takes integer id returns string
local string I = GetIs(PlayerClips[id][1], PlayerClips[id][2])
local string para = " (" + I2S(PlayerClips[id][2]) + "/" + I2S(PlayerClips[id][3]) + ")"
return "|cffffcc00[|r" + I + "|cffffcc00]|r" + para
endfunction
Setup (Just test values for the system, shouldn't be relevant either)
JASS:
function Trig_Untitled_Trigger_002_Actions takes nothing returns nothing
set udg_PlayerUnit[0] = gg_unit_hfoo_0001
set PlayerClips[0][1] = 4
set PlayerClips[0][2] = 2
set PlayerClips[0][3] = 75
set PlayerClips[0][4] = 1
set PlayerClips[0][5] = 10
endfunction