• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[AI] Please help me

Status
Not open for further replies.

Asyrium

A

Asyrium

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?
 
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.
Back
Top