• 🏆 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!

Units that are spawned needs to be told to walk around.. how?

Status
Not open for further replies.
Level 4
Joined
Jul 18, 2008
Messages
76
If you know how Orc Gladiators map looks like, you will understand this immediatly.

I got 3 spawns of creeps in a small map, what i need them to do is to walk around in this arena, searching for the surviving players.

How can i make this?

+rep for the helping hand :)
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
You could create some regions in the map, and order the spawned units to attack-move to random point in some other region.

Save the regions into an array. When unit enters any of the regions, order it to move to a random point in random region.

Set integer = random number between 0 and *number of regions*
Temp_Point = random point in region_array[temp_integer]
Order *unit* to attack move to Temp_Point
Custom Script: call RemoveLocation(udg_Temp_Loc)

Check that the oredered region isn't the same as the current region.

You can also add some logic there for the movement, divide the regions to different arrays, randomize the arrays and then the regions. This can be used to make the unit move to the regons that are closer, not immediately to the other side of the map.
 
Level 4
Joined
Jul 18, 2008
Messages
76
cant i order the spawned units to attack random hostile units within a region that covers the whole arena?
 
Level 4
Joined
Jul 18, 2008
Messages
76
well they are supposed to know where the hostiles are so maybe that's what i need =) thx!
 
Status
Not open for further replies.
Top