• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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,572
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