1. Head to the 33rd Modeling Contest Poll and drink to your heart's desire.
    Dismiss Notice
  2. Choose your means of doom in the 17th Mini Mapping Contest Poll.
    Dismiss Notice
  3. A slave to two rhythms, the 22nd Terraining Contest is here.
    Dismiss Notice
  4. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  5. The die is cast - the 6th Melee Mapping Contest results have been announced. Onward to the Hive Cup!
    Dismiss Notice
  6. The glory of the 20th Icon Contest is yours for the taking!
    Dismiss Notice
  7. 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.

Creeps not following regions with attack-ground order

Discussion in 'Triggers & Scripts' started by Esa, Nov 10, 2010.

  1. Esa

    Esa

    Joined:
    Nov 10, 2010
    Messages:
    78
    Resources:
    0
    Resources:
    0
    Hi! I've been trying to make the creeps follow a given route of regions, and made a trigger for this. For some reason, they walk to route to the first region decently, but after that they start going off in different directions; either back to the spawn point, or staying at the region, or going to the next and THEN returning. I've been experimenting with a few different settings in the trigger, to no good result. I'll post the trigger below here.


    Ghoul Move Copy
    Events
    Unit - A unit enters Scourge Base West <gen>
    Unit - A unit enters West WP7 <gen>
    Unit - A unit enters West WP6 <gen>
    Unit - A unit enters West WP5 <gen>
    Unit - A unit enters West WP4 <gen>
    Unit - A unit enters West WP3 <gen>
    Unit - A unit enters West WP2 <gen>
    Unit - A unit enters West WP1 <gen>
    Conditions
    (Owner of (Entering unit)) Equal to Player 11 (Dark Green)
    Actions
    Unit Group - Pick every unit in (Units in Scourge Base West <gen>) and do (Unit - Order (Picked unit) to Attack-Move To (Center of West WP7 <gen>))
    Unit Group - Pick every unit in (Units in West WP7 <gen>) and do (Unit - Order (Picked unit) to Attack-Move To (Center of West WP6 <gen>))
    Unit Group - Pick every unit in (Units in West WP6 <gen>) and do (Unit - Order (Picked unit) to Attack-Move To (Center of West WP5 <gen>))
    Unit Group - Pick every unit in (Units in West WP5 <gen>) and do (Unit - Order (Picked unit) to Attack-Move To (Center of West WP4 <gen>))
    Unit Group - Pick every unit in (Units in West WP4 <gen>) and do (Unit - Order (Picked unit) to Attack-Move To (Center of West WP3 <gen>))
    Unit Group - Pick every unit in (Units in West WP3 <gen>) and do (Unit - Order (Picked unit) to Attack-Move To (Center of West WP2 <gen>))
    Unit Group - Pick every unit in (Units in West WP2 <gen>) and do (Unit - Order (Picked unit) to Attack-Move To (Center of West WP1 <gen>))
    Unit Group - Pick every unit in (Units in West WP1 <gen>) and do (Unit - Order (Picked unit) to Attack-Move To (Center of Night Elf West Spawn <gen>))


    This is my trigger, and for some reason it screws up. The regions are named WP1-7, where 1 is the closest to my base, and 7 the furthest. Help very much appreciated. :)
     
  2. Esa

    Esa

    Joined:
    Nov 10, 2010
    Messages:
    78
    Resources:
    0
    Resources:
    0
    bump :)
     
  3. InfinateAnswers

    InfinateAnswers

    Joined:
    Jun 17, 2010
    Messages:
    2,262
    Resources:
    0
    Resources:
    0
    • Ghoul Move Copy
      • Events
        • Unit - A unit enters Scourge Base West <gen>
        • Unit - A unit enters West WP7 <gen>
        • Unit - A unit enters West WP6 <gen>
        • Unit - A unit enters West WP5 <gen>
        • Unit - A unit enters West WP4 <gen>
        • Unit - A unit enters West WP3 <gen>
        • Unit - A unit enters West WP2 <gen>
        • Unit - A unit enters West WP1 <gen>
      • Conditions
        • (Owner of (Entering unit)) Equal to Player 11 (Dark Green)
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Scourge Base west) contains (triggering unit)) equal to true
          • Then - Actions
            • Unit Group - Pick every unit in (Units in Scourge Base West <gen>) and do (Unit - Order (Picked unit) to Attack-Move To (Center of West WP7 <gen>))
            • Else - Actions
          • If (all conditions are true) then do (then actions) else do (else actions)
            • If - Conditions
              • ((West WP7 <gen>) contains (triggering unit)) equal to true
            • Then - actions
              • Unit Group - Pick every unit in (Units in West WP7 <gen>) and do (Unit - Order (Picked unit) to Attack-Move To (Center of West WP6 <gen>))
              • Else - actions
            • If (all conditions are true) then do (then actions) else do (else actions)
              • If - conditions
                • ((West WP6 <gen> ) contains (triggering unit)) equal to true
              • Then - actions
                • Unit Group - Pick every unit in (Units in West WP6 <gen>) and do (Unit - Order (Picked unit) to Attack-Move To (Center of West WP5 <gen>))
                • Else - actions
          • If (all conditions are true) then do (then actions) else do (else actions)
            • If - conditions
              • ((West WP5 <gen>) contains (triggering unit)) equal to true
            • Then - actions
              • Unit Group - Pick every unit in (Units in West WP5 <gen>) and do (Unit - Order (Picked unit) to Attack-Move To (Center of West WP4 <gen>))
              • Else - actions
          • If (all conditions are true) then do (then actions) else do (else actions)
            • If - conditions
              • ((West WP4 <gen>) contains (triggering unit)) equal to true
            • Then - actions
              • Unit Group - Pick every unit in (Units in West WP4 <gen>) and do (Unit - Order (Picked unit) to Attack-Move To (Center of West WP3 <gen>))
            • Else - actions
          • If (all conditions are true) then do (then actions) else do (else actions)
            • If - conditions
              • ((West WP3 <gen>) contains (triggering unit)) equal to true
            • Then - actions
              • Unit Group - Pick every unit in (Units in West WP3 <gen>) and do (Unit - Order (Picked unit) to Attack-Move To (Center of West WP2 <gen>))
              • Else - actions
            • If (all conditions are true) then do (then actions) else do (else actions)
              • If - conditions
                • ((West WP2 <gen>) contains (triggering unit)) equal to true
              • Then - actions
                • Unit Group - Pick every unit in (Units in West WP2 <gen>) and do (Unit - Order (Picked unit) to Attack-Move To (Center of West WP1 <gen>))
                • Else - actions
              • If (all conditions are true) then do (then actions) else do (else actions)
                • If - conditions
                  • ((West WP1 <gen>) contains (triggering unit)) equal to true
                • Then - actions
                  • Unit Group - Pick every unit in (Units in West WP1 <gen>) and do (Unit - Order (Picked unit) to Attack-Move To (Center of Night Elf West Spawn <gen>))
                  • Else - actions


    There fixed
     
  4. baassee

    baassee

    Joined:
    Nov 14, 2008
    Messages:
    3,220
    Resources:
    17
    Spells:
    14
    Tutorials:
    3
    Resources:
    17
    Dont do the unit group, just order the triggering unit to attack move to your "point".
     
  5. InfinateAnswers

    InfinateAnswers

    Joined:
    Jun 17, 2010
    Messages:
    2,262
    Resources:
    0
    Resources:
    0
    you could use unit group, youll get alot of leaks, so his idea is better.
     
  6. baassee

    baassee

    Joined:
    Nov 14, 2008
    Messages:
    3,220
    Resources:
    17
    Spells:
    14
    Tutorials:
    3
    Resources:
    17
    I just guessed according to the event :D
     
  7. InfinateAnswers

    InfinateAnswers

    Joined:
    Jun 17, 2010
    Messages:
    2,262
    Resources:
    0
    Resources:
    0
    My guess is he probably has a group of units, in that case unit group could be useful to move them as a whole instead of 1 by 1, but you would have to create an indexing unit group and kill that unit group and yeah...
     
  8. baassee

    baassee

    Joined:
    Nov 14, 2008
    Messages:
    3,220
    Resources:
    17
    Spells:
    14
    Tutorials:
    3
    Resources:
    17
    Not only that it leaks alot, that sure is a very bad way to do it.
     
  9. Esa

    Esa

    Joined:
    Nov 10, 2010
    Messages:
    78
    Resources:
    0
    Resources:
    0
    Thanks a great deal for the answer, and the fix! You guys are talking about something leaking, is that the fix of "InfinateAnswers" you're talking about? If it is, do you have any suggestion to prevent the leaking?

    To clarify what I am talking about here, this is almost a dota copy. Three sets of monsters spawn at three separate places, and walks three separate "lanes" to the same target.
     
  10. InfinateAnswers

    InfinateAnswers

    Joined:
    Jun 17, 2010
    Messages:
    2,262
    Resources:
    0
    Resources:
    0
    Instead of unit group, use issue order - move to region
     
  11. Esa

    Esa

    Joined:
    Nov 10, 2010
    Messages:
    78
    Resources:
    0
    Resources:
    0
    That fix appeared to solve my problem, but spawned a new problem. The monsters appear to be stopping when they reach a region. I tried to increase the size of the region, thinking that "the centre of" said region would be too small. That worked, but then they stopped at the next region, and resizing there did not cut it. Any tips? My current trigger is equal to the one up above, except I've used "triggering unit" instead of "unit group" as you said. Also, I used attack-move to "center of said region".
     
  12. InfinateAnswers

    InfinateAnswers

    Joined:
    Jun 17, 2010
    Messages:
    2,262
    Resources:
    0
    Resources:
    0
    Like we said, its leaking. The leak is causing the problem. issuing an order instead of make a unit group is ur best choice.
     
  13. Esa

    Esa

    Joined:
    Nov 10, 2010
    Messages:
    78
    Resources:
    0
    Resources:
    0
    Yes, that is true. I think I did correct that, so this is how it looks now:
    • Archers Move
      • Events
        • Unit - A unit enters Night Elf West Spawn <gen>
        • Unit - A unit enters West WP1 <gen>
        • Unit - A unit enters West WP2 <gen>
        • Unit - A unit enters West WP3 <gen>
        • Unit - A unit enters West WP4 <gen>
        • Unit - A unit enters West WP5 <gen>
        • Unit - A unit enters West WP6 <gen>
        • Unit - A unit enters West WP7 <gen>
      • Conditions
        • (Owner of (Entering unit)) Equal to Player 12 (Brown)
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Night Elf West Spawn <gen> contains (Triggering unit)) Equal to True
          • Then - Actions
            • Unit - Order (Triggering unit) to Attack-Move To (Center of West WP1 <gen>)
          • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (West WP1 <gen> contains (Triggering unit)) Equal to True
          • Then - Actions
            • Unit - Order (Triggering unit) to Attack-Move To (Center of West WP2 <gen>)
          • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (West WP2 <gen> contains (Triggering unit)) Equal to True
          • Then - Actions
            • Unit - Order (Triggering unit) to Attack-Move To (Center of West WP3 <gen>)
          • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (West WP3 <gen> contains (Triggering unit)) Equal to True
          • Then - Actions
            • Unit - Order (Triggering unit) to Attack-Move To (Center of West WP4 <gen>)
          • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (West WP4 <gen> contains (Triggering unit)) Equal to True
          • Then - Actions
            • Unit - Order (Triggering unit) to Attack-Move To (Center of West WP5 <gen>)
          • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (West WP6 <gen> contains (Triggering unit)) Equal to True
          • Then - Actions
            • Unit - Order (Triggering unit) to Attack-Move To (Center of West WP7 <gen>)
          • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (West WP7 <gen> contains (Triggering unit)) Equal to True
          • Then - Actions
            • Unit - Order (Triggering unit) to Attack-Move To (Center of Scourge Base West <gen>)
          • Else - Actions


    Did I stop the leak with this? Or is it still leaking, and how can I find out if/where and how to fix it?
     
  14. InfinateAnswers

    InfinateAnswers

    Joined:
    Jun 17, 2010
    Messages:
    2,262
    Resources:
    0
    Resources:
    0
    Nope, no leaks.
     
  15. Raven0

    Raven0

    Joined:
    Oct 16, 2010
    Messages:
    878
    Resources:
    2
    Maps:
    2
    Resources:
    2
    You're missing West WP5 to West WP6

    BTW I would reccomend making each of these a different trigger - or atleast optimizing those if/thens (put each of them in the aboves else statement)
     
  16. Esa

    Esa

    Joined:
    Nov 10, 2010
    Messages:
    78
    Resources:
    0
    Resources:
    0
    The monsters still stop at random regions. Is this something that can be caused by other trigger leaks? I have a lot of triggers in addition to the one you just fixed.

    edit: Ah, lol, thanks Raven. Will correct that then recheck this statement.

    edit2: Nope, they still stop at 2 specific regions, and only the scourge side does. The triggers are 100% identical, only refitted to suit the other faction. Only the scourge side is stopping, and that is at West WP7 and East WP4.
     
  17. baassee

    baassee

    Joined:
    Nov 14, 2008
    Messages:
    3,220
    Resources:
    17
    Spells:
    14
    Tutorials:
    3
    Resources:
    17
    Wrong it still leaks a location.

    All the "center of bla" creates a location which leaks.
     
  18. Kanadaj

    Kanadaj

    Joined:
    Oct 18, 2008
    Messages:
    1,584
    Resources:
    2
    Icons:
    2
    Resources:
    2
    Nope, it's not "a location", it's leaking at ~9 points Oo dude, use
    Code (Text):
    Set "YOUR_VARIABLE" = Center of "YOUR_REGION"
    and
    Code (Text):
    Custom script: call removeLocation(udg_"YOUR_VARIABLE") at the end of the trigger for every point
     
  19. baassee

    baassee

    Joined:
    Nov 14, 2008
    Messages:
    3,220
    Resources:
    17
    Spells:
    14
    Tutorials:
    3
    Resources:
    17
    hehe I'm just saying that it leaks ;)
     
  20. Kanadaj

    Kanadaj

    Joined:
    Oct 18, 2008
    Messages:
    1,584
    Resources:
    2
    Icons:
    2
    Resources:
    2
    I know :D But I'm in a mood to stop and argue about things like that :D