Code:
globals
trigger gg_trg_b =null
trigger gg_trg_a = null
endglobals
function Trig_a_Func001A takes nothing returns nothing
call TriggerRegisterUnitEvent( gg_trg_b, GetEnumUnit(),EVENT_UNIT_DAMAGED )
endfunction
function Trig_a_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsInRectAll(GetPlayableMapRect()), function Trig_a_Func001A )
endfunction
function InitTrig_a takes nothing returns nothing
set gg_trg_a = CreateTrigger( ) //map initialization
call TriggerAddAction( gg_trg_a, function Trig_a_Actions )
endfunction
function Trig_b_Actions takes nothing returns nothing
call DisplayTimedTextToForce( GetPlayersAll(), 10.00, ( GetUnitName(GetEventDamageSource()) + ( "Damage is" + R2S(GetEventDamage()) ) ) )
endfunction
function InitTrig_b takes nothing returns nothing
set gg_trg_b = CreateTrigger( )
call TriggerAddAction( gg_trg_b, function Trig_b_Actions )
endfunction
function Trig_c_Actions takes nothing returns nothing
call TriggerRegisterUnitEvent( gg_trg_b, GetEnteringUnit(), EVENT_UNIT_DAMAGED )
endfunction
function InitTrig_c takes nothing returns nothing
local trigger gg_trg_c =null
set gg_trg_c = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_c, GetPlayableMapRect() ) //register event for the EnteringUnit
call TriggerAddAction( gg_trg_c, function Trig_c_Actions )
set gg_trg_c =null
endfunction
,i wonder when a unit enters PlayableMapRect,it will be registered in the
trigger gg_trg_c ,if i have several thousand units, will it make a lag??
Last edited: