PYAI quick start guide

Help - Resources - Discussion
User avatar
Archon_Wing
Posts: 903
Joined: Wed Jul 25, 2007 11:22 pm

PYAI quick start guide

Postby Archon_Wing » Tue Jul 28, 2009 7:30 pm

As the documentation for everything is all over the place, and it can be quite confusing, I copy and pasted my instructions on how to get started on PYAI here. This was originally intended for people that want to convert their scaiedit asc3 files over which will probaly apply to most people starting to use PYAI. If you don't have a script to convert, just ignore the parts about converting. ;)

FAQ
Q:I just want to use someone else's script. How can I tell if it's a scaiedit file or a pyai file?
A: Scaiedit files have an .asc3 extension at the end of the file. PYAI files are txt files, like ai.txt

Q: I don't see any extensions at the end of a file.
A: By default Windows is lame and hides your extensions. Unhide them: http://www.kevinscrate.com/blog/2007/10/04...tensions-in-xp/

Q: Wtf it's an aiscript.bin!!
A: You can open these directly in PYAI. Just click file---> open and choose aiscript.bin. If it asks for a bwscript.bin click cancel if you don't have that. However, because labels aren't saved in those files, it can be very hard to read. Try to get a txt/asc3 file if possible.

Q: Wtf it's a bwscript.bin!!
BWscript.bin is extra space for files and can't be opened without an aiscript.bin with it. Get the aiscript.bin. If they don't have it, then someone has screwed up.

Q: How do I open a scaiedit file?
A: Try opening the file. Windows will tell you it doesn't recognize it, so choose select a program. Then find notepad in the list. After that, these files will always open in notepad if you double click them.

Q: It's already a PYAI file
A: Follow steps 1-4. Then goto edit---> import scripts and choose the file. Then skip to step 8

Q: The AI I want has none of these. I only have the mod file.
A: Get Winmpq: http://shadowflare.samods.org/dwnload.html#WinMPQ and follow instructions there.
Then open up the mod file in winmpq. You should see aiscript.bin somewhere and just drag that out to your desktop or any folder of your choosing. Drag the bwscript.bin if it is there too. Then follow the instructions above.

Convert your SCAIEditIII script to PyAI
1.) Make sure you have downloaded the exe version of PYMS , and unzipped it to a folder
In PYAI, click edit----> manage external definition files.
Image
2.) Then click the + icon.
Image

3.) Navigate to the folder you placed PYAI in (It should already be there by default). There should be a file called unitdef.txt ; select this file and click open.
Image
4.) Now click ok. Then, start a new aiscript.bin by clicking file---> new
Click the disk icon "Save Information Comments and Labels"
Image
5.) Click the edit script button. This will open a new window. When it opens, delete everything in the window.
Image
6.) Copy and paste your scaiedit script in the window. Click the convert to pyai icon (2nd last from right). Click the check mark to check for any errors. Note that PYAI is case sensitive. Once that's done, close the window and say yes if you want to save.
Image
7.)You will see a new script created (Terran/Protoss/Zerg Expansion level). It is strongly recomended you export the script by right clicking on the script and choosing export. Name it anything you want but make sure it has a .txt at the end. In case anything goes wrong, you can simply import this text file into pyai (import is the 5th icon from bottom left of the toolbar)
Image

8.) Repeat this for any other scripts you wish to import
To save the aiscript.bin, click file---> save as. Save it to a folder you will remember and save the file as aiscript.bin

9.) To actually play the AIs you will need to use WINMPQ to move the aiscript.bin into the BWAIwar4 exe file.
Follow the instructions here
10.) To open the aiscript.bin file again, just click file---> open and choose aiscript.bin. It'll then ask you for a bwscript.bin ; click cancel if that doesn't exist-- you don't need it.
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Tue Jul 28, 2009 10:30 pm

Very nice and thanks for writing a guide for my program! A couple tips:
- If you set file associations (teal cubes button on toolbar or in the menu) you can double click on aiscript.bin's in explorer/WinMPQ to open them in PyAI (modders note: since both AI and IScript use the same extension [.bin], their file associations will overwrite eachother)
- You dont have to create a new script (step 5) to get to the script editor, you can press Ctrl+E (or press the button on the toolbar/do it in the menu).
- If you did not know you can also export your script before closing the script editor (step 6)
User avatar
Archon_Wing
Posts: 903
Joined: Wed Jul 25, 2007 11:22 pm

Postby Archon_Wing » Tue Jul 28, 2009 10:53 pm

You dont have to create a new script (step 5) to get to the script editor, you can press Ctrl+E (or press the button on the toolbar/do it in the menu).


Ok, I updated the post to contain that.

Return to “PyMS (poiuy_qwert's complete modding suite)”

Who is online

Users browsing this forum: No registered users and 1 guest