i have tried to find a trigger/s to perform the above but cant seem to find or understand so I created a set of trigs to move ai units.
the non hero units enter via dark portal ability cast by the hero, then after attacking nearby enemy they would be standing around.
the hero units of the same owner have their own move trigger.
so is the following correct?
all trigs are gui converted to text
the cycle is 30 secs - too fast?
any leaks to fix?
the non hero units enter via dark portal ability cast by the hero, then after attacking nearby enemy they would be standing around.
the hero units of the same owner have their own move trigger.
so is the following correct?
-
function Trig_move_along_start_Conditions takes nothing returns boolean
-
if ( not ( IsUnitType(GetEnteringUnit(), UNIT_TYPE_HERO) == false ) ) then
-
return false
-
-
endif
-
if ( not ( GetOwningPlayer(GetEnteringUnit()) == Player(6) ) ) then
-
return false
-
-
endif
-
return true
-
-
endfunction
-
function Trig_move_along_start_Actions takes nothing returns nothing
-
call GroupAddUnitSimple( GetEnteringUnit(), udg_movegroup )
-
-
endfunction
-
//===========================================================================
-
function InitTrig_move_along_start takes nothing returns nothing
-
set gg_trg_move_along_start = CreateTrigger( )
-
call TriggerRegisterEnterRectSimple( gg_trg_move_along_start, GetPlayableMapRect() )
-
call TriggerAddCondition( gg_trg_move_along_start, Condition( function Trig_move_along_start_Conditions ) )
-
call TriggerAddAction( gg_trg_move_along_start, function Trig_move_along_start_Actions )
-
-
endfunction
-
function Trig_move_along_Conditions takes nothing returns boolean
-
if ( not ( CountUnitsInGroup(udg_movegroup) > 0 ) ) then
-
return false
-
-
endif
-
return true
-
-
endfunction
-
function Trig_move_along_Actions takes nothing returns nothing
-
call GroupPointOrderLocBJ( udg_movegroup, "attack", GetRectCenter(gg_rct_EndArchimondeAtTree01) )
-
-
endfunction
-
//===========================================================================
-
function InitTrig_move_along takes nothing returns nothing
-
set gg_trg_move_along = CreateTrigger( )
-
call TriggerRegisterTimerEventPeriodic( gg_trg_move_along, 30.00 )
-
call TriggerAddCondition( gg_trg_move_along, Condition( function Trig_move_along_Conditions ) )
-
call TriggerAddAction( gg_trg_move_along, function Trig_move_along_Actions )
-
-
endfunction
-
function Trig_move_along_idle_Conditions takes nothing returns boolean
-
if ( not ( CountUnitsInGroup(udg_movegroup) > 0 ) ) then
-
return false
-
-
endif
-
if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ("none") ) ) then
-
return false
-
-
endif
-
return true
-
-
endfunction
-
function Trig_move_along_idle_Actions takes nothing returns nothing
-
call GroupPointOrderLocBJ( udg_movegroup, "attack", GetRectCenter(gg_rct_EndArchimondeAtTree01) )
-
-
endfunction
-
//===========================================================================
-
function InitTrig_move_along_idle takes nothing returns nothing
-
set gg_trg_move_along_idle = CreateTrigger( )
-
call TriggerRegisterTimerEventPeriodic( gg_trg_move_along_idle, 30.00 )
-
call TriggerAddCondition( gg_trg_move_along_idle, Condition( function Trig_move_along_idle_Conditions ) )
-
call TriggerAddAction( gg_trg_move_along_idle, function Trig_move_along_idle_Actions )
-
-
endfunction
all trigs are gui converted to text
the cycle is 30 secs - too fast?
any leaks to fix?