module system

Users who are viewing this thread

Yoshiboy

Count
I have python installed but i get this error when i run the batch file.



Code:
C:\Program Files\Mount&Blade\ModuleSystem>python process_strings.py
'python' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\Mount&Blade\ModuleSystem>python process_items.py
'python' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\Mount&Blade\ModuleSystem>python process_map_icons.py
'python' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\Mount&Blade\ModuleSystem>python process_factions.py
'python' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\Mount&Blade\ModuleSystem>python process_scenes.py
'python' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\Mount&Blade\ModuleSystem>python process_troops.py
'python' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\Mount&Blade\ModuleSystem>python process_party_tmps.py
'python' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\Mount&Blade\ModuleSystem>python process_parties.py
'python' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\Mount&Blade\ModuleSystem>python process_quests.py
'python' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\Mount&Blade\ModuleSystem>python process_scripts.py
'python' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\Mount&Blade\ModuleSystem>python process_mission_tmps.py
'python' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\Mount&Blade\ModuleSystem>python process_game_menus.py
'python' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\Mount&Blade\ModuleSystem>python process_dialogs.py
'python' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\Mount&Blade\ModuleSystem>pause
Press any key to continue . . .
 
Slightly simpler way, just add this line to the start of the "build_module.bat" file (assuming you installed Python 2.4.2 to it's default path):
Code:
@set PATH=C:\Python24;%PATH%
Make sure it's on it's own line.

I used to work extensively on batch files. Fun stuff. :wink:

Alternately, you could set Python's path permanently in the Windows PATH environmental variable setting, but that's more work. :smile:

EDIT: Also I noticed it creates a bunch of PYC format files (compiled copies of the scripts) which are not needed after it finished. So, you can add this line near the end, right before the "pause" line:
Code:
@del *.pyc
That will clean up all the temporary PYC files so you don't have to look at them.

I've checked, and Armagan's python scripts recreate every file other than "map.txt" and "module_info.txt", and of course the files in the SceneObj folder. Cool!

So, here's my file now line for line:
Code:
@set PATH=C:\Python24;%PATH%
python process_strings.py
python process_items.py
python process_map_icons.py
python process_factions.py
python process_scenes.py
python process_troops.py
python process_party_tmps.py
python process_parties.py
python process_quests.py
python process_scripts.py
python process_mission_tmps.py
python process_game_menus.py
python process_dialogs.py
@del *.pyc
@pause
The @ symbol at the start of a line (like I also added to the pause line) in a batch file makes it not show the command line being executed to the window, though it will still run it. No big deal, just makes the output a little cleaner.

EDIT 2: Probably not a big deal, but this being the Bug Report forums and all, I get this message when it compiles the last file:
process_dialogs.py:6: DeprecationWarning: Non-ASCII character '\x92' in file module_dialogs.py on line 871, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
from module_dialogs import *
 
Oh, and also (might be this)

export_dir = "E:\Program Files\Mount&Bladedef\Modules\"
^

Note the ^
 
Lobos said:
SyntaxError: EOL while scanning single quoted entry
That after I edited the .bat
What OS are you using and what Python version?
That error is coming from Python I believe.

EDIT: my module_info.py file doesn't have an "^" in it, just line above, if that helps.
Did you follow the instructions exactly from the "Getting started" guide by Armagan?

EDIT 2: oh, I see your problem now. In the "module_info.py" (and only in it) you need to use "/"s instead of "\" like the normal windows convention. That's your problem. Oh, and no "^" should be below it either.
 
Janus said:
EDIT 2: Probably not a big deal, but this being the Bug Report forums and all, I get this message when it compiles the last file:
process_dialogs.py:6: DeprecationWarning: Non-ASCII character '\x92' in file module_dialogs.py on line 871, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
from module_dialogs import *
I found the cause of this by looking at the "module_dialogs.py" file. There are a few non-ASCII characters in the file, which it doesn't like. Not showstoppers and the file still compiles.
But, if you want to clean them up so it doesn't give errors like that, you can change the following lines in the file (assuming you haven't already edited the file and changed the line numbering):
line 871: change "You’ve earned it" to "You've earned it"
line 893: change "We’re depending" to "We're depending"
line 897: change " ‘hero" to " hero"
line 917: change " ‘hero" to " hero"
It's those nonstandard apostrophes that Python doesn't like. As I said though, no big deal, just keeps the compile from nagging at you about it. :wink:
 
Ooops, I had forgotten that I had changed my path variable.

Thanks a lot for the fix Janus. I'll add those changes to the next version of the module system.

I also had the chance to see and try you file repository. It's just amazing. Thanks a lot.
 
Glad to be of service, and thanks for the compliment on the site. It still has a few details that aren't fully working and some features I'd like to add, but it's coming along.

And, of course, thank you for the mod tools. Now if I can just sort out the issues with my arena mod... :wink:
 
When activating build module, most of the modules are exported fine, but the bottom few recieve a message like this

C:\Documents and Settings\Alex\My Documents\ModuleSystem>"C:\Python24\python.exe
" process_parties.py
Traceback (most recent call last):
File "process_parties.py", line 4, in ?
from module_game_menus import *
File "C:\Documents and Settings\Alex\My Documents\ModuleSystem\module_game_men
us.py", line 88
]),
^
SyntaxError: invalid syntax

C:\Documents and Settings\Alex\My Documents\ModuleSystem>"C:\Python24\python.exe
" process_quests.py
Exporting quest data...

C:\Documents and Settings\Alex\My Documents\ModuleSystem>"C:\Python24\python.exe
" process_scripts.py
Exporting scripts...

C:\Documents and Settings\Alex\My Documents\ModuleSystem>"C:\Python24\python.exe
" process_mission_tmps.py
Traceback (most recent call last):
File "process_mission_tmps.py", line 8, in ?
from process_operations import *
File "C:\Documents and Settings\Alex\My Documents\ModuleSystem\process_operati
ons.py", line 16, in ?
from module_game_menus import *
File "C:\Documents and Settings\Alex\My Documents\ModuleSystem\module_game_men
us.py", line 88
]),
^
SyntaxError: invalid syntax

C:\Documents and Settings\Alex\My Documents\ModuleSystem>"C:\Python24\python.exe
" process_game_menus.py
Traceback (most recent call last):
File "process_game_menus.py", line 5, in ?
from module_game_menus import *
File "C:\Documents and Settings\Alex\My Documents\ModuleSystem\module_game_men
us.py", line 88
]),
^
SyntaxError: invalid syntax

C:\Documents and Settings\Alex\My Documents\ModuleSystem>"C:\Python24\python.exe
" process_dialogs.py
Traceback (most recent call last):
File "process_dialogs.py", line 9, in ?
from process_operations import *
File "C:\Documents and Settings\Alex\My Documents\ModuleSystem\process_operati
ons.py", line 16, in ?
from module_game_menus import *
File "C:\Documents and Settings\Alex\My Documents\ModuleSystem\module_game_men
us.py", line 88
]),
^
SyntaxError: invalid syntax
 
Did you modify the "module_game_menus.py" file? It's saying there's a problem with line 88, which looks like this for me:
Code:
     ("start_lady",[(eq,"$character_gender",1)],"a court lady",[
You may have a misplaced comma, parentheses, bracket, or some such.
 
Back
Top Bottom