Village elder in custom towns

Users who are viewing this thread

For some reason 3 towns (added by me) have village elders instead of guild masters, the problem is those guild masters are present in module_troops

["town_51_mayor", "Guild_Master", "{!}Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_fur_coat, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2],
["town_52_mayor", "Guild_Master", "{!}Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_fur_coat, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2],
["town_53_mayor", "Guild_Master", "{!}Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_fur_coat, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2],
["town_54_mayor", "Guild_Master", "{!}Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_fur_coat, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2],

How can i fix this ?
 
Solution
towns (which is a party) use slots to store the ID of related NPCs like who is the mayor/Guild Master. The Native way is to use the ranges to pre-define them before executing the code.

So check your module_parties.py and module_troops.py. Do they have the same groups? In the correct order and places?

Those pre-defined NPC will them be connected to the towns when a new game is created. Slots are stored inside the save game file. Thus you will also need to start a new game (campaign), cant use a load file.

Python:
# from troops
mayors_begin           = "trp_town_1_mayor"
mayors_end             = "trp_village_1_elder"

village_elders_begin   = "trp_village_1_elder"
village_elders_end     = "trp_merchants_end"

# from parties
slot_town_elder...
towns (which is a party) use slots to store the ID of related NPCs like who is the mayor/Guild Master. The Native way is to use the ranges to pre-define them before executing the code.

So check your module_parties.py and module_troops.py. Do they have the same groups? In the correct order and places?

Those pre-defined NPC will them be connected to the towns when a new game is created. Slots are stored inside the save game file. Thus you will also need to start a new game (campaign), cant use a load file.

Python:
# from troops
mayors_begin           = "trp_town_1_mayor"
mayors_end             = "trp_village_1_elder"

village_elders_begin   = "trp_village_1_elder"
village_elders_end     = "trp_merchants_end"

# from parties
slot_town_elder         = 25

# from module_scripts.py look for this line
(party_set_slot,":town_no", slot_town_elder, ":cur_object_no"),
 
Upvote 0
Solution
towns (which is a party) use slots to store the ID of related NPCs like who is the mayor/Guild Master. The Native way is to use the ranges to pre-define them before executing the code.

So check your module_parties.py and module_troops.py. Do they have the same groups? In the correct order and places?

Those pre-defined NPC will them be connected to the towns when a new game is created. Slots are stored inside the save game file. Thus you will also need to start a new game (campaign), cant use a load file.

Python:
# from troops
mayors_begin           = "trp_town_1_mayor"
mayors_end             = "trp_village_1_elder"

village_elders_begin   = "trp_village_1_elder"
village_elders_end     = "trp_merchants_end"

# from parties
slot_town_elder         = 25

# from module_scripts.py look for this line
(party_set_slot,":town_no", slot_town_elder, ":cur_object_no"),
I realized that i forgot to add some guild master :facepalm:, anyway as i understood, if you add troops to your module you can't see them in an old savegame because they aren't stored ?
 
Upvote 0
I realized that i forgot to add some guild master :facepalm:, anyway as i understood, if you add troops to your module you can't see them in an old savegame because they aren't stored ?

not quite that. Troops are loaded from the .txt file, but their ID's are not. So you will have incompatible values here.

When you started a new game the first king was ID=500
You add some new soldiers and the king is now ID=570
However the slots stored in the save file still consider king as #500. So when the code calls for ID #500, who will be used? Answer: not the king you expected :grin:

Its a mix of stuff that is static and dynamic in nature. Unless you know what is which, you should just start a new game every time.
 
Upvote 0
Back
Top Bottom