- Joined
- Mar 23, 2008
- Messages
- 942
When I create neutral units and order them to walk somewhere, they just come back to base after walking a few steps! Is there any way to fix it?
My current trigger:
The
call SetUnitCreepGuard(tempunit,true)
call SetUnitCreepGuard(tempunit,false)
was just a test to see if it does something, nothing happened at all...
My current trigger:
JASS:
local unit tempunit
local real x = GetRectCenterX(gg_rct_TeamA_Down)
local real y = GetRectCenterY(gg_rct_TeamA_Down)
local real x2 = GetRectCenterX(gg_rct_1)
local real y2 = GetRectCenterX(gg_rct_1)
local integer i = 0
//=================== TeamA Down ===================
if ( Trig_Creep_Spawn_FuncTAD() ) then
set tempunit = CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'h01Y', x, y, 270)
call IssuePointOrder(tempunit, "attack", x2, y2)
call BJDebugMsg(GetUnitName(tempunit))
call SetUnitColor(tempunit, PLAYER_COLOR_RED)
call RemoveGuardPosition(tempunit)
call SetUnitCreepGuard(tempunit,true)
set tempunit = CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'h01Y', x, y, 270)
call IssuePointOrder(tempunit, "attack", x2, y2)
call SetUnitColor(tempunit, PLAYER_COLOR_RED)
call RemoveGuardPosition(tempunit)
call SetUnitCreepGuard(tempunit,false)
call SetUnitUserData(tempunit, 1)
loop
set tempunit = CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'h01X', x, y, 270)
call IssuePointOrder(tempunit, "attack", x2, y2)
call SetUnitColor(tempunit, PLAYER_COLOR_RED)
set tempunit = CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'h01X', x, y, 270)
call IssuePointOrder(tempunit, "attack", x2, y2)
call SetUnitColor(tempunit, PLAYER_COLOR_RED)
call SetUnitUserData(tempunit, 1)
set i = i + 1
exitwhen (i == 3)
endloop
else
endif
The
call SetUnitCreepGuard(tempunit,true)
call SetUnitCreepGuard(tempunit,false)
was just a test to see if it does something, nothing happened at all...