Page 19 of 19

Posted: Tue Mar 17, 2009 1:02 am
by Archon_Wing
One more question. In a script with external jumps, can I change the order in which the scripts are displayed?

Posted: Tue Mar 17, 2009 1:22 am
by poiuy_qwert
What do you mean?

Posted: Tue Mar 17, 2009 4:57 am
by Archon_Wing
When I have a script with external jumps, the scripts are displayed in the order they are compiled, even if I try cutting or pasting one of the scripts higher. It will revert once I load it again.

Code: Select all

like say...
random_jump(32, abcd:block1)
random_jump(32, abce:block1)
random_jump(32, zzzz:block1)
goto(abcf:block1)

abcd(0, 101, aiscript):
--block1--
start_town()
stop()

abce(0, 101, aiscript):
--block1--
start_town()
stop()

zzzz(0, 101, aiscript):
--block1--
start_town()
stop()

abcf(0, 101, aiscript):
--block1--
start_town()
stop()


I'd like to move script zzzz to the bottom.

Posted: Tue Mar 17, 2009 5:41 pm
by poiuy_qwert
There is no way for PyAI to tell which order you want to decompile your scripts, it decompiles them in the order they are referenced by the script that jumps to them (not in the order they were compiled). You could just export/import the script to a text file to keep the order/labels/comments.

Posted: Thu Dec 29, 2011 11:56 pm
by Taranok
I can't use do_morph with PyAI, it says it takes no parameters. But according to list of commands it says it does:

do_morph (byte) (military)
Morph %2(military) until it commands %1(byte) of them.

Posted: Sun Jan 01, 2012 3:12 am
by poiuy_qwert
Hmm I don't know how that could have got through all this time. Well the only way for it to be fixed at the moment is to use the source version and the patch I've listed bellow. If you aren't using the source version already download it here as well as Python (preferably 2.5.4 from here).

Next open up PyMSLibsAIBIN.py and edit line 396, which should look like this (bold line):

392 None, #Possibly one parameter
393 [self.ai_byte],
394 [self.ai_address],
395 [self.ai_byte,self.ai_building],
396 None,


Edit it to:

392 None, #Possibly one parameter
393 [self.ai_byte],
394 [self.ai_address],
395 [self.ai_byte,self.ai_building],
396 [self.ai_byte,self.ai_military],



This will let you compile and decompile correctly, but wont change its tooltip. If you want to fix the tooltip, you'll find it at the top of PyMSPyAI.py if you look for the line with 'do_morph'.