Maybe you can help me with another problem instead poiuy_qwert :-)
When I try to change the TBL file from PyAI and then save, I get the following error:
Exception in Tkinter callback Traceback (most recent call last): File "C:\Programmer\Python\lib\lib-tk\Tkinter.py", line 1403, in __call__ return self.func(*args) File "C:\Documents and Settings\joern\Skrivebord\BWAI\PyMSwithGUIs\PyAI.pyw", line 2698, in save self.tbl.compile(file, extra=True) TypeError: compile() got an unexpected keyword argument 'extra'
Another thing I was wondering about ... when I try to compile ASC3 to PyAI from the editor, I get a wonderful compiled script with block names and comments intact But when I then save, exit, start again, and decompile my aiscript/bwscript, comments and block names are gone. Can I avoid this in any way?
Heh, stupid mistake. Here is a manual fix till next update: 1) Open PyAI.pyw with a text editor 2) Goto line 2698 3) Remove the ", extra=False" part 4) Goto line 2704 5) Add ", extra=self.extrainfo.get()" before the ) So the are you are looking at is like this (lines 2698-2704):
First off, there is no way to save regular comments as of yet, only extra information comments, which can only be applied to headers or labels. If you need the regular comments you'll have to export the file somewhere. This will be changed in a later version (maybe next version). Also, if you want to save label names and extra information comments, you have to select the button on the toolbar that is a diskette with a +i on it. There are two of the buttons though, the first is in the main window, it saves them to the actual aiscript.bin file on compile. The second is in the Script Editor, which saves them when you compile code through it. So long story short, make sure both are pushed in.
My block labels are also getting saved now. Maybe I forgot to save somewhere in the process before, because of the TBL errors, dunno, but the important part is that it works now
Its an impressive amount of work you have done with PyMS.
No problem, im glad to help. Thanks for the complements
Also, I forgot to ask, why are you editing the TBL? In truth there should be no reason to use the TBL editor unless the ai script you are loading needs strings you are missing.
Well unless you are creating a mod with a custom StarEdit that people will create custom maps with your ai's in them, noone will really see the name. The only place the name is used for is in the trigger editor of StarEdit.
Edit: Also, if you still want to edit the names, make sure you edit the strings, dont add new ones to the end. If you do, some problems may come up when you distribute the aiscripts. I wont get into details, just letting you know.
Noone except myself I'm less likely to mess with the wrong script if I keep them named in the editor. Otherwise I only have the script ID as unique identifier, and thats not very expressive when I have multiple scripts to keep track on
Edit: It would be nice if you in the next version of the editor, added a column which displays the 'extra info' about the scripts.
here's another double-click open script obscure bug:
If you return to an open PYAI (v1.8) main window after running Starcraft, AND you've closed the script editor window, PYAI crashes if you try to open a script.
Process: PYAI -- open aiscript -- double click a scipt -- close script editor.
run starcraft (maybe you're testing your latest script modifications) -- exit starcraft
return to open PYAI main window -- double click on any script in window = crash.
Also, there's no right-click menu in the editor. I think I might have mentioned that already? can't remember.
Odd... There should be no conflicts between StarCraft and PyAI... It crashes without an error? I think it might be about time to make it output errors to a file as well as poping up just incase it fully crashes...
And yeah you mentioned the right-click thing, i guess i'll have to add my own.
This crash does have an error.. just run the steps to reproduce the crash.
I have been absent from this forum because I haven't been doing any modding. Now that I've started this latest BWAI Gold Project, I have experienced a few total crashes now as well, but haven't been able to recreate them. They appear to happen under similar circumstances. I.e a conflict with Starcraft. Those errors usually report an error with the .exe itself. Next time it happens I will take a screen shot as there is no way to cntrl-c or copy the error.
ADDED: Logic/Flow error spotted: With the way import list of files function works, there appears to be a loophole in the logic for subsequent edits. I discovered this when I reopened Entropy II to check some things out.
Now the aiscript.bin compiles properly the first time, but it appears that if it is reopened (such as to be modified at a later date), the key starting blocks get discarded with that "auto discard" function. In this case the "starting point" blocks. Rather than spend 2 pages of text trying to explain how this logic fails, I've created a simple sample below. A quick flowchart will reveal the faulty logic:
However the problem then occurs when these scripts are reopened to edit. (In the case of Entropy II 3 months later). Here is how the compiler then sees these which is bad:
Wow that is a really weird error :S (was at school earlier and couldn't check). I might know what is causing the problem, but it looks like it might be a problem in the GUI toolkit itself.
Ok, i'll look into it (actually might have to do with the other script opening error I just fixed).
As long as the users keep their original files and only import them as a list of files then it's not a problem. Editing the aiscript.bin directly however will result in errors.
Just a quick heads up: The ASC3 --> to PYAI button is a great little tool and it works great btw, love it! However in order for the compiler to use these, one must use the SCAI External Unit Definitions. Make sure your eventual help file/example demonstration explains this. It seems really obvious, but took me a good minute to see that it was different.
The problem is actually just a limitation on decompiling. The reason you get that is that the label is only used in an external script. You are trying to edit the ZMC2 script by itself, you'll have to select both scripts in the main window, then hit the Script Edit toolbar button (or use Ctrl+E) to edit them both at the same time. The reason this happens is that there is currently no way to tell that the ZMCx script is externally jumping to it, so it doesn't know the first jump is even there. I'll see if i can change that for the next version, im pretty sure i know how to do it.
Good point, i'll remember that. I might also make the asc3 to PyAI converter accept a unitdef.ini at the top of the script and it will be converted too, though that would take extra work for the user, having to manually open the unitdef.ini and copying it into the script editor. Any better ideas? Maybe i should just make it so when you click on the asc3 to PyAI button it prompts for the asc3 and unitdef.ini files instead of using whats in the script editor?
Yeah, when I have time i'll be able to put stuff up on the wiki. Not only will it have info for users but i'll also put up info for developers so people can write their own programs with the PyAI libs (like that DAT editing thing I made for you). Don't worry, it takes time to get a wiki going, but it'll happen.
I used the new ASC3-> PYAI converter to import an old script, but then spent a good hour trying to figure out why the script wouldn't train any lurkers? Turns out the unitdef.txt included with PyMS is in error:
military lurker = 13
I'd fix that asap. If I find another, I'll report, but you should double check to be sure all the other id's are correct as well.