• 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] Creeps attacking / wondering everywhere

Status
Not open for further replies.
Level 5
Joined
Mar 21, 2007
Messages
155
HI, i'm making a sort of survival map where players run to a *base* and survive in it. but there are problems with my creeps...

1: How do i make it so that the creeps just randomly wonder the whole map in an attempt to find player's bases? i'm gonna spawn quite a lot of creeps..

2: when a creep finds a players base, they will obviously start attacking the closest thing (wall). but if a tower starts attacking the creep then it will almost *take agro* and the creep will continuously try to go toward it, but its melee and its too stupid to kill the wall first. how do i get around that?

i have never used the AI or anything, no idea how it works, but i guess this may come under it??

help appreciated, ty =D
 
Level 25
Joined
Jun 5, 2008
Messages
2,573
Try this method:

  • Event - Every x seconds of game
  • Conditions
  • Actions
    • Set variable *temp_unit_group* = Units in playable map area with condition Matching unit type equal = *your_unit_type*
    • Set variable *temp_region* = playable map area*
    • Set variable *random_point* = random point in *temp_region*
    • Unit pick every unit in *temp_unit_group* and do actions
      • Loop actions
        • Order picked unit to attack-move to *random_point*
    • custom script: call DestroyGroup(udg_*temp_unit_group*)
    • custom script: Call RemoveLocation(udg_*random_point*)
 
Level 5
Joined
Sep 13, 2008
Messages
165
About the tower problem, I'm not sure, but maybe it has something to do with priority, maybe if you set the priority of the wall above that of the tower, the creep will continue to attack the wall.

The Priority is found in the units stats near hit points, or mana points
 
Status
Not open for further replies.
Top