gjcraig
New Member
- Reaction score
- 2
Ok so im looking at the triggers in my footmen vs grunts map and I notice for each unit you research it has 5 triggers - one original and 4 copies - which makes sense because there are 5 players on each team. BUT, do you really need 5 triggers ? Couldn't you have 1 trigger for the 5 players that use it ?
Heres is an example
The original trigger.
function Trig_Summon_Chimaera_Conditions takes nothing returns boolean
if ( not ( GetResearched() == 'R00H' ) ) then
return false
endif
return true
endfunction
function Trig_Summon_Chimaera_Actions takes nothing returns nothing
call EnableTrigger( gg_trg_Bring_Chimaera )
endfunction
//===========================================================================
function InitTrig_Summon_Chimaera takes nothing returns nothing
set gg_trg_Summon_Chimaera = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Summon_Chimaera, gg_unit_edob_0024, EVENT_UNIT_RESEARCH_FINISH )
call TriggerAddCondition( gg_trg_Summon_Chimaera, Condition( function Trig_Summon_Chimaera_Conditions ) )
call TriggerAddAction( gg_trg_Summon_Chimaera, function Trig_Summon_Chimaera_Actions )
endfunction
Here is a copy each one has 4 copies.
function Trig_Summon_Chimaera_Copy_Conditions takes nothing returns boolean
if ( not ( GetResearched() == 'R00H' ) ) then
return false
endif
return true
endfunction
function Trig_Summon_Chimaera_Copy_Actions takes nothing returns nothing
call EnableTrigger( gg_trg_Bring_Chimaera_Copy )
endfunction
//===========================================================================
function InitTrig_Summon_Chimaera_Copy takes nothing returns nothing
set gg_trg_Summon_Chimaera_Copy = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Summon_Chimaera_Copy, gg_unit_edob_0027, EVENT_UNIT_RESEARCH_FINISH )
call TriggerAddCondition( gg_trg_Summon_Chimaera_Copy, Condition( function Trig_Summon_Chimaera_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Summon_Chimaera_Copy, function Trig_Summon_Chimaera_Copy_Actions )
endfunction
Heres is an example
The original trigger.
function Trig_Summon_Chimaera_Conditions takes nothing returns boolean
if ( not ( GetResearched() == 'R00H' ) ) then
return false
endif
return true
endfunction
function Trig_Summon_Chimaera_Actions takes nothing returns nothing
call EnableTrigger( gg_trg_Bring_Chimaera )
endfunction
//===========================================================================
function InitTrig_Summon_Chimaera takes nothing returns nothing
set gg_trg_Summon_Chimaera = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Summon_Chimaera, gg_unit_edob_0024, EVENT_UNIT_RESEARCH_FINISH )
call TriggerAddCondition( gg_trg_Summon_Chimaera, Condition( function Trig_Summon_Chimaera_Conditions ) )
call TriggerAddAction( gg_trg_Summon_Chimaera, function Trig_Summon_Chimaera_Actions )
endfunction
Here is a copy each one has 4 copies.
function Trig_Summon_Chimaera_Copy_Conditions takes nothing returns boolean
if ( not ( GetResearched() == 'R00H' ) ) then
return false
endif
return true
endfunction
function Trig_Summon_Chimaera_Copy_Actions takes nothing returns nothing
call EnableTrigger( gg_trg_Bring_Chimaera_Copy )
endfunction
//===========================================================================
function InitTrig_Summon_Chimaera_Copy takes nothing returns nothing
set gg_trg_Summon_Chimaera_Copy = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Summon_Chimaera_Copy, gg_unit_edob_0027, EVENT_UNIT_RESEARCH_FINISH )
call TriggerAddCondition( gg_trg_Summon_Chimaera_Copy, Condition( function Trig_Summon_Chimaera_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Summon_Chimaera_Copy, function Trig_Summon_Chimaera_Copy_Actions )
endfunction