Neutral Units Comming Back

Status
Not open for further replies.
Level 12
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:

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...
 
Make the units player 12 (brown) or something, instead of a neutral player.

I believe that fixes the problem.
I can't.

There is just two ways to solve it:

- Make the neutral act like a player, without the stupid AI, no guard position or fleeing from towers
- Give the units to a player but makes it unable to benefit from it, no bounty for buildings or units killed by it, and no control. (I think that is easier with a ward unit)

I would appreciate any help in any of the solutions. ^^
 
Status
Not open for further replies.
Back
Top