• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Getting units to guard a position.

Status
Not open for further replies.
Level 3
Joined
Feb 27, 2009
Messages
17
Hey, for my new map i was creating a defense map and i have the computer controlling the defending units. But what seems to happen is when i just place units around, they'd go off and chase enemies half-away across the map.

So what i wanted was to be able to do something like how DOTA has Roshan on that map, he'll come and charge at you, but after a short distance will run back to his exact location. Please can anyone help?
 
Level 3
Joined
Feb 27, 2009
Messages
17
  • AI - Lock guard position of (Last created unit)
That may work.

Tried it and nothing happened, btw the computer will be controlling this, its not neutral hostile or anything. Maybe there's a way to set all units for a certain player to Hold-Position on the entire map?
 
Level 3
Joined
Feb 27, 2009
Messages
17
Go to..

Advanced -> Gameplay Constants -> Creep Return Distance

I'm not sure if that works for computer players though.

You can also create a timer checking the units distance from the location,

if it's too far, make the unit run back.

Yeah none of thats working, they run back to where they all were exactly but they have a HUGE aggro radius so they charge anything. I want it how it is but to reduce their aggro radius by alot. Is there anyway to set all units belonging to 1 player to have them in a Hold-Position stance or Guard?
 
  • Untitled Trigger 001
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between (Position of (YOUR UNIT)) and (YOUR LOCATION) Greater than or equal to 500.00
        • Then - Actions
          • Unit - Order (YOUR UNIT) to Move To (YOUR LOCATION)
        • Else - Actions
That trigger leaks, just want to let you know.
 
Level 3
Joined
Feb 27, 2009
Messages
17
  • Untitled Trigger 001
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between (Position of (YOUR UNIT)) and (YOUR LOCATION) Greater than or equal to 500.00
        • Then - Actions
          • Unit - Order (YOUR UNIT) to Move To (YOUR LOCATION)
        • Else - Actions
That trigger leaks, just want to let you know.

Not sure how to do that, and if it leaks dosnt matter then. Is there anyway to just set all units of any player or AI controlled to the Hold-Position stance and stay that way the entire game?
 
Level 3
Joined
Feb 27, 2009
Messages
17
Yeah i suck at this. I cant find "(Distance between (Position of (YOUR UNIT)) and (YOUR LOCATION) Greater than or equal to 500.00" the Distance part, im in Integer Comparison and cant find the distance part. I've got the Greater than or equal to 500.00 though.
 
Level 3
Joined
Feb 27, 2009
Messages
17
Just select your unit..

YAY! Its actually working now, he'll start to charge then after a bit run straight back. Thanks +Reps

But 1 more thing if you dont mind, is there a way to change a units aggro radius. My map is a defense map so this guy will be behind a gate, but once the enemy starts attacking the gate he starts to run off then gets ordered back, then runs off again etc. Is there a way to change a units aggro radius at all?
 
Status
Not open for further replies.
Top