AI Help

Asyrium

New Member
Joined
Dec 20, 2005
Messages
1
Reaction score
0
Ok, I am working on a amp where units spawn, and I need them to look for your hero in the map, instead of just walking around patroling. 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?:usad
 

PTS

Member
Joined
Nov 16, 2005
Messages
9
Reaction score
0
Good ol' Star Craft used to have a "Set Computer Players to random suicide mission" AI script, wich sends all units attacking the player (workers too). No idea if WarCraft has such a script. You can optionally have a trigger to keep a location centered on the hero at all times and another trigger to order spawned creatures to attack at that location.
 

Father_Chaos

BattleForums Member
Joined
Nov 23, 2005
Messages
364
Reaction score
0
Yeah, do something like:
Code:
[I]Events[/I]
Each x seconds of game time (or whatever you want, you could also do that when the units spawn it fires this trigger.)

[I]Actions[/I]
Pick every units in (Playable Map Area) and do:
If (Owner of Picked units) is equal to (Player x) and Unit Type of (Picked units) is equal to Hero
Then Order (All units owned by Player y) attack (Picked units)
Else Do nothing
I did it without the editor, and it would work only with one enemy hero. It's still pretty easy to do, just use your brain a bit ;).
 

x42bn6

Retired Staff
Joined
Nov 11, 2002
Messages
15,150
Reaction score
2
Location
London, United Kingdom
If you want them to be 'intelligent', then you have to use complicated algorithms. Basically involving selecting a random area where the hero is likely to be, such as a large unexplored area.

If you want them to be 'stupid', then use:

~ Create a region then create a variable for it. I'll call the variable Explore.
~ Put your units inside a unit group and create a variable for it. I'll call the variable Creep.

Events:
Generic Unit Event - Unit enters region
Generic Unit Event - Unit enters [Explore]​

Conditions:
Boolean Comparison - [Player of [Entering Unit] = [Whatever the player of the creeps is]]
Boolean Comparison - [[Entering Unit] is in [Creep]]

Actions:
Region - Move Region
Region - Move [Explore] to [Random point at [A larger region where the hero is? The entire map? You decide]]​
Pick every unit in [Creep] and do actions

Unit Group - Order units to do action targeting a point (?)
Unit Group - Order [Picked Unit] to [Attack-move] to [Explore]​

Or something like that.*
 

NewPosts

New threads

Top