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

[AI] Please help me

Status
Not open for further replies.
Level 2
Joined
Dec 20, 2005
Messages
6
Ok, I am working on a map where units spawn in different locations, and I need them to look for your hero(so they can attack it) in the map, instead of just walking around patroling for the hero. My friend said that I have to do saome AI work, so I opened it and I didn't know what the heck I had to do.

Can someone help me? Please?
 
Level 19
Joined
Apr 25, 2006
Messages
1,309
Maybe you could make it easier without an AI.
Here is the idea:
When you summon a creature: Add it to a unit group called for example Unit_Group_Wanderers. Remove the units guard position under AI action section and order it to move to a random point in playable map area.

Then add events like periodic event after every X seconds. Actions in this event are: Pick every unit in unit group Unit_Group_Wanderers. Loop: Order picked unit to attack-move to a random point in playable area.

When a spawned unit acquires the player do this: Remove the unit from Unit_Group_Wanderers and add it to Unit_Group_Attackers.

Then another trigger: Periodic event. Actions: Pick every unit in Unit_Group_Attackers: Loop: order picked unit to attack-move to position of the player's hero.

This works best if the player has only one unit. With more player controlled units this needs to be improved more. Hope this helped you out. :D
 
Status
Not open for further replies.
Top