- Need a little help with module system - [SOLVED]

Users who are viewing this thread

I_am_a_Spoon

Regular
Hi guys.

I'm pretty new to all this stuff, and I keep getting the following errors when I try to compile my mod using the "build_module.bat" app.

Traceback (most recent call last):
  File "process_init.py", line 2, in <module>
    from process_operations import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\process_
operations.py", line 13, in <module>
    from module_items import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_i
tems.py", line 1248
    ]
    ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_global_variables.py", line 5, in <module>
    from module_triggers import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_t
riggers.py", line 9, in <module>
    from module_constants import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_c
onstants.py", line 467, in <module>
    num_trade_goods = itm_siege_supply - itm_spice
NameError: name 'itm_siege_supply' is not defined
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Traceback (most recent call last):
  File "process_map_icons.py", line 3, in <module>
    from module_map_icons import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_m
ap_icons.py", line 2, in <module>
    from module_constants import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_c
onstants.py", line 467, in <module>
    num_trade_goods = itm_siege_supply - itm_spice
NameError: name 'itm_siege_supply' is not defined
Exporting faction data...
Traceback (most recent call last):
  File "process_items.py", line 4, in <module>
    from module_items import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_i
tems.py", line 1248
    ]
    ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_scenes.py", line 2, in <module>
    from module_scenes import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_s
cenes.py", line 5, in <module>
    from module_constants import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_c
onstants.py", line 467, in <module>
    num_trade_goods = itm_siege_supply - itm_spice
NameError: name 'itm_siege_supply' is not defined
Traceback (most recent call last):
  File "process_troops.py", line 4, in <module>
    from module_troops import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_t
roops.py", line 259, in <module>
    [itm_leather_jerkin, itm_leather_boots],
NameError: name 'itm_leather_jerkin' is not defined
Exporting particle data...
Traceback (most recent call last):
  File "process_scene_props.py", line 4, in <module>
    from module_scene_props import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_s
cene_props.py", line 7, in <module>
    from module_constants import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_c
onstants.py", line 467, in <module>
    num_trade_goods = itm_siege_supply - itm_spice
NameError: name 'itm_siege_supply' is not defined
Traceback (most recent call last):
  File "process_tableau_materials.py", line 5, in <module>
    from module_tableau_materials import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_t
ableau_materials.py", line 6, in <module>
    from module_constants import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_c
onstants.py", line 467, in <module>
    num_trade_goods = itm_siege_supply - itm_spice
NameError: name 'itm_siege_supply' is not defined
Traceback (most recent call last):
  File "process_presentations.py", line 4, in <module>
    from module_presentations import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_p
resentations.py", line 7, in <module>
    from module_constants import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_c
onstants.py", line 467, in <module>
    num_trade_goods = itm_siege_supply - itm_spice
NameError: name 'itm_siege_supply' is not defined
Exporting party_template data...
Traceback (most recent call last):
  File "process_parties.py", line 4, in <module>
    from module_game_menus import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_g
ame_menus.py", line 8, in <module>
    from module_constants import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_c
onstants.py", line 467, in <module>
    num_trade_goods = itm_siege_supply - itm_spice
NameError: name 'itm_siege_supply' is not defined
Exporting quest data...
Exporting info_page data...
Traceback (most recent call last):
  File "process_scripts.py", line 4, in <module>
    from module_scripts import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_s
cripts.py", line 4, in <module>
    from module_constants import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_c
onstants.py", line 467, in <module>
    num_trade_goods = itm_siege_supply - itm_spice
NameError: name 'itm_siege_supply' is not defined
Traceback (most recent call last):
  File "process_mission_tmps.py", line 5, in <module>
    from module_mission_templates import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_m
ission_templates.py", line 8, in <module>
    from module_constants import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_c
onstants.py", line 467, in <module>
    num_trade_goods = itm_siege_supply - itm_spice
NameError: name 'itm_siege_supply' is not defined
Traceback (most recent call last):
  File "process_game_menus.py", line 5, in <module>
    from module_game_menus import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_g
ame_menus.py", line 8, in <module>
    from module_constants import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_c
onstants.py", line 467, in <module>
    num_trade_goods = itm_siege_supply - itm_spice
NameError: name 'itm_siege_supply' is not defined
Traceback (most recent call last):
  File "process_simple_triggers.py", line 2, in <module>
    from module_simple_triggers import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_s
imple_triggers.py", line 10, in <module>
    from module_constants import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_c
onstants.py", line 467, in <module>
    num_trade_goods = itm_siege_supply - itm_spice
NameError: name 'itm_siege_supply' is not defined
Traceback (most recent call last):
  File "process_dialogs.py", line 5, in <module>
    from module_triggers import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_t
riggers.py", line 9, in <module>
    from module_constants import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_c
onstants.py", line 467, in <module>
    num_trade_goods = itm_siege_supply - itm_spice
NameError: name 'itm_siege_supply' is not defined
Traceback (most recent call last):
  File "process_global_variables_unused.py", line 3, in <module>
    from process_operations import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\process_
operations.py", line 13, in <module>
    from module_items import *
  File "C:\Users\Alex\Desktop\Modding\M&B - Warband\Module System 1.127\module_i
tems.py", line 1248
    ]
    ^
SyntaxError: invalid syntax
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .

I can't figure out why line 1248 of module_items.py is invalid, and I don't understand why the coding regarding spices is messed up.

Thanks in advance for any help.    :???:
 
You're missing a comma or bracket in the module_items file and missing the item "siege_supply".
 
I_am_a_Spoon said:
Any idea about how to fix it?

It WOULD be helpful if you actually posted the contents of your module_items.py so that people have something to fix :wink:
 
sphere said:
It WOULD be helpful if you actually posted the contents of your module_items.py so that people have something to fix :wink:
Too many characters to post. Any way I could upload it?

Caba`drin said:
Go to the lines that are listed in the errors and look above them for missing commas, brackets, etc.
I did, but I can't find anything.
 
I can't figure it out. Maybe you put a new item in somewhere that upset the constants? The list of items stops at 1248, but in my files, that is an item I have added. I would suspect that you added something in the wrong place.

Also, you seem to have commented out the sarranian warhorse and steppe charger near the end. That could be the problem.
 
you've got an extra ] at line 1035.  Remove it and it should be fine

line 1035 said:
715 , weight(7.25)|hit_points(640)|body_armor(25)|spd_rtng(69)|shield_width(50),imodbits_shield],

To try to find out problems, this is what you can do next time:
If you aren't sure which lines causing problem, try something like commenting/removing out half of all the items.  Then try running "module_items.py" directly (don't build the whole module).
If it runs, then your problem line is in the half you removed, it is still have the same syntax error, then the error line is in the half you haven't remove.  Repeat the process to narrow down to the item entry that causes problem.  After that, a careful search by inspection can often uncover possible errors (e.g. compare with similar lines to see if anything extra or missing).
 
sphere said:
you've got an extra ] at line 1035.  Remove it and it should be fine
Thanks for spotting that, but I fixed it, and I'm still getting errors like "itm_siege_supply is not defined" and "itm_leather_jerkin is not defined".
I haven't touched anything to do with siege supplies or leather jerkins, so I'm totally stumped.

sphere said:
If you aren't sure which lines causing problem, try something like commenting/removing out half of all the items.  Then try running "module_items.py" directly (don't build the whole module).
How do I compile a single .py file?
 
I_am_a_Spoon said:
sphere said:
you've got an extra ] at line 1035.  Remove it and it should be fine
Thanks for spotting that, but I fixed it, and I'm still getting errors like "itm_siege_supply is not defined" and "itm_leather_jerkin is not defined".
I haven't touched anything to do with siege supplies or leather jerkins, so I'm totally stumped.

There are these lines near the end of module_constants.py:

trade_goods_begin = "itm_spice"
trade_goods_end = "itm_siege_supply"
food_begin = "itm_smoked_fish"
food_end = "itm_siege_supply"

... maybe you changed something to do with them?
 
I_am_a_Spoon said:
I'm still getting errors like "itm_siege_supply is not defined" and "itm_leather_jerkin is not defined".
I haven't touched anything to do with siege supplies or leather jerkins, so I'm totally stumped.
Check your ID_items.py for all the items it can't find.
 
Ok, checked ID_items.py, and it was completely empty. Copy-pasted the contents of my backup file, and everything seems to be fine now, except for a few random errors and warnings when building the module. The warnings have always been there, but the errors are completely new.

They're something to do with "illegal identifiers"; ie, the new Sarranid and Steppe warhorses. Before all this, I was getting a wierd glitch where those two horses weren't showing up during battles or within the marketplace, because the game couldn't find their meshes, so I just removed them from everybody's inventories and removed them from module_items.py. I never had errors like this show up until now.

Initializing...
variables.txt not found. Creating new variables.txt file
Compiling all global variables...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting info_page data...
Exporting scripts...
Error: Unable to find object:itm_warhorse_steppe
ERROR: Illegal Identifier:itm_warhorse_steppe
Error: Unable to find object:itm_warhorse_sarranid
ERROR: Illegal Identifier:itm_warhorse_sarranid
Error: Unable to find object:itm_warhorse_steppe
ERROR: Illegal Identifier:itm_warhorse_steppe
Error: Unable to find object:itm_warhorse_steppe
ERROR: Illegal Identifier:itm_warhorse_steppe
Error: Unable to find object:itm_warhorse_sarranid
ERROR: Illegal Identifier:itm_warhorse_sarranid
Error: Unable to find object:itm_warhorse_sarranid
ERROR: Illegal Identifier:itm_warhorse_sarranid
Error: Unable to find object:itm_warhorse_steppe
ERROR: Illegal Identifier:itm_warhorse_steppe
Error: Unable to find object:itm_warhorse_sarranid
ERROR: Illegal Identifier:itm_warhorse_sarranid
Error: Unable to find object:itm_warhorse_steppe
ERROR: Illegal Identifier:itm_warhorse_steppe
Exporting mission_template data...
Error: Unable to find object:itm_warhorse_sarranid
ERROR: Illegal Identifier:itm_warhorse_sarranid
Error: Unable to find object:itm_warhorse_steppe
ERROR: Illegal Identifier:itm_warhorse_steppe
Exporting game menus data...
WARNING: Usage of unassigned global variable: $g_presentation_marshall_selection
_max_renown_3
WARNING: Usage of unassigned global variable: $g_presentation_marshall_selection
_max_renown_3_troop
WARNING: Usage of unassigned global variable: $g_presentation_marshall_selection
_max_renown_3
WARNING: Usage of unassigned global variable: $g_presentation_marshall_selection
_max_renown_3_troop
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...
WARNING: Global variable never used: tutorial_1_finished
WARNING: Global variable never used: tutorial_2_finished
WARNING: Global variable never used: tutorial_3_finished
WARNING: Global variable never used: tutorial_4_finished
WARNING: Global variable never used: tutorial_5_finished
WARNING: Global variable never used: g_election_date
WARNING: Global variable never used: g_presentation_lines_to_display_begin
WARNING: Global variable never used: g_presentation_lines_to_display_end
WARNING: Global variable never used: $g_presentation_marshall_selection_max_reno
wn_3
WARNING: Global variable never used: $g_presentation_marshall_selection_max_reno
wn_3_troop
WARNING: Global variable never used: $g_presentation_marshall_selection_max_reno
wn_3
WARNING: Global variable never used: $g_presentation_marshall_selection_max_reno
wn_3_troop
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .
 
You should reinstall the native game (back up your mod first). It sounds to me like you may have removed something from the native files, or else something else happened to them. I don't have to comment those horses out in my mod, and the ID file being empty is really wierd...

Seriously, reinstall...

And if you still get the same problem I would suspect there is something wrong with your module_scripts.py file.

Those late-night modding sessions when we wake up from nodding off at our computers, with a million "w"s in our python files, due to the subconscious need to move forward in fps, games are awesome. :grin:

 
Something else that might help you make sense of the module system files is a program called notepad++ it'd free.. And it has many useful features for making files more readable :smile:
 
Back
Top Bottom