HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How to make an ai script work

04-02-2002, 04:32 PM#1
ShadowOrcIX
1) Choose a map (.w3m)
2) Expand it with WinMPQ or any other soft that does it
3) Open the "war3map.j"
4) Look for "MAP_CONTROL_USER";
There are two "groups" of "MAP_CONTROL_USER"s, the first group is in the function called "InitCustomPlayerSlots", the second group is in the function called "config" (at the end).
It's not hard to get that there is in each group a "SetPlayerController" call to initialize the control for a specific player (number 1, 2,...)
If you want for example to set player 2 as a computer player, just change MAP_CONTROL_USER to MAP_CONTROL_COMPUTER.
5) Make sure that the RACE_PREF of the Player Control you choose is set to RACE_PREF_HUMAN. right now the Script is for Humans. repack the map using WinMPQ again (new->file.mpq->add->the files you wanna add->close->rename the .mpq to .w3m)
6)Now Create a folder in your War 3 Folder called Scripts. Now open Notpead Copy the code from above and paste into notepad. Save that as human.ai in the Scripts folder.
04-04-2002, 08:10 AM#2
Guest
i did like it says, but in the middle of loading is errors saying it cant find the AI script
04-04-2002, 08:19 AM#3
Silent Avenger
Make sure its in the /scripts and it is named human.ai for humans.
orc.ai for orcs. nightelf.ai for nightelves and undead.ai for undead.
04-04-2002, 08:33 AM#4
Guest
ok my computer players are undead so i put a folder in the warcraft 3 folder named Scripts pasted my undead script on a notepad and named it undead.ai.

my map i got off cheatlist has 2 player slots switched to computer and in the middle of loading i get this

This application has encountered a critical error:

FATAL ERROR

Program:C:\Beta\Warcraft III Beta\War.exe
File: E:\Drive1\Temp|BuildWar3Beta\War3\Source\AI\CCompAI.cpp

Line: 203

AI script not found

press ok to terminate the application.

so what do u think?
04-04-2002, 09:17 AM#5
Silent Avenger
Well, is the map enabled for two UNDEAD computer players?
04-04-2002, 05:14 PM#6
Guest
ya it is, i have one for 1 and one for 2 I have yet to try the the one cpu one

there i tried them both same thing
04-24-2002, 01:14 PM#7
nicoli_s
Make sure when you paste it into notepad and save it you make it an ai file and not a txt file named undead.ai, make sure you save it as all files undead.ai, if that doesn't work, send me your email address, and i'll send you mine.