Page 1 of 3

Help. PyAI not working as it did in older version?

Posted: Wed Feb 06, 2013 4:44 pm
by SilverG
Hello all,
I'm relatively new to the forums, but not to SC BW.

What's with the new version of PyMS? Each time I make my own AI (edit the things needed, so that the AI script wouldn't need a location - which has been working with the older version of PyAI) and as soon as I add it to the MOD that's I've made ie. Starcraft Clonewars (using either PyMPQ or WinMPQ) the game won't apply the AI. It has worked so far with the older PyMS versions.

And another thing why does the program not recognize the unit/building/upgrade/tech names? I must write down their codes in PyAI, and then after I've saved it the PyAI automatically corrects it to the specified building name, but incorrectly, example:

build(1, 106, 200) = where 106 would be command_center in the old PyAI, but here it's corrected to Terran Command Center (every 1st letter caps and space between the words) SC BW , at least mine doesn't recognize this string, and any other for that matter.

I would appreciate if someone would help me out with this issue, and/or maybe upload an older version of PyMS. Thank you.

Re: Older version?

Posted: Wed Feb 06, 2013 5:17 pm
by bajadulce
I'm just getting Starcraft installed again on my machine as well as all the modding programs setup. I will try to check out these things when I can.

@ As for SCraft not recognizing your script: Try putting your script (.txt form w/o errors) into one of the BWAILauncher's folders and see what happens. If it runs in BWAILauncher, then you might not be indexing the file in your MPQ correctly. (possibly the wrong language or directory). Just a quick test to isolate that variable.

@ PYAI renaming. It's been awhile, but the compiled script shouldn't matter what form it is in. There is a x=y or some button like that if I recall that will use an external list command. Again, I'll be able to answer your question more thoroughly after I get my modding folders set back up.

We also are in desperate need of building some tutorials for the use of PyAI. I know how frustrating it can be not to have simple examples to follow along with to check your own code/steps. Ashara had put together something and am in the process of organizing something so that we can reupload it soon.

Stay patient and we'll get your issues straightened out.

Re: Older version?

Posted: Wed Feb 06, 2013 9:37 pm
by Taranok
You can add external definition files by hitting the x=y button in the main PyAI window.

Make sure you dump aiscript.bin in the scripts/ directory of the .exe. If it still doesn't work try what bajadulce suggested.

Re: Older version?

Posted: Wed Feb 06, 2013 10:06 pm
by SilverG
I am putting it in the scripts/ section of the *.exe file.

The problem is that PyAI doesn't recognize the string that BWAI is using for example in the older version it was easy just to put Build(1, hatchery, 200). . . in the new 2.4 PyAI I have to switch the "hatchery" or any other building with it's respective numeric code, like in this case 131 (from the unitdef.txt). I have done so for all buildings/units/upgrades and tech, because PyAI just says cannot find "hatchery" : "Parameter Error: unit "hatchery" was not found Line:xx Build(1, hatchery, 200)"

Once I've made ALL the changing (which took me 2 hours to learn :) ), I save the AI to a different directori as AIscript.bin or aiscript.bin
And the next time I open it via PyAI (2.4) the program changes the codes to as in example 131 = "Zerg Hatchery" when it should only be "hatchery" - which BWai does recognize.

Now did I make the problem that I'm struggling with more clearer?

Oh, and thanks for all the help you've given me so far :)

Re: Older version?

Posted: Wed Feb 06, 2013 10:24 pm
by Taranok
maybe I'm missing something, but what is it you're referring to as BWAI?

EDIT: baja probably knows more about PyAI, I usually use PyAI for checking syntax errors.

Re: Older version?

Posted: Wed Feb 06, 2013 10:30 pm
by SilverG
As BWAI I was referring to the game itself sorry. . . . :)

Anyway did some tweaking here and there. . and after a couple of minutes everything is as it should be. . . Thank you for your help and understanding :)

Re: Older version?

Posted: Wed Feb 06, 2013 10:45 pm
by bajadulce
Glad to hear you got it working as you needed.

Just curious what you had to do to get working (or what you might have been doing incorrectly)? Somebody else might stumble on the same problem and your solution might be able to help them as well.

Re: Help. PyAI not working as it did in older version?

Posted: Thu Feb 07, 2013 6:27 am
by SilverG
True :)

Well I've did the X->Z (xibbit :P ) and put in the Unitdef.txt in the Manage External Definition. Since the programe PyAI didn't do it at installation/unpacking.
So this is a must do "objective" :) for all of you who are unpacking the PyMS.exe and want to edit PyAI's.


Re: Help. PyAI not working as it did in older version?

Posted: Thu Feb 07, 2013 7:21 pm
by SilverG
The problem still persists . . . .

I've moved my edited aiscript.bin the the desired mod's *.exe via WinMPQ, under scripts\aiscrip.bin, and the game doesn't use it. I've even edited the flags in the ai, such as clearing the "broodwar only", "requires a location" and "invisible in staredit" boxes.

Can anybody tell me what's wrong here?
I can even send you the aiscript.bin that I've made, should you require it.

Re: Help. PyAI not working as it did in older version?

Posted: Thu Feb 07, 2013 7:28 pm
by bajadulce
you should post the first few lines of your script (i.e. headers).

Code: Select all

# baja T v1.1
TMCx(1342, 101, aiscript):


Does your script work if you put it into the bwailauncher?