Carl-Fredrik
New Member
- Reaction score
- 51
Ok, so I made this trigger to make ranged units in a region hold their positions:
But for some reason it isn't working Does anyone know how to fix it?
Thanks in advance!
// Carl-Fredrik
JASS:
scope HoldPosition initializer HPInit
globals
private group GROUPPP
endglobals
//==================================================
private function HPGActions takes nothing returns nothing
call IssueImmediateOrderBJ(GetEnumUnit(), "holdposition")
endfunction
private function HPConditions takes nothing returns boolean
return IsUnitType(GetFilterUnit(), UNIT_TYPE_RANGED_ATTACKER)
endfunction
private function HPActions takes nothing returns nothing
call GroupEnumUnitsInRect(GROUPPP, gg_rct_Region_003, Condition(function HPConditions))
call ForGroup(GROUPPP, function HPGActions)
endfunction
//====================================================================================================
private function HPInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterTimerEvent(t, 1, false)
call TriggerAddAction(t, function HPActions)
endfunction
endscope
But for some reason it isn't working Does anyone know how to fix it?
Thanks in advance!
// Carl-Fredrik