• Please note that we've updated the Mount & Blade II: Bannerlord save file system which requires you to take certain steps in order for your save files to be compatible with e1.7.1 and any later updates. You can find the instructions here.

Need help With fixing an error who hide another

Users who are viewing this thread

Gess1t

Recruit
WB
So I've begun modding 2 days ago via module system 1.7.1 and swyfter's cartographer. the map editor work fine, but this isn't the case for the module system, i had to fix most of the issues until a moment where an error wasn't fixable, and here are these:

- File: (PATH)\module_party_templates.py, line 65, in <module> :

("spy_partners", "Unremarkable Travellers", icon_gray_knight|carries_goods(10)|pf_default_behavior|pf_quest_party,0,fac_neutral,merchant_personality,[(trp_spu_partner,1,1),(trp_caravan_guard,5,11)]),

NameError: name "trp_spy_partner" is not defined

And i think that after this one there are tons of other error waiting for me.
i actually know that the error don't come from this part especially but it's can be anythings, i'm personally still searching myself.

so here is a the code of my module_party_templates.py file (don't ask me about my troops names, that began with some crazy think at 3 A.M) :

Code:
from header_common import *
from header_parties import *
from ID_troops import *
from ID_factions import *
from ID_map_icons import *
 
pmf_is_prisoner = 0x0001
 
####################################################################################################################
#  Each party template record contains the following fields:
#  1) Party-template id: used for referencing party-templates in other files.
#     The prefix pt_ is automatically added before each party-template id.
#  2) Party-template name.
#  3) Party flags. See header_parties.py for a list of available flags
#  4) Menu. ID of the menu to use when this party is met. The value 0 uses the default party encounter system.
#  5) Faction
#  6) Personality. See header_parties.py for an explanation of personality flags.
#  7) List of stacks. Each stack record is a tuple that contains the following fields:
#    7.1) Troop-id.
#    7.2) Minimum number of troops in the stack.
#    7.3) Maximum number of troops in the stack.
#    7.4) Member flags(optional). Use pmf_is_prisoner to note that this member is a prisoner.
#     Note: There can be at most 6 stacks.
####################################################################################################################
 
 
party_templates = [
  ("none","none",icon_gray_knight,0,fac_commoners,merchant_personality,[]),
  ("rescued_prisoners","Rescued Prisoners",icon_gray_knight,0,fac_commoners,merchant_personality,[]),
  ("enemy","Enemy",icon_gray_knight,0,fac_undeads,merchant_personality,[]),
  ("hero_party","Hero Party",icon_gray_knight,0,fac_commoners,merchant_personality,[]),
####################################################################################################################
# Party templates before this point are hard-wired into the game and should not be changed.
####################################################################################################################
##  ("old_garrison","Old Garrison",icon_vaegir_knight,0,fac_neutral,merchant_personality,[]),
  ("village_defenders","Village Defenders",icon_peasant,0,fac_commoners,merchant_personality,[(trp_farmer,10,20),(trp_peasant_woman,0,4)]),
 
  ("cattle_herd","Cattle Herd",icon_cattle|carries_goods(10),0,fac_neutral,merchant_personality,[(trp_cattle,80,120)]),
 
##  ("vaegir_nobleman","Vaegir Nobleman",icon_vaegir_knight|carries_goods(10)|pf_quest_party,0,fac_commoners,merchant_personality,[(trp_nobleman,1,1),(trp_vaegir_knight,2,6),(trp_vaegir_horseman,4,12)]),
##  ("swadian_nobleman","Swadian Nobleman",icon_gray_knight|carries_goods(10)|pf_quest_party,0,fac_commoners,merchant_personality,[(trp_nobleman,1,1),(trp_swadian_knight,2,6),(trp_swadian_man_at_arms,4,12)]),
# Ryan BEGIN
  ("looters","Looters",icon_axeman|carries_goods(8),0,fac_outlaws,bandit_personality,[(trp_looter,3,45)]),
# Ryan END
  ("manhunters","Manhunters",icon_gray_knight,0,fac_manhunters,soldier_personality,[(trp_manhunter,9,40)]),
##  ("peasant","Peasant",icon_peasant,0,fac_commoners,merchant_personality,[(trp_farmer,1,6),(trp_peasant_woman,0,7)]),
 
#  ("black_khergit_raiders","Black Khergit Raiders",icon_khergit_horseman_b|carries_goods(2),0,fac_black_khergits,bandit_personality,[(trp_black_khergit_guard,1,10),(trp_black_khergit_horseman,5,5)]),
  ("steppe_bandits","Steppe Bandits",icon_khergit|carries_goods(2),0,fac_outlaws,bandit_personality,[(trp_steppe_bandit,4,58)]),
  ("taiga_bandits","Tundra Bandits",icon_axeman|carries_goods(2),0,fac_outlaws,bandit_personality,[(trp_taiga_bandit,4,58)]),
  ("desert_bandits","Desert Bandits",icon_vaegir_knight|carries_goods(2),0,fac_outlaws,bandit_personality,[(trp_desert_bandit,4,58)]),
  ("forest_bandits","Forest Bandits",icon_axeman|carries_goods(2),0,fac_forest_bandits,bandit_personality,[(trp_forest_bandit,4,52)]),
  ("mountain_bandits","Mountain Bandits",icon_axeman|carries_goods(2),0,fac_mountain_bandits,bandit_personality,[(trp_mountain_bandit,4,60)]),
  ("sea_raiders","Sea Raiders",icon_axeman|carries_goods(2),0,fac_outlaws,bandit_personality,[(trp_sea_raider,5,50)]),
 
  ("deserters","Deserters",icon_vaegir_knight|carries_goods(3),0,fac_deserters,bandit_personality,[]),
   
  ("merchant_caravan","Merchant Caravan",icon_gray_knight|carries_goods(20)|pf_auto_remove_in_town|pf_quest_party,0,fac_commoners,escorted_merchant_personality,[(trp_caravan_master,1,1),(trp_caravan_guard,5,25)]),
  ("troublesome_bandits","Troublesome Bandits",icon_axeman|carries_goods(9)|pf_quest_party,0,fac_outlaws,bandit_personality,[(trp_bandit,14,55)]),
  ("bandits_awaiting_ransom","Bandits Awaiting Ransom",icon_axeman|carries_goods(9)|pf_auto_remove_in_town|pf_quest_party,0,fac_neutral,bandit_personality,[(trp_bandit,24,58),(trp_kidnapped_girl,1,1,pmf_is_prisoner)]),
  ("kidnapped_girl","Kidnapped Girl",icon_woman|pf_quest_party,0,fac_neutral,merchant_personality,[(trp_kidnapped_girl,1,1)]),
 
  ("village_farmers","Village Farmers",icon_peasant|pf_civilian,0,fac_innocents,merchant_personality,[(trp_farmer,5,10),(trp_peasant_woman,3,8)]),
 
  ("spy_partners", "Unremarkable Travellers", icon_gray_knight|carries_goods(10)|pf_default_behavior|pf_quest_party,0,fac_neutral,merchant_personality,[(trp_spy_partner,1,1),(trp_caravan_guard,5,11)]),
  ("runaway_serfs","Runaway Serfs",icon_peasant|carries_goods(8)|pf_default_behavior|pf_quest_party,0,fac_neutral,merchant_personality,[(trp_farmer,6,7), (trp_peasant_woman,3,3)]),
  ("spy", "Ordinary Townsman", icon_gray_knight|carries_goods(4)|pf_default_behavior|pf_quest_party,0,fac_neutral,merchant_personality,[(trp_spy,1,1)]),
  ("sacrificed_messenger", "Sacrificed Messenger", icon_gray_knight|carries_goods(3)|pf_default_behavior|pf_quest_party,0,fac_neutral,merchant_personality,[]),
##  ("conspirator", "Conspirators", icon_gray_knight|carries_goods(8)|pf_default_behavior|pf_quest_party,0,fac_neutral,merchant_personality,[(trp_conspirator,3,4)]),
##  ("conspirator_leader", "Conspirator Leader", icon_gray_knight|carries_goods(8)|pf_default_behavior|pf_quest_party,0,fac_neutral,merchant_personality,[(trp_conspirator_leader,1,1)]),
##  ("peasant_rebels", "Peasant Rebels", icon_peasant,0,fac_peasant_rebels,bandit_personality,[(trp_peasant_rebel,33,97)]),
##  ("noble_refugees", "Noble Refugees", icon_gray_knight|carries_goods(12)|pf_quest_party,0,fac_noble_refugees,merchant_personality,[(trp_noble_refugee,3,5),(trp_noble_refugee_woman,5,7)]),
 
  ("forager_party","Foraging Party",icon_gray_knight|carries_goods(5)|pf_show_faction,0,fac_commoners,merchant_personality,[]),
  ("scout_party","Scouts",icon_gray_knight|carries_goods(1)|pf_show_faction,0,fac_commoners,bandit_personality,[]),
  ("patrol_party","Patrol",icon_gray_knight|carries_goods(2)|pf_show_faction,0,fac_commoners,soldier_personality,[]),
#  ("war_party", "War Party",icon_gray_knight|carries_goods(3),0,fac_commoners,soldier_personality,[]),
  ("messenger_party","Messenger",icon_gray_knight|pf_show_faction,0,fac_commoners,merchant_personality,[]),
  ("raider_party","Raiders",icon_gray_knight|carries_goods(16)|pf_quest_party,0,fac_commoners,bandit_personality,[]),
  ("raider_captives","Raider Captives",0,0,fac_commoners,0,[(trp_peasant_woman,6,30,pmf_is_prisoner)]),
  ("kingdom_caravan_party","Caravan",icon_mule|carries_goods(25)|pf_show_faction,0,fac_commoners,merchant_personality,[(trp_caravan_master,1,1),(trp_caravan_guard,12,40)]),
  ("prisoner_train_party","Prisoner Train",icon_gray_knight|carries_goods(5)|pf_show_faction,0,fac_commoners,merchant_personality,[]),
  ("default_prisoners","Default Prisoners",0,0,fac_commoners,0,[(trp_bandit,5,10,pmf_is_prisoner)]),
 
  ("routed_warriors","Routed Enemies",icon_vaegir_knight,0,fac_commoners,soldier_personality,[]),
 
 
# Caravans
  ("center_reinforcements","Reinforcements",icon_axeman|carries_goods(16),0,fac_commoners,soldier_personality,[(trp_townsman,5,30),(trp_watchman,4,20)]),  
 
  ("kingdom_hero_party","War Party",icon_flagbearer_a|pf_show_faction|pf_default_behavior,0,fac_commoners,soldier_personality,[]),
 
# Reinforcements
  # each faction includes three party templates. One is less-modernised, one is med-modernised and one is high-modernised
  # less-modernised templates are generally includes 7-14 troops in total,
  # med-modernised templates are generally includes 5-10 troops in total,
  # high-modernised templates are generally includes 3-5 troops in total
 
  ("kingdom_1_reinforcements_a", "{!}kingdom_1_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_swadian_recruit,5,10),(trp_swadian_militia,2,4)]),
  ("kingdom_1_reinforcements_b", "{!}kingdom_1_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_swadian_footman,3,6),(trp_swadian_skirmisher,2,4)]),
  ("kingdom_1_reinforcements_c", "{!}kingdom_1_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_swadian_man_at_arms,2,4),(trp_swadian_crossbowman,1,2)]), #Swadians are a bit less-powered thats why they have a bit more troops in their modernised party template (3-6, others 3-5)
 
  ("kingdom_2_reinforcements_a", "{!}kingdom_2_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_vaegir_recruit,5,10),(trp_vaegir_footman,2,4)]),
  ("kingdom_2_reinforcements_b", "{!}kingdom_2_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_vaegir_veteran,2,4),(trp_vaegir_skirmisher,2,4),(trp_vaegir_footman,1,2)]),
  ("kingdom_2_reinforcements_c", "{!}kingdom_2_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_vaegir_horseman,2,3),(trp_vaegir_infantry,1,2)]),
 
  ("kingdom_3_reinforcements_a", "{!}kingdom_3_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_khergit_tribesman,3,5),(trp_khergit_skirmisher,4,9)]), #Khergits are a bit less-powered thats why they have a bit more 2nd upgraded(trp_khergit_skirmisher) than non-upgraded one(trp_khergit_tribesman).
  ("kingdom_3_reinforcements_b", "{!}kingdom_3_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_khergit_horseman,2,4),(trp_khergit_horse_archer,2,4),(trp_khergit_skirmisher,1,2)]),
  ("kingdom_3_reinforcements_c", "{!}kingdom_3_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_khergit_horseman,2,4),(trp_khergit_veteran_horse_archer,2,3)]), #Khergits are a bit less-powered thats why they have a bit more troops in their modernised party template (4-7, others 3-5)
 
  ("kingdom_4_reinforcements_a", "{!}kingdom_4_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_nord_footman,5,10),(trp_nord_recruit,2,4)]),
  ("kingdom_4_reinforcements_b", "{!}kingdom_4_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_nord_huntsman,2,5),(trp_nord_archer,2,3),(trp_nord_footman,1,2)]),
  ("kingdom_4_reinforcements_c", "{!}kingdom_4_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_nord_warrior,3,5)]),
 
  ("kingdom_5_reinforcements_a", "{!}kingdom_5_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_rhodok_tribesman,5,10),(trp_rhodok_spearman,2,4)]),
  ("kingdom_5_reinforcements_b", "{!}kingdom_5_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_rhodok_crossbowman,3,6),(trp_rhodok_trained_crossbowman,2,4)]),
  ("kingdom_5_reinforcements_c", "{!}kingdom_5_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_rhodok_veteran_spearman,2,3),(trp_rhodok_veteran_crossbowman,1,2)]),
 
  ("kingdom_6_reinforcements_a", "{!}kingdom_6_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_sarranid_recruit,5,10),(trp_sarranid_footman,2,4)]),
  ("kingdom_6_reinforcements_b", "{!}kingdom_6_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_sarranid_skirmisher,2,4),(trp_sarranid_veteran_footman,2,3),(trp_sarranid_footman,1,3)]),
  ("kingdom_6_reinforcements_c", "{!}kingdom_6_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_sarranid_horseman,3,5)]),
 
  ("kingdom_7_reinforcements_a", "{!}kingdom_7_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_twitch_noob,5,10),(trp_twitch_walker,2,4)]),
  ("kingdom_7_reinforcements_b", "{!}kingdom_7_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_Twitch_streamstalker_beginner,2,4),(trp_twitch_veteran_walker,2,3),(trp_twitch_walker,1,3)]),
  ("kingdom_7_reinforcements_c", "{!}kingdom_7_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_twitch_raider,3,5)]),
 
##  ("kingdom_1_reinforcements_a", "kingdom_1_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_swadian_footman,3,7),(trp_swadian_skirmisher,5,10),(trp_swadian_militia,11,26)]),
##  ("kingdom_1_reinforcements_b", "kingdom_1_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_swadian_man_at_arms,5,10),(trp_swadian_infantry,5,10),(trp_swadian_crossbowman,3,8)]),
##  ("kingdom_1_reinforcements_c", "kingdom_1_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_swadian_knight,2,6),(trp_swadian_sergeant,2,5),(trp_swadian_sharpshooter,2,5)]),
##
##  ("kingdom_2_reinforcements_a", "kingdom_2_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_vaegir_veteran,3,7),(trp_vaegir_skirmisher,5,10),(trp_vaegir_footman,11,26)]),
##  ("kingdom_2_reinforcements_b", "kingdom_2_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_vaegir_horseman,4,9),(trp_vaegir_infantry,5,10),(trp_vaegir_archer,3,8)]),
##  ("kingdom_2_reinforcements_c", "kingdom_2_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_vaegir_knight,3,7),(trp_vaegir_guard,2,5),(trp_vaegir_marksman,2,5)]),
##
##  ("kingdom_3_reinforcements_a", "kingdom_3_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_khergit_horseman,3,7),(trp_khergit_skirmisher,5,10),(trp_khergit_tribesman,11,26)]),
##  ("kingdom_3_reinforcements_b", "kingdom_3_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_khergit_veteran_horse_archer,4,9),(trp_khergit_horse_archer,5,10),(trp_khergit_horseman,3,8)]),
##  ("kingdom_3_reinforcements_c", "kingdom_3_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_khergit_lancer,3,7),(trp_khergit_veteran_horse_archer,2,5),(trp_khergit_horse_archer,2,5)]),
##
##  ("kingdom_4_reinforcements_a", "kingdom_4_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_nord_trained_footman,3,7),(trp_nord_footman,5,10),(trp_nord_recruit,11,26)]),
##  ("kingdom_4_reinforcements_b", "kingdom_4_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_nord_veteran,4,9),(trp_nord_warrior,5,10),(trp_nord_footman,3,8)]),
##  ("kingdom_4_reinforcements_c", "kingdom_4_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_nord_champion,1,3),(trp_nord_veteran,2,5),(trp_nord_warrior,2,5)]),
##
##  ("kingdom_5_reinforcements_a", "kingdom_5_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_rhodok_spearman,3,7),(trp_rhodok_crossbowman,5,10),(trp_rhodok_tribesman,11,26)]),
##  ("kingdom_5_reinforcements_b", "kingdom_5_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_rhodok_trained_spearman,4,9),(trp_rhodok_spearman,5,10),(trp_rhodok_crossbowman,3,8)]),
##  ("kingdom_5_reinforcements_c", "kingdom_5_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_rhodok_sergeant,3,7),(trp_rhodok_veteran_spearman,2,5),(trp_rhodok_veteran_crossbowman,2,5)]),
 
 
 
  ("steppe_bandit_lair" ,"Steppe Bandit Lair",icon_bandit_lair|carries_goods(2)|pf_is_static|pf_hide_defenders,0,fac_neutral,bandit_personality,[(trp_steppe_bandit,15,58)]),
  ("taiga_bandit_lair","Tundra Bandit Lair",icon_bandit_lair|carries_goods(2)|pf_is_static|pf_hide_defenders,0,fac_neutral,bandit_personality,[(trp_taiga_bandit,15,58)]),
  ("desert_bandit_lair" ,"Desert Bandit Lair",icon_bandit_lair|carries_goods(2)|pf_is_static|pf_hide_defenders,0,fac_neutral,bandit_personality,[(trp_desert_bandit,15,58)]),
  ("forest_bandit_lair" ,"Forest Bandit Camp",icon_bandit_lair|carries_goods(2)|pf_is_static|pf_hide_defenders,0,fac_neutral,bandit_personality,[(trp_forest_bandit,15,58)]),
  ("mountain_bandit_lair" ,"Mountain Bandit Hideout",icon_bandit_lair|carries_goods(2)|pf_is_static|pf_hide_defenders,0,fac_neutral,bandit_personality,[(trp_mountain_bandit,15,58)]),
  ("sea_raider_lair","Sea Raider Landing",icon_bandit_lair|carries_goods(2)|pf_is_static|pf_hide_defenders,0,fac_neutral,bandit_personality,[(trp_sea_raider,15,50)]),
  ("looter_lair","Kidnappers' Hideout",icon_bandit_lair|carries_goods(2)|pf_is_static|pf_hide_defenders,0,fac_neutral,bandit_personality,[(trp_looter,15,25)]),
 
  ("bandit_lair_templates_end","{!}bandit_lair_templates_end",icon_axeman|carries_goods(2)|pf_is_static,0,fac_outlaws,bandit_personality,[(trp_sea_raider,15,50)]),
 
  ("leaded_looters","Band of robbers",icon_axeman|carries_goods(8)|pf_quest_party,0,fac_neutral,bandit_personality,[(trp_looter_leader,1,1),(trp_looter,3,3)]),
]

Used the tutorial here : https://forums.taleworlds.com/index.php?topic=334271.0

The Module builder created these files :

- Actions.txt
- Factions.txt
- info_pages.txt
- meshes.txt
- music.txt
- particle_systems.txt
- postfx.txt
- quests.txt
- skills.txt
- skins.txt
- sounds.txt
- strings.txt
- troops.txt

Tools used :

- Module_system
- Swyfter's Cartographer
- Morghs M&B WB-WFAS Editor
(who just put every lord code / troop code / other in 1 line / things and broke most of my code)

I redone it 2 time and that take me about 15h to do so i don't want to restart from 0. (done this post 2 times too cause i've got timeout =/)
If needed, i can provide my other file used, just ask me, and i'll will do it.

Hope some of you can help me.
 

Pitch

Squire
WBNWVCM&BWF&S
Make sure you dont use txt editors like morgh with module system at same Time.use only modsys.


You use troop which doesnt exist in your module troops py
 

Gess1t

Recruit
WB
PitchPL said:
Make sure you dont use txt editors like morgh with module system at same Time.use only modsys.


You use troop which doesnt exist in your module troops py

Well... then this part of code is given with the module_system and it's working fine if i only edit the map file so, what can i do about that? just delete it? or maybe i should edit it?
by the way thanks you for trying to help me
 

Pitch

Squire
WBNWVCM&BWF&S
Which files you exactly  edit  in your modsys and what you edit/are in your module system files.


I dont have modsys installed but adding  New troop  called "spy_partner" should fix your problem .
 

kalarhan

Python Saint
Count
WBNWVCWF&S
Gess1t said:
what can i do about that?

add troop on module_troops.py
compile (build_module.bat)
add new troop on your template on module_party_templates.py
compile again
play

in short: add something, compile, then use it. Dont skip the compilation phase.
 

Gess1t

Recruit
WB
PitchPL said:
Which files you exactly  edit  in your modsys and what you edit/are in your module system files.


I dont have modsys installed but adding  New troop  called "spy_partner" should fix your problem .

I've discovered that the spy_partern is the guys who defend the spy in a certain quest, so it should be in troops.py
and well, yes of course it is.

for the file i've edited :

- module_factions.py
- module_troops.py
- module_party_templates.py
- module_scripts.py
- module_constants.py
- module_meshes.py
- module_scene_props.py
- module_map_icons.py
- module_parties.py

and that's it.


kalarhan said:
add troop on module_troops.py
compile (build_module.bat)
add new troop on your template on module_party_templates.py
compile again
play

in short: add something, compile, then use it. Dont skip the compilation phase.

So i have to re-edit the files again?
ok i'll try,if my brain don't break while doing it.



EDIT:
the same error appear but party_templates is created.
The error appear when i edited module_troops.py and added my kingdoms troop, a new NPC Attribute, new Companions, New Arena challenger (you know all npcs like xerina / kradus), a king to my new faction, and knights (again don't pay attention to their names, same reason)

Code: https://pastebin.com/JQQCYjCJ
 

kalarhan

Python Saint
Count
WBNWVCWF&S
you have syntax mistakes. You need to fix them first. Learn to do modding in small bites (or baby steps). Do a small change, compile to see if the syntax is ok, move to the next

example:

Code:
["Ninja","Ninja","Ninja",tf_hero|tf_hero, scn_the_happy_boar|entry(10),reserved,  fac_commoners,[itm_leather_vest,itm_hide_boots],def_attrib|str_18|agi_15|level(45),wp(325),knows_power_strike_6|knows_ironflesh_6|knows_riding_6|knows_power_draw_4|knows_athletics_8|knows_shield_3,0x00000001ac0820074920561d0b51e6ed00000000001d40ed0000000000000000],]
note how you have a extra "]" at the end of your Ninja
 

Gess1t

Recruit
WB
kalarhan said:
you have syntax mistakes. You need to fix them first. Learn to do modding in small bites (or baby steps). Do a small change, compile to see if the syntax is ok, move to the next

example:

Code:
["Ninja","Ninja","Ninja",tf_hero|tf_hero, scn_the_happy_boar|entry(10),reserved,  fac_commoners,[itm_leather_vest,itm_hide_boots],def_attrib|str_18|agi_15|level(45),wp(325),knows_power_strike_6|knows_ironflesh_6|knows_riding_6|knows_power_draw_4|knows_athletics_8|knows_shield_3,0x00000001ac0820074920561d0b51e6ed00000000001d40ed0000000000000000],]
note how you have a extra "]" at the end of your Ninja

I've fixed the attribute conflict (who were giving at the end +15 skill points in certains skills),
double checked for any syntax issues on the modified/Added code, did find some problem and fixed some but not of all them. i've updated my code and still searching for more

EDIT : fixed the issue for now, gonna tell you if i have other issues in the future

EDIT2: Another error :

Code:
Unable to find object : trp_twitch_castle_admin
Illegal Identifier : trp_twitch_castle_admin

don't see why this error appear, there is no error with the troop ID, no caps, and i can't paste the code to pastebin cause the 512's kb limit, so i will paste the part of the code where trp_twitch_castle_admin appear:

Code:
(else_try),
          (faction_slot_eq, ":faction_no", slot_faction_culture, "fac_culture_7"),
      
          (faction_set_slot, ":faction_no", slot_faction_deserter_troop, "trp_twitch_deserter"),
          (faction_set_slot, ":faction_no", slot_faction_guard_troop, "trp_twitch_castle_admin"),
          (faction_set_slot, ":faction_no", slot_faction_messenger_troop, "trp_twitch_messenger"),
          (faction_set_slot, ":faction_no", slot_faction_prison_guard_troop, "trp_twitch_prison_moderator"),
          (faction_set_slot, ":faction_no", slot_faction_castle_guard_troop, "trp_twitch_castle_admin"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_a, "pt_kingdom_7_reinforcements_a"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_b, "pt_kingdom_7_reinforcements_b"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_c, "pt_kingdom_7_reinforcements_c"),
 

kalarhan

Python Saint
Count
WBNWVCWF&S
Gess1t said:
Code:
Unable to find object : trp_twitch_castle_admin
Illegal Identifier : trp_twitch_castle_admin

check your ID_troops.py. If it is not there, then compile your troops file first.
 

Gess1t

Recruit
WB
kalarhan said:
Gess1t said:
Code:
Unable to find object : trp_twitch_castle_admin
Illegal Identifier : trp_twitch_castle_admin

check your ID_troops.py. If it is not there, then compile your troops file first.

this was in id_troops.py : trp_twitch_castle_admintwitch_castle_admin = 126, that explain why this wasn't working, small bug of module system
but i can't edit it and the id in troops.py is twitch_castle_admin, so i don't know why it's writing it 2 times in a row

BUT there is an error with process_troops.py :

Code:
Traceback (most recent call last):
  File "process_troops.py", line 107, in <module>
    save_troops()
  File "process_troops.py", line 34, in save_troops
    file.write("\ntrp_%s %s %s %s %d %d %d %d %d %d\n  "%(convert_to_identifier(
troop[0]),replace_spaces(troop[1]),replace_spaces(troop[2]), replace_spaces(str(
troop[13])), troop[3],troop[4],troop[5], troop[6], troop[14], troop[15]))
  File "C:\Users\Gess1t\Desktop\Mapping\Module system 1.7.1\mb_warband_module_
system_1171\Instance 4 (newest)\Module_system 1.171\process_common.py", line 30,
 in replace_spaces
    return string.replace(string.replace(s0,"\t","_")," ","_")
  File "C:\Python27\lib\string.py", line 519, in replace
    return s.replace(old, new, maxreplace)
AttributeError: 'int' object has no attribute 'replace'

i've looked at my other broken instance of module_system and found that the bug was here too

module_scripts.py code on google drive : https://drive.google.com/open?id=1R-tC53TSyIER_-6G2ZWy_uXdh0VWPQfn

EDIT: i've replaced the scripts id with id_troops.py id, and now, my script is broken, nice same error as before

EDIT2: I'm an idiot i took the wrong instance of the module builder
 

Gess1t

Recruit
WB
kalarhan said:
Gess1t said:
BUT there is an error with process_troops.py :

this is still a syntax error, so go back to your changes and fix them.

i'm gonna try but i haven't changed anythings in this file

process_common.py : https://pastebin.com/RMsWktP0
process_troops.py : https://pastebin.com/vZjmfnmR
 

kalarhan

Python Saint
Count
WBNWVCWF&S
Gess1t said:
i'm gonna try but i haven't changed anythings in this file

process_XXX.py is the code that compiles your modsys into a .txt file. So the process_troops.py is trying to read and do stuff with module_troops.py, which is bugged (your syntax errors) and it breaks.
 

Gess1t

Recruit
WB
kalarhan said:
Gess1t said:
i'm gonna try but i haven't changed anythings in this file

process_XXX.py is the code that compiles your modsys into a .txt file. So the process_troops.py is trying to read and do stuff with module_troops.py, which is bugged (your syntax errors) and it breaks.

well the only things that my twitch_prison_moderator have more than twitch_castle_admin is 2x space in his line of codes to make sure that these two line are included in twitch_castle_admin so i'm trying to understand why he can't read it properly.

EDIT: Now all my troops line are aligned and their stuff is included in their line, still searching for the famous syntaxes, i've also updated the module_troops.py code : https://pastebin.com/JQQCYjCJ
 

kalarhan

Python Saint
Count
WBNWVCWF&S
Gess1t said:
still searching for the famous syntaxe

read the error message. Understand the error message. Find the error. Fix the error. Rinse and repeat. As you get used to the modsys you will be making less mistakes.

showing just one file doesnt really help. You should show us the log message instead. And learn how to interpret it, as you will be doing that a lot.
 

Gess1t

Recruit
WB
The only things i understand in this error is that it's writing twice the same ID in a row and that breaking my entire code, but i don't know why it's doing this ( i know that the cause isn't from the python's system file) and this seems so obvious for you,
I've checked every parts of the files i've edited and found just NOTHINGS.
i'll still continue but if i don't find anythings in the next 48h i'm going to give up on this and just pass away,

EDIT:
1532695998-capture-d-ecran-403.jpg


EDIT2: Banner time!

Code:
Traceback (most recent call last):
  File "process_global_variables_unused.py", line 3, in <module>
    from process_operations import *
  File "C:\Users\samdra.r\Desktop\Mapping\Module system 1.7.1\mb_warband_module_
system_1171\Instance 4 (newest)\Module_system 1.171\process_operations.py", line
 20, in <module>
    from module_scripts import *
  File "C:\Users\samdra.r\Desktop\Mapping\Module system 1.7.1\mb_warband_module_
system_1171\Instance 4 (newest)\Module_system 1.171\module_scripts.py", line 449
, in <module>
    (store_add, ":kingdom_7_banners_begin", banner_scene_props_begin, kingdom_7_
banners_begin_offset),
NameError: name 'kingdom_7_banners_begin_offset' is not defined

Updated Module_scripts.py: https://drive.google.com/open?id=13Ydq7TyNadBZspeAI71_uVTjBOoy__xh
 

kalarhan

Python Saint
Count
WBNWVCWF&S
Gess1t said:

syntax errors are annoying when you starting out. I recommend you use a proper text editor for coding, as they use color coding which helps quite a lot. My personal recommendation is SublimeText (free for personal use), with the MB Plugin https://forums.taleworlds.com/index.php/topic,320675.0.html. You will not just avoid silly mistakes by using it, you will also code 10x as fast.

Code:
Traceback (most recent call last):
  File "process_global_variables_unused.py", line 3, in <module>
    from process_operations import *
  File "C:\Users\samdra.r\Desktop\Mapping\Module system 1.7.1\mb_warband_module_
system_1171\Instance 4 (newest)\Module_system 1.171\process_operations.py", line
 20, in <module>
    from module_scripts import *
  File "C:\Users\samdra.r\Desktop\Mapping\Module system 1.7.1\mb_warband_module_
system_1171\Instance 4 (newest)\Module_system 1.171\module_scripts.py", line 449
, in <module>
    (store_add, ":kingdom_7_banners_begin", banner_scene_props_begin, kingdom_7_
banners_begin_offset),
NameError: name 'kingdom_7_banners_begin_offset' is not defined

you are including a new faction, did you follow the tutorial? This error indicates you did not add the constant (module_constants.py) for it. See https://forums.taleworlds.com/index.php/topic,334271.0.html



Gess1t said:
and this seems so obvious for you

I am what you would call a veteran modder (many years working with MB coding), plus I am a pro software engineer (my job), so dont get discouraged by mistakes as you are a beginner. Things will get better, one step at time. Just remember to do small tasks, compile often (do a small change, save, compile, repeat). Baby steps. As you get better you will be able to work longer without doing any mistakes.
 

Gess1t

Recruit
WB
kalarhan said:
syntax errors are annoying when you starting out. I recommend you use a proper text editor for coding, as they use color coding which helps quite a lot. My personal recommendation is SublimeText (free for personal use), with the MB Plugin https://forums.taleworlds.com/index.php/topic,320675.0.html. You will not just avoid silly mistakes by using it, you will also code 10x as fast.

Most of the code editor I've used in the past like Monodevellop,Integrated coder (using that for coding a game that i've gave up) where not working or were hard to use like virtual studio, tried to use virtual studio to test my code but wasn't working, so that why i'm using notepad ++ which provide color coding as you say, made the work easier for me.

kalarhan said:
you are including a new faction, did you follow the tutorial? This error indicates you did not add the constant (module_constants.py) for it. See https://forums.taleworlds.com/index.php/topic,334271.0.html

I've followed the ENTIRE tutorial from beginning to end (i already have the banner ready and all the .brf files)

EDIT2:
Code:
custom_banner_map_icons_begin = "icon_custom_banner_01"
custom_banner_map_icons_end = "icon_banner_01"

banner_map_icons_begin = "icon_banner_01"
banner_map_icons_end_minus_one = "icon_banner_157"

banner_scene_props_begin = "spr_banner_a"
banner_scene_props_end_minus_one = "spr_banner_f21"

khergit_banners_begin_offset = 63
khergit_banners_end_offset = 84

sarranid_banners_begin_offset = 105
sarranid_banners_end_offset = 125

sarranid_banners_begin_offset = 126
sarranid_banners_end_offset = 146

banners_end_offset = 157

that my constant code : https://pastebin.com/X5KdxvEf

EDIT3: WTF that just deleted this part of codes and an other one, fixing this

EDIT4: Fixed that going to the next step

EDIT5: Is there any way to make the villagers of my factions walking at hallucinatory speed? i know about knows_athletics_10 but there is an other way?
 

kalarhan

Python Saint
Count
WBNWVCWF&S
Gess1t said:
I've followed the ENTIRE tutorial from beginning to end (i already have the banner ready and all the .brf files)

then re-read it and do it again, as you at least did not add the constants (step 2).

see your error message. It tells you that "kingdom_7_banners_begin_offset" is not on module_constants.py. Like mentioned earlier, you need to learn to interpret the error message (essential skill) if you want to fix your mistakes.
 

Gess1t

Recruit
WB
kalarhan said:
Gess1t said:
I've followed the ENTIRE tutorial from beginning to end (i already have the banner ready and all the .brf files)

then re-read it and do it again, as you at least did not add the constants (step 2).

see your error message. It tells you that "kingdom_7_banners_begin_offset" is not on module_constants.py. Like mentioned earlier, you need to learn to interpret the error message (essential skill) if you want to fix your mistakes.

Done the mod, i'm coping pasting scene to avoid glitch, going to test it soon

EDIT: the castle and town aren't given to twitch's faction, but to rodoks, and the twitch are dead 30s after the beginning, why? the twitch's villages aren't giving twitch troops too.
I gave them a town and castle in module_script
 
Top Bottom