Put the different tools where you find it convenient, personnally I use
a tool folder
in Starcraft directory, put each tool in each own sub-folder.
Your tool repository will look like that after installing all the tools.
Note:
If you move the Tools folder after installing the tools, you will have
to manually edit the configuration files.
List of the tools to use:
Script compiler: Used to
transform your scripts -
text files - into .bin files and vice versa. There are 2 different
script compilers: ScAIEdit and PyAI. I use PyAI, error finding works
better in it and there are many nice functionnalities, the
main aspect missing
for now is a documentation of different scripting commands.
PyAI: http://www.broodwarai.com/forums/index.php?showtopic=285
This version has a GUI (Graphic User Interface). You will need to
download and install python.
The python version I used is the 2.5.2. After installing python,
extract the
PyMSwithPyAIGUI.zip in a folder, for instance in "C:\PyMS\". Avoid
using space in the name, normally you won't need command line but...
Now double-click on PyAI.pyw in PyAIwithPyAIGUI folder, a python window
will open. If it works, that's fine. If not, check here.
Download the other required files on the same page as well - when this
tutorial was written:
Visual Basic 4 runtime files
Runtime Files Pack 3
Extract the different zip files in separate folders, run the setup.exe
for Visual Basic 4 runtime and Runtime Files Pack 3.
Now you can use WinMPQ by double-clicking on WinMPQ.exe.
MPQDraft: This tool is
optionnal, it allows you to create SEMPQ. We won't need it since we
have the BlankAI_Vista.exe.
http://sourceforge.net/project/showfiles.php?group_id=193005 Download the last version - MPQDraft20080406.zip when this
tutorial was
written -and extract the zip file.
Now you have everything you will need to do your own AI.
This section show step by step how to use the different tools installed
before. We will create an AI.exe file with a modified computer AI.
Depending on what compiler tool you installed, go to the corresponding
section.
First, open the ScAIEdit folder, create a new folder. Name it MyAI for
instance.
Copy aiscript.bin, bwscript.bin, stat_txt.tbl from the "default"
folder to the "MyAI" folder.
First utilisation only:
Before launching ScAIEdit.exe for the first time, check if there is a
scaiedit.conf file in the scaiedit folder. If so, delete it because it
contains wrong data. This file will be generated automatically when
launching ScAIEdit.
Note on ScAIEdit: The help file of
ScAIEdit is really useful particularly for command syntax/help. Don't
follow the ScAIEdit documentation for creating a Self Extracting
CWAD, we will do it with another way.
Launch ScAIEdit by double-clicking on ScAIEdit.exe.
Go in File > Open HDD Navigator, now you should see this:
Go in the MyAI folder and double-click on the aiscript.bin. If there is
an error saying it cannot find a unidef.ini file it is
because there is a wrong scaiedit.conf file. The solution is to exit
ScAIEdit delete the file and launch ScAIEdit again.
Scroll the aiscript window and double-click on the script to
modify, we will choose the script for Protoss AI in BroodWar custom
maps called "Protoss Expansion Custom Level"
Then we have the script window with all commands for the default
Blizzard Protoss AI. When making your own script, you will edit this
file. For now, we will just test a sample script from Michel Klabbers'
tutorial. Select and copy all the lines of the sample script, then go in the script
window, and replace the Blizzard
Protoss AI commands by these new commands.
When it's done check for errors by clicking on the button here.
If the small box is giving 0 error messages, it's good you can save it
by clicking on the save button.
Now go to the aiscript window and click on the compiling button
A small message box will open when the compilation is done:
Click on Ok.
Note: if you don't get this box when
compiling it means there is a
problem somewhere, not necessary in the scripts, it might be a
configuration problem.
First, open the PyAIwithGUI folder, create a new folder. Name it MyAI
for
instance.
Copy aiscript.bin, bwscript.bin from the "Libs/default"
folder to the "MyAI" folder.
Launch PyAI by double clicking on PyAI.pyw.
Go in File > Open, choose the aiscript.bin first, open it. Then
another window called open bwscript.bin will open, open the
bwscript.bin.
Now in PyAI window you should have the list of different scripts.
Open the Protoss AI Brood War Expansion scipt for custom maps by double
clicking on it.
Copy the Protoss script sample and
paste it the AI Script Editor instead of the default script - you can
use "ctrl+A" to select all the text and easily copy/pasting it.
Now save the AI Script by clicking on the save button in AI Script
Editor. If this window doesn't close there are errors, click on the
Test Code button to check, correct them and click on the save button in
AI Script Editor. If there are errors in the script, PyAI won't import
it and
display the errors description and line numbers. If there are only
warnings, script will be imported - checking the warnings could be
useful
though.
After importing scripts it's time to compile, click on the save
button in PyAI main window.
Note: This section is common for PyAI
and ScAIEdit, the screenshots were taken using ScAIEdit folders.
Return in the Tools folder and launch WinMPQ.exe
Go in File > Open
Choose the folder where you put the BlankAi_Vista.exe and open it.
You can either add your compiled aiscript.bin file with Mpq > Add,
or by dragging it
from MyAI folder and droping it in BlankAi_Vista.exe like in the
picture below:
A window will pop up, enter "scripts\" without the double quotes.
Now it's done, try the AI by double clicking on BlankAI_Vista.exe. You
can copy and rename it too.
A good way to test AI's is to use replays because you can watch them at
speed x16. You can download a replay pack for the different match-ups
here: http://www.broodwarai.com/files/Contests/BWAIWar3/BWAIWarIII_no$_replay.zip
Put them in the "Starcraft/MAPS/replays" folder. When watching a replay
look at the differences with the default Protoss AI such as 2 forges,
no shield
battery, if you see that, it's all right.
Now, let's move on the most intersting part, the scripting of the
future godlike AI.