Unit following/stopping

themare

New Member
Reaction score
1
Hey I need some help with some triggers

How do i make it so when unit A enters a region, it makes unit B (neutral controlled) follow unit A forever? I've already tried a trigger to make unit B Follow unit A, but unit B, which is neutral controlled, only follows a short distance and then moves back to its original spot.

Also, I need another trigger that makes unit B stop following and run away back to the region that it was found when unit A attacks unit B

Please reply with WC3 GUI tags
thankyou
 

Jayykob

New Member
Reaction score
1
The also question is easier:
Code:
Event
   A unit is attacked

Condition
   Attacked unit equal to unitB
   Attacking unit equal to unitA

Action
   Order unitB to move to center of (B's Region)
:thup: That is pretty simple.
I'll try to figure out the first question when I come home ;)
 

Cold

New Member
Reaction score
4
Code:
Following
    Events
        Unit - A unit enters (Your Region)
    Conditions
        (Triggering unit) Equal to (Unit A)
    Actions
        Unit - Order (Unit B) to Follow (Unit A)
        Trigger - Turn on Follow Periodic <gen>

Code:
Follow Periodic
    Events
        Time - Every 2.00 seconds of game time
    Conditions
        ((Unit A) is alive) Equal to True
        ((Unit B) is alive) Equal to True
    Actions
        Unit - Order (Unit B) to Follow (Unit A)

Code:
Run Away
    Events
        Unit - A unit Is attacked
    Conditions
        (Attacking unit) Equal to (Unit A)
        (Attacked unit) Equal to (Unit B)
    Actions
        Unit - Order (Unit B) to Move To (Center of (Your Region))
        Trigger - Turn off Follow Periodic <gen>
 
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