1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Neutral Units Comming Back

Discussion in 'Triggers & Scripts' started by Saishy, Oct 29, 2009.

  1. Saishy

    Saishy

    Joined:
    Mar 23, 2008
    Messages:
    947
    Resources:
    0
    Resources:
    0
    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:

    Code (vJASS):
       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...
     
  2. TriggerHappy

    TriggerHappy

    Code Moderator

    Joined:
    Jun 23, 2007
    Messages:
    3,667
    Resources:
    22
    Spells:
    11
    Tutorials:
    2
    JASS:
    9
    Resources:
    22
    Make the units player 12 (brown) or something, instead of a neutral player.

    I believe that fixes the problem.
     
  3. Saishy

    Saishy

    Joined:
    Mar 23, 2008
    Messages:
    947
    Resources:
    0
    Resources:
    0
    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. ^^
     
  4. Coolty44

    Coolty44

    Joined:
    Dec 10, 2008
    Messages:
    576
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Well, I've seen it done before, but it needed alot of game constant changing that I can't remeber. Look around here, I do believe theres a thread that discribes it
     
  5. Saishy

    Saishy

    Joined:
    Mar 23, 2008
    Messages:
    947
    Resources:
    0
    Resources:
    0
    Uhm, the main problem is that there is creep camps.
    Changing the game play constants make neutral hostile a little... too much hostile... (neutral base rush!)
     
  6. Adiktuz

    Adiktuz

    Joined:
    Oct 16, 2008
    Messages:
    9,674
    Resources:
    23
    Models:
    2
    Packs:
    1
    Maps:
    1
    Spells:
    16
    Tutorials:
    1
    JASS:
    2
    Resources:
    23
    there's a value in the Gameplay->Constants that is something like "Creep Camp Call Back Range" I think thats the name, try changing it to something larger coz I don't know what wil happen if you put 0, I think the default value is 600.