Squeekems
TH.net Regular
- Reaction score
- 11
I am using the event [ljass]Unit - A unit Begins construction[/ljass] to make this trigger work. I realized I need to refer to the worker unit that is doing the construction. How would I do that?
// this condition filters the orders
function Trig_get_builder_Conditions takes nothing returns boolean
return GetIssuedOrderId() > 1500000000 // 'e000' = 1_694_498_816 so I think 1_500_000_000 is good enough
endfunction
function Trig_get_builder_Actions takes nothing returns nothing
call BJDebugMsg("builder: " + GetUnitName(GetTriggerUnit())) // builder: peasant, wisp, peon or acolyte
endfunction
//===========================================================================
function InitTrig_get_builder takes nothing returns nothing
set gg_trg_get_builder = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_get_builder, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
call TriggerAddCondition( gg_trg_get_builder, Condition( function Trig_get_builder_Conditions ) )
call TriggerAddAction( gg_trg_get_builder, function Trig_get_builder_Actions )
endfunction