[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