• 🏆 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!

[AI] Need help with Naga Campaign AI

Status
Not open for further replies.
Level 1
Joined
Apr 6, 2009
Messages
5
I've made a Naga Ai for my campaign map but it dosn't build
 

Attachments

  • AI Script.jpg
    AI Script.jpg
    91.9 KB · Views: 1,544
Level 4
Joined
Nov 23, 2007
Messages
113
To the right of your screen you have posted, it should say "Gold worker" and "Lumber worker". Make sure it is set to Mur'gul Slave.
 
Level 1
Joined
Apr 6, 2009
Messages
5
I got halfway through the post when my internet crashed. I have set the gold and lumber to murgulm slave and they build upto the shrine azara but not the expansion then build lots of coral beds
 
Level 4
Joined
Nov 23, 2007
Messages
113
That's because you're asking the AI to build in a town that doesn't exist. A bug in the AI will have it build an infinite number of units if the town in which you request the units to be built is not a town considered "owned" by the AI.

Always add a condition that the town has a townhall and a mine before building anything else there.

Additionally, the way you have it scripted, your expansion town hall will never be rebuilt if it is destroyed. So you need to add on the second line there to build a 2nd Temple of Tides (and a 3rd if you expect to have 3 expansions going). These should be built in town# order. That is, your first town hall should be built at town 0 (Main), the 2nd at town 1 (Exp1 in the editor), and 3rd at town 2 (Exp2 in the editor), etc. All with the condition that that town has a mine (otherwise, you will build the townhall for no real purpose)

As for it not building the expansion... The above may fix that. I haven't used the AI editor in a long time (I use jass) so I don't remember the code produced for the town, but for your expansion, set the Build Expansion Town to "Any" rather than Exp1 (because Exp1 will change as each mine is depleted).
 
Last edited:
Level 1
Joined
Apr 6, 2009
Messages
5
I got it working by increasing the starting rescources for the AI. But how do i make it so it would rebuild the expansion if destroyed?
 
Level 4
Joined
Nov 23, 2007
Messages
113
At the top of your list:

Temple of Tides main
Temple of Tides exp1
Temple of Tides exp2
....

Then the rest of your build order. Add a condition that the town has a mine, the town doesn't have a Temple of Tides, and you have at least 1 worker to build it.

Edit: fwiw, If you know jass from working with triggers, you will find it much easier to work with the actual ai file in jass than the AI editor.
 
Level 4
Joined
Nov 23, 2007
Messages
113
Not really. The commands for AI scripting are not documented anywhere plus you AI behaviour has some features that are not completely clear, but important.

Sorry, I'm not sure how that makes working in the AI editor easier than jass? The native commands for the AI are "documented" in the common.ai file as much as the functions in say, common.j or blizzard.j are documented (when switching from the WE to jass).

My point is the editor is very limited and time consuming and if you already know jass, it's quicker and easier to just write your own code (there are many examples, such as common.ai, human.ai, elf.ai, orc.ai, undead.ai, and the exported scripts from the AI editor - which is much like converting triggers to text with respect to learning it).
 
Status
Not open for further replies.
Top