• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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