PyAI

Help - Resources - Discussion
User avatar
Archon_Wing
Posts: 903
Joined: Wed Jul 25, 2007 11:22 pm

Postby Archon_Wing » Tue Mar 17, 2009 1:02 am

One more question. In a script with external jumps, can I change the order in which the scripts are displayed?
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Tue Mar 17, 2009 1:22 am

What do you mean?
User avatar
Archon_Wing
Posts: 903
Joined: Wed Jul 25, 2007 11:22 pm

Postby Archon_Wing » Tue Mar 17, 2009 4:57 am

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.
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Tue Mar 17, 2009 5:41 pm

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.
User avatar
Taranok
Posts: 256
Joined: Tue Sep 07, 2010 9:41 pm

Postby Taranok » Thu Dec 29, 2011 11:56 pm

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.
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Sun Jan 01, 2012 3:12 am

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'.

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

Who is online

Users browsing this forum: No registered users and 3 guests