Why does this code only display zeroes when a unit is attacked?
Is it good to just use scopes to be able to have private functions?
JASS:
scope ShowDamage initializer init
globals
real damage
endglobals
private function Actions takes nothing returns nothing
call CreateTextTagUnitBJ( "|cffFF0000" + I2S(R2I(damage)), GetTriggerUnit(), 0, 7.3, 100, 100, 100, 0 )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 120, 90 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 1.00 )
endfunction
//===========================================================================
private function init takes nothing returns nothing
set gg_trg_Show_Spell = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Show_Spell, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddAction( gg_trg_Show_Spell, function Actions )
set damage = GetEventDamage()
endfunction
endscope
Is it good to just use scopes to be able to have private functions?