• 🏆 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] How to make an AI attack waves like the ones in the normal campaigns

Level 5
Joined
Sep 30, 2017
Messages
52
I'm using the ai editor and i'm trying to create an ai like the ones an the base game about i can't figure out about the attack waves? like in the undead 03 mission "The Dark Lady" the Red undead base attack with some times 2 abominations or maybe 4 necromancers or Varimathras and 5 abominations. And how do the ai create all these units plus the units that are preplaced without getting the base too overloaded?
 
Level 20
Joined
Aug 29, 2012
Messages
826
In the Building tab, you need to set up everything that the AI will build like so:

1707086390742.png


Note that the AI will build those in the order you specify, so you need to be 100% sure to take tech requirements into consideration (in this case it couldn't build aboms because it doesn't have the T3 hall)

Then you create attack waves, this is an example

1707086581997.png



You'll need to tinker with the delays to make sure they don't send everything at once, and also, the numbers and unit types must match what you've set in the Building tab. If you order the AI to build 2 ghouls and attack with 3, it will never attack.

AI is stupidly logical when it comes to numbers and dependencies so double check that everything make sense
 
Level 5
Joined
Sep 30, 2017
Messages
52
I get all of that. My problem is something else; it's AI not making units to replace the ones that are in the attack group. for examble


Undead Base has 5 ghouls and 3 crypt fiends.


Wave 1: 3 ghouls and 2 crypt fiends


What I want is that the AI replace the 3 ghouls and 2 fiends that got added to the attack wave (even before they go and die). Maybe it's something to do with the conditions?
 
Level 5
Joined
Sep 30, 2017
Messages
52
I saw it in the base game campaigns: enemy AI add units to the attack group and then train to replace the preplace stuff.
 
Level 11
Joined
May 19, 2022
Messages
192
oh he is talking about the units that act as guards in base sometimes AI takes them in the attack like there 2 grunts that are guarding the camp the attack wave is 5 grunts the AI trains 3 grunts and then groups them with those 2 grunts guarding the base he then trains 2 grunts to replace those 2 guards now if you look into the campaign missions you would find that these "guards" have a trigger on them so maybe look into the campaign missions it would help ya
 
Level 18
Joined
Mar 16, 2008
Messages
721
Oh, that's not something you can do with the AI editor alone, at least I don't think. They'll rebuild once they lose units but I don't see how to make it behave as you describe :/
I think you can actually. There are two main types of wc3 ai scripts. One is Melee and the other is Campaign. @Griffith wants a campaign ai. I can't remember exactly how to change between the two types when editing a script. But I recall in one of these guides that it said Campaign-type ai scritps will simply keep units replaced.

Luckily there are some good guides on Campaign-type ai scripts:

 
Top