Units Returning to Previous Region

Skasian

New Member
Reaction score
1
I've tried searching the forums with no luck for this question.

AndrewGosu wrote a TD-guide and in it he specified to set the following:

dist.jpg


I've done this (and tried setting it to 99999 as well), however when my units move from Region1 to Region2, upon reaching there. They turn around and walk back to Region1 again?

The three events are regions that I want my creeps to move to one after another. But after entering the second region they return to the first one again.

Regionright is a region-array btw. (it's very similar to the coding AndrewGosu wrote in his TD-guide)

Z5lXX.jpg


The strange thing is that Ghouls and Shades do not do this, all other units do. Why?

I cannot explain this behaviour, can anyone shed some light? How can I prevent this from happening?

:)
 

Grags_1977

Ultra Cool Member
Reaction score
32
I allways get this problem when setting up patrols. Hostile units allways want to return home, back to where they were orginally placed. I've never been able to figure out why.

My workaround has allways been a periodic trigger that forces them to carry on the path.

This is one example

Trigger:
  • Variables
    • Events
    • Conditions
    • Actions
      • Set Region_DesertGuardPatrol[1] = DesertGuard01 <gen>
      • Set Region_DesertGuardPatrol[2] = DesertGuard02 <gen>
      • Set Region_DesertGuardPatrol[3] = DesertGuard03 <gen>
      • Set Region_DesertGuardPatrol[4] = DesertGuard04 <gen>
      • Set Region_DesertGuardPatrol[5] = DesertGuard05 <gen>
      • Set Region_DesertGuardPatrol[6] = DesertGuard06 <gen>
      • Set Region_DesertGuardPatrol[7] = DesertGuard07 <gen>
      • Set Region_DesertGuardPatrol[8] = DesertGuard08 <gen>
      • Set Region_DesertGuardPatrol[9] = DesertGuard09 <gen>
      • Set Region_DesertGuardPatrol[10] = DesertGuard10 <gen>
      • Set Region_DesertGuardPatrol[11] = DesertGuard11 <gen>
      • Set Region_DesertGuardPatrol[12] = DesertGuard12 <gen>
      • Set Unit_Guard[1] = Desert Guard 0004 <gen>
      • Set Unit_Guard[2] = Desert Guard 0006 <gen>
      • Set Unit_Guard[3] = Desert Guard 0009 <gen>
      • Set Unit_Guard[4] = Desert Guard 0008 <gen>
      • Set Integer_GuardRegion[1] = 2
      • Set Integer_GuardRegion[2] = 5
      • Set Integer_GuardRegion[3] = 8
      • Set Integer_GuardRegion[4] = 11


Trigger:
  • Desert Guard
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Set Integer_GuardRegion[(Integer A)] = (Integer_GuardRegion[(Integer A)] + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_GuardRegion[(Integer A)] Equal to 13
            • Then - Actions
              • Set Integer_GuardRegion[(Integer A)] = 1
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Boolean_GuardIsBusy[(Integer A)] Equal to False
            • Then - Actions
              • Set TempPoint[10] = (Center of Region_DesertGuardPatrol[Integer_GuardRegion[(Integer A)]])
              • Unit - Order Unit_Guard[(Integer A)] to Attack-Move To TempPoint[10]
              • Custom script: call RemoveLocation( udg_TempPoint[10] )
            • Else - Actions




EDIT: A little heads up. I've noticed you've used an image to show your triggers. You can actually just post the triggers directly here in wc3 tags.

Example:

wc3tags.jpg
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top