Baffling Compile Error

Users who are viewing this thread

Status
Not open for further replies.
Code:
NameError: name 'itm_sturmhaube_1BW' 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\{REMOVED}\Desktop\Random Bollocks\MB Module System\Module_system 1.158\process_operations.py", line 14, in <module>
    from module_troops import *
  File "C:\Users\{REMOVED}\Desktop\Random Bollocks\MB Module System\Module_system 1.158\module_troops.py", line 383, in <module>
    [itm_flamberge,itm_bnw_armour_slashed,itm_bnw_armour_stripes,itm_sturmhaube_1BW,itm_sturmhaube_5BW,itm_sturmhaube_7BW,itm_bear_paw_shoes,itm_bnw_gauntlets],

NameError: name 'itm_sturmhaube_1BW' is not defined

So I keep getting this error when I try to equip some new troops, and i haven't the foggiest why.

Here's the troop:
Code:
  ["kehssian_forlorn_hope","Kehssian Forlorn Hope","Kehssian Forlorn Hope",tf_guarantee_all_wo_ranged,no_scene,reserved,fac_commoners,
   [itm_flamberge,itm_bnw_armour_slashed,itm_bnw_armour_stripes,itm_sturmhaube_1BW,itm_sturmhaube_5BW,itm_sturmhaube_7BW,itm_bear_paw_shoes,itm_bnw_gauntlets],
   str_22|agi_18|level(30),wp(120),knows_common|knows_ironflesh_6|knows_power_strike_5|knows_athletics_4,mercenary_face_1, mercenary_face_2],

and the item(s):
Code:
["sturmhaube_1BW", "Sturmhaube", [("sturmhaube_1BW",0)], itp_merchandise| itp_type_head_armor ,0,
 1048 , weight(2)|abundance(100)|head_armor(48)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
["sturmhaube_5BW", "Sturmhaube", [("sturmhaube_5BW",0)], itp_merchandise| itp_type_head_armor ,0,
 1280 , weight(2)|abundance(100)|head_armor(50)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
["sturmhaube_7BW", "Sturmhaube", [("sturmhaube_7BW",0)], itp_merchandise| itp_type_head_armor ,0,
 1148 , weight(2)|abundance(100)|head_armor(50)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],

I notice it only seems to happen when I give the items to troops. Removing them means it compiles fine. Do I have to add something to process_operations? And if so, how?

My apologies if the solution is obvious.
 
Whenever you add new entries of anything (troops, items, etc) the compiler generates a list of IDs with the new item's name. In some cases, module_troops is compiled before module_items, and so what you can do is compile twice, or remove the references in module_troops, compile so the ID_Items is generated first, and then put the item back in the inventory list.
 
itm_armet2 = 761
itm_sturmhaube_1bw = 762
itm_sturmhaube_5bw = 763
itm_sturmhaube_7bw = 764
itm_wisby_gauntlets = 765

EDIT: Apparently it's the capitalized BW part. Odd; it's ususally not such a truculent ass.
 
Status
Not open for further replies.
Back
Top Bottom