PyAI bug hunting

Help - Resources - Discussion
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Fri Mar 07, 2008 3:06 am

I can't look into this right now, but I will asap. If you have the time could you use SCAIEdit to decompile the aiscript.bin from PyAI? That might give me a clue without having to dig through the hex. Thanks!
User avatar
XzxFlamerxzX
Posts: 13
Joined: Sun Mar 02, 2008 5:40 pm

Postby XzxFlamerxzX » Fri Mar 07, 2008 3:25 am

Just a question: Does the script work if you dont decompile and recompile? If so, look at the script when you decompile, recompile, then redecompile. Maybe the code changed /unsure.gif' class='bbc_emoticon' alt=':unsure:' />.

Btw, [quote name='bajadulce']maybe the shoutbox doesn't like your name. XzXFlamerxzX doesn't have the best connotation :P[/quote]
XzxFlamerxzX has no connotation. However, XxxFlamerxxX has the connotation I think you are referring to :P. I would have said this in the shoutbox if I could.
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Fri Mar 07, 2008 3:45 am

alright, thanks for narrowing it down for me, should make my live easier when i get to it.

Edit: I started looking into it, and there definitely is a bug in PyAI. It seems when I decompile the AAAI aiscript.bin, compile it, then decompile again, i get an error. I'm looking into it.
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Fri Mar 07, 2008 6:19 am

Well it seems you where using Jim Raynor (Marine). When decompiled PyAI just put Jim Raynor, and Jim Raynor (Vulture) comes before Jim Raynor (Marine) in the TBL. I will add a way to define which is which for next version of PyAI. Thanks for the help baja!
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Sat Apr 19, 2008 5:56 am

[quote name='bajadulce' post='3548' date='Apr 18 2008, 04:09 PM']PYAIGUI is reporting Overlord Warning which could get quite annoying in large numbers. Can anything be done with this?

Parameter Warning: Unit is not a building or worker
Line 20: build(1, Zerg Overlord, 130)[/quote]

Yeah I can add this no problem. But does anyone know if the overlords unit id is just hardcoded to be built instead of trained, or is it something in units.dat?



[quote name='bajadulce' post='3548' date='Apr 18 2008, 04:09 PM']The following is not necessarily a bug so to speak, but possibly a missing feature:

Here's an interesting discovery relating to improperly closed scripts. If a script is not properly closed it will "run" into the next one. Maybe this is why SCAIEdit has an improperly closed warning.

example of script running into another:
[attachment=725:Improperly_closed.zip]
notice that the blue computer will build 3 nexus whereas the purple one only 2 with the following improperly closed script
[spoiler]# CUSTOM EXPANSION PROTOSS VS. PROTOSS EXAMPLE
PMCx(0, 000, aiscript):

wait(36)

random_jump(128, PROA:ProtossA_start)
goto(PROB:ProtossB_start)


# ############# PROTOSS A ####################
PROA(0, 000, aiscript):

--ProtossA_start--
start_town()
transports_off()
farms_notiming()

build(1, Protoss Nexus, 130)
build(4, Protoss Probe, 100)

### Place Script 1 here


# ############# PROTOSS B ####################
PROB(0, 000, aiscript):

--ProtossB_start--
start_town()
transports_off()
farms_notiming()

build(2, Protoss Nexus, 130)
build(4, Protoss Probe, 100)

### Place Script 2 here[/spoiler]This was discoverd as I was trying to make a sample for the race vs. race without including a "loop" at the end of my script. Ppl have been confused with what it means to properly close a script because SCAIEdit's help file states that scripts should never "end" with stop which can be confusing. End = the flow not necessarily the last line of script. As a result a lot of scripts posted in this forum have included some kind of "loop" at the end of their script that wasn't necessary. It probably doesn't help that almost all of my scripts have had a "loop" at end. This was simply a way to divert my script for testing purposes. Probably confused a lot of ppl.

Of course putting a loop or making sure that the last line of your script is a stop will avoid this problem.[/quote]

I'll add a warning for it (I dont want to put it as an error because it could be useful to be able to use the feature).

[quote name='bajadulce' post='3548' date='Apr 18 2008, 04:09 PM']My second concern now is that 2 scripts featuring the same block names might just get mixed up as well? I was under the impression that the scripts were separated by the #ID(0, 000, aiscript) and that it served as a buffer between scripts, but it appears this is not the case. I had praised how it was possible to import 2 different scripts using identical block names without conflict but now I am beginning to wonder whether this is true. I assume that the external syntax would be needed for a script to jump to another scripts block, but I will make some tests tonight. basically I will test to see whether the following 2 scripts have a conflict with the --units-- block?

[spoiler]## Script1
...
multirun units
...

--units--
train ## x_units
...

## Script2

...
multrun units
...

--units--
train ## y_units
...[/spoiler][/quote]

It should not give conflicts, and when I tested it it didn't. If its not working i'll look into it.

[quote name='bajadulce' post='3548' date='Apr 18 2008, 04:09 PM']What was the purpose of the warning dealing with extra "start_towns"? Nearly every script will have extra start_towns due to the expansions. Also extra start_towns are a way to get past the hardcoded # of peons per main + other building limits as well. I know Ashara had a faulty Terran script that crashed the contest, but that was because he got the campaign headers mixed up with the melee ones which is a different problem all together. Multiple start_towns are not a problem.[/quote]

Its not only a multiple start_towns warning, its a multiple start_* warning. I didn't know what the error is, and i didn't have time to find out so i added a generic warning. If you explain what the error actually was I could make a more detailed warning.

[quote name='bajadulce' post='3548' date='Apr 18 2008, 04:09 PM']I was kind of hoping I could import the race vs. race scripts as 3 separate .txt files (the switch + the 2 actual scripts), but an external script call without the actual block contained within the .txt file won't allow it. Also a separate script with a target external block will just disregard that block if it isn't being used elsewhere. This means that all 3 scripts have to be combined into one text file before being imported.[/quote]

Good point, i'll fix that for next version.

[quote name='bajadulce' post='3548' date='Apr 18 2008, 04:09 PM'][attachment=726:Blizz_p_Zelduck_p.txt]
Something odd. After importing the following "scripts" (one giant .txt file), the PMCx script can be exported as a separate script, but the other 2 scripts can't? PYAIGUI just seems to freeze up if you try and export either of these "BLZP" or "ZEDP". Also this is funny that the PMCX script can be exported with the external script call without the actual scripts or the actual block whereas importing was not possible since it didn't actually contain them. :P[/quote]

Alright I have no idea about this one, i'll have to look into it sometime, though im kinda busy for the next few days. I'll check it out soon.

Thanks for the feedback.

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

Who is online

Users browsing this forum: No registered users and 2 guests