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

Wander

Status
Not open for further replies.
Level 34
Joined
Sep 6, 2006
Messages
8,873
Is there an easy way to make units wander in an area, I have a city and I don't want the wandering villagers to leave.

Right now I have regions where I do not want them to pass and I made triggers to make them go back into the middle of the city if they go into those regions. I was also wondering if the trigger leaks.

Event - A unit enters region (Entrance)

Condition - Or (Any conditions are true)
-Triggering unit is equal to Villager Male
-Triggering unit is equal to Villager Male2
-Triggering unit is equal to Villager Female
-Triggering unit is equal to Child
-Triggering unit is equal to Child2

Action - Unit - Order unit to move to center of (Middle of city)
 
Level 34
Joined
Sep 6, 2006
Messages
8,873
Sorry I am really bad with variables, I have yet to take the time to learn them.
I sort of need walking through that part. How come your Set POINT has = Center of (Middle of city <gen>), mine says just = Middle of city <gen>

Right now I have variable called POINT, it is a region type with no array. Then I made it equal to the region I am using. Then I used your custom script.\

edit: Made the I can't use the custom script, it disabled it when I saved.
 
Level 34
Joined
Sep 6, 2006
Messages
8,873
Most likely it will be all the time, not a ton of villagers, but there are more is more then one area.

Thanks Razor, +Rep!
 
Level 34
Joined
Sep 6, 2006
Messages
8,873
I did. I didn't want them to go past a boundary, I got it fixed though, thanks to Razor.
 
Status
Not open for further replies.
Top