kirinelf
Sergeant

TheMageLord had a post here: [Link] on how to change the troops recruit-able from a village depending on the faction of its owner. For example, if the Nords take over a Swadian territory, that village starts producing Nord recruits rather than Swadian troops like it normally would. However, he's added a check to disable this tweak in the case the village belongs to the player, since by default the player has no troops in his faction.
I've used Morgh's Troop Editor to add some troops to the player's faction in my Warband Native, so I'd like to be able to disable that check. But since I have no idea what the numbers mean, I''ll have to do it from scratch with the module system. I know jack about coding in Python, so I'm posting here for help.
I assume the code I'll need to change is the top few lines of this (located on line 30285 in module_scripts.py):
Specifically this:
Am I right?
Edit: Also, is this the right place to post this? O_O
I've used Morgh's Troop Editor to add some troops to the player's faction in my Warband Native, so I'd like to be able to disable that check. But since I have no idea what the numbers mean, I''ll have to do it from scratch with the module system. I know jack about coding in Python, so I'm posting here for help.
I assume the code I'll need to change is the top few lines of this (located on line 30285 in module_scripts.py):
插入代码块:
#script_update_volunteer_troops_in_village
# INPUT: arg1 = center_no
# OUTPUT: none
("update_volunteer_troops_in_village",
[
(store_script_param, ":center_no", 1),
(party_get_slot, ":player_relation", ":center_no", slot_center_player_relation),
(party_get_slot, ":center_culture", ":center_no", slot_center_culture),
## (try_begin),
## (eq, "$cheat_mode", 2),
## (str_store_party_name, s4, ":center_no"),
## (str_store_faction_name, s5, ":center_culture"),
## (display_message, "str_updating_volunteers_for_s4_faction_is_s5"),
## (try_end),
(faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1_troop),
(assign, ":volunteer_troop_tier", 1),
(store_div, ":tier_upgrades", ":player_relation", 10),
(try_for_range, ":unused", 0, ":tier_upgrades"),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", 10),
(store_random_in_range, ":random_no", 0, 2),
(troop_get_upgrade_troop, ":upgrade_troop_no", ":volunteer_troop", ":random_no"),
(try_begin),
(le, ":upgrade_troop_no", 0),
(troop_get_upgrade_troop, ":upgrade_troop_no", ":volunteer_troop", 0),
(try_end),
(gt, ":upgrade_troop_no", 0),
(val_add, ":volunteer_troop_tier", 1),
(assign, ":volunteer_troop", ":upgrade_troop_no"),
(try_end),
(assign, ":upper_limit", 7),
(try_begin),
(ge, ":player_relation", 5),
(assign, ":upper_limit", ":player_relation"),
(val_div, ":upper_limit", 2),
(val_add, ":upper_limit", 10),
(else_try),
(lt, ":player_relation", 0),
(assign, ":upper_limit", 0),
(try_end),
(val_mul, ":upper_limit", 3),
(store_add, ":amount_random_divider", 2, ":volunteer_troop_tier"),
(val_div, ":upper_limit", ":amount_random_divider"),
(store_random_in_range, ":amount", 0, ":upper_limit"),
(party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
(party_set_slot, ":center_no", slot_center_volunteer_troop_amount, ":amount"),
]),
Specifically this:
插入代码块:
(party_get_slot, ":center_culture", ":center_no", slot_center_culture),
Edit: Also, is this the right place to post this? O_O


