Last edit: Either one of "reinstall Python, reinstall PyAI, disable additional info saving, copypaste scripts from scratch" resolved all my issues below, HOWEVER please read the post for the feature requests - I bolded the edits with them so that they're easier to spot. I'm leaving the errors so that if they're somehow related to PyAI and not just to my stuff corrupting somewhere along the way, you can correct them
PyAI error, starting with context:
only openable z3 script for reference -
https://pastebin.com/raw/Tvk1iyzYz3e .txt export before it crashes -
https://pastebin.com/raw/80cVc1GGintended z3e -
https://pastebin.com/raw/dWp0Wtgcresult on previous saved bwscript: all scripts open up, E is shown correctly, A-D show the same version of E as D does now - I thought it's a minor display error somehow, since it seemed to work fine in-game, though it required rewriting the scripts a little since it wasn't possible to save after changing with the doubled Z3E0000 block
PyAI version used: the newest one for the entire duration of this BWscript's existence
result while opening z3a-e except d - (btw I can't copy this from the error box itself for some ungodly reason - there is no copy button)
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python27\lib\lib-tk\Tkinter.py", line 1542, in __call__
return self.func(*args)
File "C:\Python27\lib\lib-tk\Tkinter.py", line 592, in callit
func(*args)
File "C:\Scripts\PyMS-master\PyAI.pyw", line 1177, in load
warnings = self.parent.ai.decompile(self, self.parent.extdefs, self.parent.reference.get(), 1, self.ids)
File "C:\Scripts\PyMS-master\Libs\AIBIN.py", line 1701, in decompile
w = self.bwscript.decompile(f, (self.externaljumps,extjumps), values, shortlabel, [id], False)
File "C:\Scripts\PyMS-master\Libs\AIBIN.py", line 1998, in decompile
jump[cmdn] = labelnames.getkey(namenum)
File "C:\Scripts\PyMS-master\Libs\utils.py", line 1437, in getkey
return self.keynames[n]
IndexError: list index out of range
for the record, re-saving->opening ZBE3 didn't fix the issue
Feature request edit 1:As Neiv found out (God bless him), AI towns that have over 100 lines of build + upgrade (upgrade 1, 2, 3 count as 3 separate lines) + tech corrupt other towns (causing a SC crash). PyAI doesn't seem to check for this currently, please make it check. Since it's on a town-by-town basis it has to somehow check according to the scripts flow, and not just adding up all the stuff in the script, since that would invalidate scripts with multiple variations and expansions. B/t/u commands in a loop add up until there's 100+ of them and then corrupt another town: which means PyAI should also warn or just downright prevent b/t/u commands in a loop. I don't know how easy is this for you to implement, but since it's a stability issue I believe that it should be a high priority change. An example of script that caused crashes because of this issue and was not caught by PyAI would be ZB8A in this paste
https://pastebin.com/raw/sSUy7xSH (with ZB8D approaching something like 95 b/t/u commands in each variation)
Feature request edit 2:There is also still no warning for over 20 defensebuild_xy units of a given type (for clarity, you can have 80 max in total, from aa+gg+ag+ga) (going over 20 of a type makes the over-20 ones not count) p_q pleas implement
Edit:
(issue resolved after reinstall etc, as written above)
https://pastebin.com/raw/F9vRCrcg (ctrl+f "block1"), not fixable, writing in this script
https://pastebin.com/raw/bQN0r2Ys and translating->saving it still resulted in the block1 invasion after reopening it.
Post has been edited 7 time(s), last time on Aug 9 2017, 11:32 am by Nekron.