• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Order a unit to defend a rect/region

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,337
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,337
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