• 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.

Order a unit to defend a rect/region

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,338
Hi,

Is there a way to make a unit instance owned by a computer player aggressively defend a region/rect?

By this I mean, the unit instance would perform search and destroy inside this rect. If there are no enemy units in the rect, then the unit just does nothing.
 
2rmktcg.png


Here you go
 
Level 15
Joined
Aug 7, 2013
Messages
1,338
I guess that would work.

Though the Knight would miss sometimes, wouldn't he?

i.e. the knight should target each unit in the region/rect (search + destroy) versus patrol.
 
I guess that would work.

Though the Knight would miss sometimes, wouldn't he?

i.e. the knight should target each unit in the region/rect (search + destroy) versus patrol.


He will patrol the random point every 10.00 seconds in Castle <region>, he will auto attack anything that he encounters as an enemy. If you want him to be harder to bypass you can increase his line of sight/ attack radius.
 

EdgeOfChaos

E

EdgeOfChaos

Pick every unit in the region that is an enemy
if those units exist, order the guard to attack it
if not, order the guard to move randomly in the region.
 
Status
Not open for further replies.
Top