Wc3C.net

Wc3C.net (http://www.wc3c.net/forums.php)
-   Tutorials for beginners (http://www.wc3c.net/forumdisplay.php?f=651)
-   -   Melee AI Importing (http://www.wc3c.net/showthread.php?t=86893)

Av3n 08-30-2006 08:24 AM

Melee AI Importing
 
1 Attachment(s)
This is about how to import melee AI's (Artificial Intelligence) to melee maps. Its pretty easy. There is the .wai files and .ai files. Theres a example map that can be downloaded.

The Difference
The difference is that .wai files are edited using the WE AI editor which could be time cosuming clicking all over the place, also if you wanted an custom AI you will have to import your maps object data. After fnishing the AI the editor will generate an .ai file for you, which contains the final AI that will be used by the map.

.ai files can also be manually edited with Notepad/JassCraft. They're written in JASS and allow for much more powerful AI scripts than possible in the GUI editor (see the AMAI project). However it isn't always necessary to write the JASS from scratch. You can also generate an .ai file with the GUI edtior and later add a few teweaks manually.

AI importing

Contents
1. Importing the AI
2. Starting the AI
3. Other things
4. Seeing if it works

1. Importing the AI
How do I import the .wai or .ai file?
1. Open the Import Manager.
2. Click on the import button.
3. Find the AI you want to import.
4. Import it.
In my case the AI's I've imported are the Blizzard ones that came along. (WyrmMonger.)

2. Starting the AI
How do I start the .wai or .ai file?
1. Remove the Action from the default trigger:
Trigger:
Actions
Melee Game - Run melee AI scripts (for computer players)
2. Now create a new trigger called: WyrmMonger Initialization for example.
3. Add these
Trigger:
WyrmMonger Initialization
Collapse Events
Time - Elapsed game time is 0.00 seconds
Collapse Conditions
(Race of Player 2 (Blue)) Equal to Undead
Collapse Actions
AI - Start melee AI script for Player 2 (Blue): war3mapImported\WyrmMonger.ai

3. Other
The other triggers if you are only using 1 race.
1. These are the other triggers.
Trigger:
Normal Initialization
Collapse Events
Time - Elapsed game time is 0.00 seconds
Collapse Conditions
(Race of Player 1 (Red)) Not equal to Undead
(Race of Player 2 (Blue)) Not equal to Undead
Collapse Actions
Melee Game - Run melee AI scripts (for computer players)


4. Seeing if it works
Now to see if the .wai or .ai file it works on the map.
1. Open the Frozen Throne, then the map you imported the AI on.
2. Make the computer to the race on what melee AI you made for it. (WyrmMonger is Undead.)

Also note that the .wai file only contains the GUI definitions of your AI. It isn't required by the game, only by the editor. So after having finished your map, and imported the .ai file, you can remove the .wai file from your map. But you should consider keeping a backup of that .wai somewhere on your harddrive in case you'd like to make edits later.

It should work,but if it doesn't you might of have setted the wrong race or for the condition. The method is very similar. Remember its only works for melee related maps.

-Av3n

PitzerMike 09-10-2006 06:44 PM

This is well written and the triggers + demo map are good.
However, i feel this is a bit small for a tutorial.

Have you ever imported jass ai files (that is files with the .ai extension, not .wai)?
If that's the case you could expand the tutorial on those. For example show how to import an AMAI script.

If not, this can probably be approved for the beginners section.

Av3n 09-11-2006 06:27 AM

I'll see pitzermike, to that about the amai scprits to import them. (P.S don't approve yet wait for me to finish how to improt amai scprits first please.)

PitzerMike 09-11-2006 06:49 PM

Cool :)

Av3n 09-12-2006 08:38 AM

Please point out anything you find wrong PitzerMike. (I found out the method is very similar.)

PitzerMike 09-13-2006 03:07 AM

Yeah, looks good. Now at the beginning of the tutorial you should explain what the difference between wai/ai files is. Namely that the first one are made in GUI AI editor, whereas the .ai files are JASS-coded with a text editor.

Oh, and we have a rule about color tags. They shouldn't be used because they can hardly be seen on certain forum themes. If you could use italic or bold instead of colors that would be nice.

Other then that i think we can soon approve this. Good work!

Av3n 09-13-2006 05:09 AM

So should I explain triggers in Jass as well huh?. The .ai section is basically a mimic for the first one so I've removed it. I will do the explaination as well

Av3n 09-16-2006 08:36 AM

Any replies? It is all finished now. Please point outr if anything is wrong.

PitzerMike 09-18-2006 08:30 PM

Ok, I've added a few bits here and there (for example the.wai file isn't required by the game, so it can be removed from the map when it's finished).

Approved! :)

Av3n 09-18-2006 11:31 PM

Yay it is approved!

keniff_ca 04-22-2007 01:05 PM

THANKS
 
i wanted to take the time to thank Av3n for this tutorial its helped me alot:emote_thumbup: im just learning how to use the ai and dont know much.
beginners should start here and take there time rushing makes it not work.
THANKS

guillesime 12-10-2007 08:24 AM

can you help me?

I was create a mele AI for personalized race, and the structures donīt train units and heroes

moraru.cosmin1981 02-01-2015 08:43 PM

hi !

i have a custom race - the naga, as a selectable race

to select it, one must choose Night Elf --> set handicap at 90%

how do i make the computer player (which i have set up via night elf-> 90% handicap) which is now a Naga race, play the custom ai script ?


All times are GMT. The time now is 07:43 PM.

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services