Ishapar
Regular
I have been trying to mod Warband using this mod as a base: https://www.nexusmods.com/mbwarband/mods/6044. I enjoy this mod as it adds various features to native without rehauling the game (especially making there be 12 factions with 2 extinct ones to use and the ability to execute lords). On the mod's download page, the source files posted are for version 1.2 whereas the mod is version 1.3, so I am assuming that there maybe some features missing from 1.2. I have come upon a problem though that involves coding.
On of the main features of this mod is the ability to execute lords. On version 1.3 of the mod, this is the menu that pops up when you successfully execute a lord in your prison:
As you can see, there is a "Continue..." option that you can click to allow you to leave the Execution screen and return to the world map. However, when I try my mod using the source files of version 1.2, this is what happens when I attempt an execution:
There is no option to leave the execution screen. I have tried clicking all over the screen and pressing many keyboard buttons, but the only button that allowed you to leave the screen was the "L" button which took you to the log. Unfortunately, when you leave the log you end up back on this same screen. The only way I can close the screen is to shutdown Warband through task manager. I have started up new files to test it out a couple times, but I always end up with the same issue. Again, this only happens with the source file of 4.2 while the mod version 4.3 as shown in the former image gives the player the ability to leave the screen.
I can't just use version 1.3 for my mod as it didn't come with source files for me to modify. I would lose a couple features (including hidden chests and making firearms available in the market) that I can't repeat with Morgh's or the text files. So far everything else of the 1.2 source files seems to be working fine, but I would like to fix this issue as it is a key feature of this mod. In the source files, the codes dealing with executing a lord are in the games menu and dialogs python files. Here's what I found:
module_dialogs.py
module_game_menus.py
When I have looked at other game menus, I will sometimes find the "continue...." option in the code script, so my assumption is that I'd have to place the option somewhere at the end of the menu.py file. Each time I tried, however, I kept messing it up with the syntax. I'm not a coder nor do I know much about python script, so I was wondering if one of you could explain to me where in the code I can add the "continue..." option and how to word it out. If this isn't the issue, could you please offer some insight. The source files for version 1.2 of the mod can be found in the former link if you want to take a look at them yourself. Thanks.
On of the main features of this mod is the ability to execute lords. On version 1.3 of the mod, this is the menu that pops up when you successfully execute a lord in your prison:
As you can see, there is a "Continue..." option that you can click to allow you to leave the Execution screen and return to the world map. However, when I try my mod using the source files of version 1.2, this is what happens when I attempt an execution:
There is no option to leave the execution screen. I have tried clicking all over the screen and pressing many keyboard buttons, but the only button that allowed you to leave the screen was the "L" button which took you to the log. Unfortunately, when you leave the log you end up back on this same screen. The only way I can close the screen is to shutdown Warband through task manager. I have started up new files to test it out a couple times, but I always end up with the same issue. Again, this only happens with the source file of 4.2 while the mod version 4.3 as shown in the former image gives the player the ability to leave the screen.
I can't just use version 1.3 for my mod as it didn't come with source files for me to modify. I would lose a couple features (including hidden chests and making firearms available in the market) that I can't repeat with Morgh's or the text files. So far everything else of the 1.2 source files seems to be working fine, but I would like to fix this issue as it is a key feature of this mod. In the source files, the codes dealing with executing a lord are in the games menu and dialogs python files. Here's what I found:
module_dialogs.py
Python:
[ICODE]# NPC death - player who arent liege
[anyone,"mrc_prisoner_trial_death_check",[
(faction_get_slot, ":liege", "$players_kingdom", slot_faction_leader),
(neq, ":liege", "trp_player"),
(str_store_troop_name, s2, ":liege"),
],
"This is insane {playername}! You liege {s2} would never aprove this! You can't be serious!", "mrc_prisoner_trial_death_noliege", [
]],
[anyone|plyr,"mrc_prisoner_trial_death_noliege",[
],
"You are right, forgive my rambling.", "mrc_prisoner_trial", [
]],
[anyone|plyr,"mrc_prisoner_trial_death_noliege",[
],
"I am very serious.", "mrc_prisoner_trial_death", [
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),
]],
# NPC death - player liege
[anyone,"mrc_prisoner_trial_death_check",[
(faction_get_slot, ":liege", "$players_kingdom", slot_faction_leader),
(eq, ":liege", "trp_player"),
],
"I'm not sure I heard you right, are you about to sentence me to death?", "mrc_prisoner_trial_death_liege", [
]],
[anyone|plyr,"mrc_prisoner_trial_death_liege",[
],
"Yes, that's what I said.", "mrc_prisoner_trial_death", [
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),
]],
[anyone|plyr,"mrc_prisoner_trial_death_liege",[
],
"No, I think you have misunderstood me.", "mrc_prisoner_trial", [
]],
# Npc death argument
[anyone,"mrc_prisoner_trial_death",[#honorable type argument
(troop_get_slot, ":reputation", "$g_talk_troop", slot_lord_reputation_type),
(this_or_next|eq, ":reputation", lrep_goodnatured),
(this_or_next|eq, ":reputation", lrep_upstanding),
(this_or_next|eq, ":reputation", lrep_benefactor),
(eq, ":reputation", lrep_moralist),
],
"What!? This is madness! I haven't done anything dishonorable to demand death! My offensive against your kingdom were always merciful and honorable. And we never kill defenseless men.","mrc_prisoner_trial_death_confirm",[
]],
[anyone,"mrc_prisoner_trial_death",[#cunning type argument
(troop_get_slot, ":reputation", "$g_talk_troop", slot_lord_reputation_type),
(this_or_next|eq, ":reputation", lrep_selfrighteous),
(this_or_next|eq, ":reputation", lrep_cunning),
(this_or_next|eq, ":reputation", lrep_roguish),
(this_or_next|eq, ":reputation", lrep_custodian),
(this_or_next|eq, ":reputation", lrep_adventurous),
(this_or_next|eq, ":reputation", lrep_otherworldly),
(eq, ":reputation", lrep_ambitious),
],
"What!? You making a mistake {playername}! All my raids and attacks to your people were on behalf my superiors or explicit marshall orders. They are the ones to blame, not me!","mrc_prisoner_trial_death_confirm",[
]],
[anyone,"mrc_prisoner_trial_death",[#disonorable type argument
(troop_get_slot, ":reputation", "$g_talk_troop", slot_lord_reputation_type),
(this_or_next|eq, ":reputation", lrep_quarrelsome),
(eq, ":reputation", lrep_debauched),
],
"Are you crazy!? My acts doesn't deserve death! I should instead, be compensated for killing all low-born worms and peasants which plague this land. Besides, I'm sure my ransom fee in your coffers, will be more than enough to pay for any fallen pig who crossed my path.","mrc_prisoner_trial_death_confirm",[
]],
[anyone,"mrc_prisoner_trial_death",[#other argument - liege, martial, conventional. (or any if not covered, but should be only liege, martial and conventional ladies)
],
"What!? That's completly insane! According to ancient law and customs, my acts doesn't deserve death. It's a dungerous path you walking {playername}! Think about it.","mrc_prisoner_trial_death_confirm",[
]],
# death confirmation
[anyone|plyr, "mrc_prisoner_trial_death_confirm", [
(faction_get_slot, ":liege", "$g_talk_troop_faction", slot_faction_leader),
(eq, ":liege", "$g_talk_troop"),
],
"You do not fool me! You reign of terror ends now!","mrc_prisoner_trial_death_end",[
]],
[anyone|plyr, "mrc_prisoner_trial_death_confirm", [
],
"That's not what I want. But the people demands your death.","mrc_prisoner_trial_death_end",[
]],
[anyone|plyr, "mrc_prisoner_trial_death_confirm", [
],
"I've made my decision, only your death will suffice.","mrc_prisoner_trial_death_end",[
]],
[anyone|plyr, "mrc_prisoner_trial_death_confirm", [
],
"Calm down. I was only joking.","mrc_prisoner_trial_death_cancel_joke",[
]],
[anyone|plyr, "mrc_prisoner_trial_death_confirm", [
],
"All right, I'm convinced. But you're staying here for now.","mrc_prisoner_trial_death_cancel",[
]],
# death cancel
[anyone,"mrc_prisoner_trial_death_cancel",[
(ge, "$g_talk_troop_relation", 0),
],
"Good to see you coming into senses again {playername}. Hopefully we can put all this nonsense talk behind us and forget about it.","close_window",[
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),
]],
[anyone,"mrc_prisoner_trial_death_cancel",[
],
"Begone then, and let's not talk about it again.","close_window",[
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
]],
# death cancel joke
[anyone,"mrc_prisoner_trial_death_cancel_joke",[
(ge, "$g_talk_troop_relation", 0),
],
"God, don't joke about that, {lad/lass}. For a moment I thought you were serious. Let's not talk about it anymore.","close_window",[
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
]],
[anyone,"mrc_prisoner_trial_death_cancel_joke",[
],
"Oh, well. Really? Begone then.","close_window",[
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),
]],
# death end
[anyone,"mrc_prisoner_trial_death_end",[
],
"I'm telling you {playername}! My death shall not be forgotten. My family and friends will take whatever it takes to take revenge!","mrc_prisoner_trial_death_end_2",[
]],
[anyone|plyr,"mrc_prisoner_trial_death_end_2",[
],
"Enough! Time for you to die!","mrc_prisoner_trial_death_end_3",[
#honor and right to rule change based on personality
(troop_get_slot, ":rep", "$g_talk_troop", slot_lord_reputation_type),
(try_begin),
(this_or_next|eq, ":rep", lrep_quarrelsome),
(eq, ":rep", lrep_debauched),
(assign, ":penalty", 6),
(else_try),
(this_or_next|eq, ":rep", lrep_selfrighteous),
(eq, ":rep", lrep_cunning),
(assign, ":penalty", 3),
(else_try),
(this_or_next|eq, ":rep", lrep_martial),
(eq, ":rep", lrep_none),
(assign, ":penalty", -6),
(else_try),
(this_or_next|eq, ":rep", lrep_goodnatured),
(eq, ":rep", lrep_upstanding),
(assign, ":penalty", -12),
(else_try),
(assign, ":penalty", -10),#commoners/ladies
(try_end),
(neq, ":penalty", 0),
(call_script, "script_change_player_honor", ":penalty"),
(call_script, "script_change_player_right_to_rule", ":penalty"),
]],
[anyone|plyr,"mrc_prisoner_trial_death_end_2",[
],
"Perhaps I was overeacting. I withdraw your death sentence.","mrc_prisoner_trial_death_overeacted",[
]],
[anyone,"mrc_prisoner_trial_death_overeacted",[
(ge, "$g_talk_troop_relation", 0),
],
"Good to see you coming into senses again {playername}. Hopefully we can put all this nonsense talk behind us and forget about it.","close_window",[
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),
]],
[anyone,"mrc_prisoner_trial_death_overeacted",[
],
"Oh, well. Really? Begone then.","close_window",[
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),
]],
# death procedure
[anyone,"mrc_prisoner_trial_death_end_3",[
],
"You will pay for this {playername}!","close_window",[
(call_script, "script_add_notification_menu", "mnu_notification_lord_death", "$g_talk_troop", "trp_player"),
(assign, "$g_leave_town", 1),
(finish_mission),
]],
###
# PRISONER END
#####################################################################################################################
module_game_menus.py
Python:
## MRC LORD DEATH
#####################################################################################
(
"notification_lord_death",0,
"Death Sentence^^{s2} of {s3} has been condemned to death by {s4} of {s5}.^^{s6}",
"none",[
# VARIABLES
(assign, ":deadlord", "$g_notification_menu_var1"),
(assign, ":executer", "$g_notification_menu_var2"),
(assign, ":new_guardian", -1),
(try_begin),
(neq, ":deadlord", "trp_player"),
(store_faction_of_troop, ":deadlord_faction", ":deadlord"),
(else_try),
(assign, ":deadlord_faction", "$players_kingdom"),
(try_end),
(try_begin),
(neq, ":executer", "trp_player"),
(store_faction_of_troop, ":executer_faction", ":executer"),
(else_try),
(assign, ":executer_faction", "$players_kingdom"),
(try_end),
(str_store_troop_name, s2, ":deadlord"),
(str_store_faction_name, s3, ":deadlord_faction"),
(str_store_troop_name, s4, ":executer"),
(str_store_faction_name, s5, ":executer_faction"),
(try_begin),
(faction_slot_eq, ":executer_faction", slot_faction_leader, "trp_player"),
(neq, ":executer", "trp_player"),
(assign, ":player_leader_of_executer", 1),
(try_end),
(display_log_message, "@{s2} of {s3} has been condemned to death by {s4} of {s5}.", color_terrible_news),
# START CONSEQUENCES
#change associates relation with executioneer
(try_for_range, ":troop_no", heroes_begin, heroes_end),
(this_or_next|troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_lady),
(call_script, "script_dplmc_troop_get_family_relation_to_troop", ":troop_no", ":deadlord"),
(assign, ":rel_type", reg1),
(try_begin),#for non-family
(eq, ":rel_type", "str_no_relation"),
(call_script, "script_troop_get_relation_with_troop", ":troop_no", ":deadlord"),
(assign, ":rel", reg0),
(try_begin),#enemies
(le, ":rel", -20),
(val_mul, ":rel", -1),
(val_div, ":rel", 10),
(call_script, "script_troop_change_relation_with_troop", ":troop_no", ":executer", ":rel"),
(else_try),#friends
(ge, ":rel", 20),
(val_mul, ":rel", -1),
(val_div, ":rel", 5),
(call_script, "script_troop_change_relation_with_troop", ":troop_no", ":executer", ":rel"),
(try_end),
(else_try),#for family members which are not rival
(call_script, "script_troop_get_relation_with_troop", ":troop_no", ":deadlord"),
(assign, ":rel", reg0),
(gt, ":rel", -20),
(val_add, ":rel", 20),
(val_mul, ":rel", -1),
(call_script, "script_troop_change_relation_with_troop", ":troop_no", ":executer", ":rel"),
(try_end),
(try_end),
# DEATH KING
(try_begin),
(faction_slot_eq, ":deadlord_faction", slot_faction_leader, ":deadlord"),
(assign, ":new_ruler", -1),#new ruler should be the highest renowned lord
(assign, ":highest_renown", -1),
(try_for_range, ":troop_no", heroes_begin, heroes_end),
(this_or_next|troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_lady),
(neq, ":troop_no", ":deadlord"),
#get the most renowed lord
(store_troop_faction, ":troop_faction", ":troop_no"),
(eq, ":troop_faction", ":deadlord_faction"),
(troop_get_slot, ":renown", ":troop_no", slot_troop_renown),
(gt, ":renown", ":highest_renown"),
(assign, ":highest_renown", ":renown"),
(assign, ":new_ruler", ":troop_no"),
(try_end),
#remove fiefs of deadlord
(try_for_range, ":center_no", centers_begin, centers_end),
(party_slot_eq, ":center_no", slot_town_lord, ":deadlord"),
(party_set_slot, ":center_no", slot_town_lord, stl_unassigned),
(party_set_banner_icon, ":center_no", 0),
(try_end),
#set new ruler
(try_begin),
(eq, ":new_ruler", -1),#when -1 means there is no vassals left to take the role as ruler
(str_store_string, s6, "[USER=84046]@All[/USER] {s3} lands are now ruled by nobody and are free to be taken."),
(else_try),
#make the new_ruler guardian of diposed ladies
(assign, ":new_guardian", ":new_ruler"),
#make the new_ruler a lord if not already one
(try_begin),
(neg|troop_slot_eq, ":new_ruler", slot_troop_occupation, slto_kingdom_hero),
(call_script, "script_mrc_troop_make_a_lord", ":new_ruler"),
(try_end),
#set new ruler
(call_script, "script_mrc_troop_set_king_title_according_to_faction", ":new_ruler", ":deadlord_faction"),
(faction_set_slot, ":deadlord_faction", slot_faction_leader, ":new_ruler"),
(faction_set_slot, ":deadlord_faction", slot_faction_marshall, -1),
#set strings
(str_store_troop_name_link, s1, ":new_ruler"),
(display_log_message, "@{s1} is the new ruler of {s3}.", color_major_news),
(str_store_troop_name, s1, ":new_ruler"),
(str_store_string, s6, "@In an emergency act, the great lords appoint {s1} as sucessor of the throne and new ruler of {s3}."),
(try_end),
# DEATH NON-KING
(else_try),
(assign, ":new_lord", -1),#new lord should be the closest relative
(assign, ":highest_relation", -100),
(try_for_range, ":troop_no", heroes_begin, heroes_end),
(this_or_next|troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_lady),
(neq, ":troop_no", ":deadlord"),
#get the best relative in faction
(store_troop_faction, ":troop_faction", ":troop_no"),
(eq, ":troop_faction", ":deadlord_faction"),
(call_script, "script_troop_get_family_relation_to_troop", ":deadlord", ":troop_no"),
(assign, ":family_type", s11),
(neq, ":family_type", "str_no_relation"),
(assign, ":family_relation", reg0),
(gt, ":family_relation", ":highest_relation"),
(assign, ":highest_relation", ":family_relation"),
(assign, ":new_lord", ":troop_no"),
(try_end),
(try_begin),
(eq, ":new_lord", -1),#when -1 means there is no relative to take ownership of deadlord pocessions
#remove fiefs
(try_for_range, ":center_no", centers_begin, centers_end),
(party_slot_eq, ":center_no", slot_town_lord, ":deadlord"),
(party_set_slot, ":center_no", slot_town_lord, stl_unassigned),
(party_set_banner_icon, ":center_no", 0),
(try_end),
#set strings
(call_script, "script_dplmc_store_troop_is_female", ":deadlord"),
(str_store_troop_name, s2, ":deadlord"),
(str_store_string, s6, "@As last member of {reg0?her:his} household, all {s2} possessions now belongs to no one."),
(else_try),
#make new lord guardian of diposed ladies
(assign, ":new_guardian", ":new_lord"),
#handle trasnfers and new lord
(try_for_range, ":center_no", centers_begin, centers_end),
(party_slot_eq, ":center_no", slot_town_lord, ":deadlord"),
#Reset fief properties
(party_set_slot, ":center_no", dplmc_slot_center_taxation, 0),
(try_begin),
(party_slot_eq, ":center_no", slot_village_infested_by_bandits, "trp_peasant_woman"),
(party_set_slot, ":center_no", slot_village_infested_by_bandits, 0),
(try_end),
#Reset banner
(try_begin),
(is_between, ":center_no", walled_centers_begin, walled_centers_end),
(troop_get_slot, ":cur_banner", ":new_lord", slot_troop_banner_scene_prop),
(gt, ":cur_banner", 0),
(val_sub, ":cur_banner", banner_scene_props_begin),
(val_add, ":cur_banner", banner_map_icons_begin),
(party_set_banner_icon, ":center_no", ":cur_banner"),
(try_end),
#transfer fief
(party_set_slot, ":center_no", slot_town_lord, ":new_lord"),
(str_store_troop_name_link, s0, ":new_lord"),
(str_store_party_name_link, s1, ":center_no"),
(display_log_message, "@{s0} has taken ownership of {s1}.", color_neutral_news),
(call_script, "script_update_center_notes", ":center_no"),
(try_end),
#trasnfer wealth
(troop_get_slot, ":dead_wealth", ":deadlord", slot_troop_wealth),
(try_begin),
(gt, ":dead_wealth", 0),
(troop_get_slot, ":new_wealth", ":new_lord", slot_troop_wealth),
(val_add, ":new_wealth", ":dead_wealth"),
(troop_set_slot, ":new_lord", slot_troop_wealth, ":new_wealth"),
(try_end),
#make a new lord
(try_begin),
(neg|troop_slot_eq, ":new_lord", slot_troop_occupation, slto_kingdom_hero),
(call_script, "script_troop_set_title_according_to_faction", ":new_lord", ":deadlord_faction"),
(call_script, "script_mrc_troop_make_a_lord", ":new_lord"),
(try_end),
#set strings
(str_clear, s11),
(call_script, "script_dplmc_troop_get_family_relation_to_troop", ":deadlord", ":new_lord"),
(assign, ":rel_type", reg1),
(call_script, "script_dplmc_store_troop_is_female", ":new_lord"),
(str_store_troop_name, s1, ":new_lord"),
(str_store_troop_name, s2, ":deadlord"),
(try_begin),#reset s11 if str_no_relation
(eq, ":rel_type", "str_no_relation"),
(str_store_string, s11, "@friend"),
(else_try),
(str_store_string, s11, ":rel_type"),
(try_end),
(str_store_string, s6, "@With great grief {s1} takes ownership of {s2} possessions and oaths to avange the death of {reg0?her:his} {s11}."),
(try_end),
(try_end),
# NON-LIEGE EXECUTIONEER
(try_begin),
(neg|faction_slot_eq, ":executer_faction", slot_faction_leader, ":executer"),
(neq, ":player_leader_of_executer", 1),
(assign, ":best_center", -1),
(assign, ":highest_prosperity", -1),
(try_for_range, ":center_no", centers_begin, centers_end),
(party_slot_eq, ":center_no", slot_town_lord, ":executer"),
(party_get_slot, ":prosperity", ":center_no", slot_town_prosperity),
(try_begin),
(party_slot_eq, ":center_no", slot_party_type, spt_town),
(val_mul, ":prosperity", 3),
(else_try),
(party_slot_eq, ":center_no", slot_party_type, spt_castle),
(val_mul, ":prosperity", 2),
(try_end),
(gt, ":prosperity", ":highest_prosperity"),
(assign, ":highest_prosperity", ":prosperity"),
(assign, ":best_center", ":center_no"),
(try_end),
(try_begin),
(eq, ":best_center", -1),#when -1 means there is no center to be lost
(str_store_string, s0, "[USER=20585]@and[/USER] should not receive honors in the meantime"),
(else_try),
(party_set_slot, ":best_center", slot_town_lord, stl_unassigned),
(party_set_banner_icon, ":best_center", 0),
(str_store_party_name, s0, ":best_center"),
(str_store_string, s0, "[USER=20585]@and[/USER] will be striped from the possession of {s0}"),
(try_end),
(faction_get_slot, ":executer_leader", ":executer_faction", slot_faction_leader),
#decrease liege relation with executioneer
(troop_get_slot, ":rep", ":executer_leader", slot_lord_reputation_type),
(try_begin),
(this_or_next|eq, ":rep", lrep_quarrelsome),
(eq, ":rep", lrep_debauched),
(assign, ":penalty", -3),
(else_try),
(this_or_next|eq, ":rep", lrep_selfrighteous),
(eq, ":rep", lrep_cunning),
(assign, ":penalty", -6),
(else_try),
(this_or_next|eq, ":rep", lrep_martial),
(eq, ":rep", lrep_none),
(assign, ":penalty", -9),
(else_try),
(this_or_next|eq, ":rep", lrep_goodnatured),
(eq, ":rep", lrep_upstanding),
(assign, ":penalty", -15),
(else_try),
(assign, ":penalty", -12),#commoners/ladies
(try_end),
(call_script, "script_troop_change_relation_with_troop", ":executer_leader", ":executer", ":penalty"),
#set strings
(str_store_troop_name, s1, ":executer_leader"),
(call_script, "script_dplmc_store_troop_is_female", ":executer_leader"),
(str_store_string, s6, "@{s6}^^In a royal notice, {s1} declares that {s4} was acting independently {s0}. However, {s1} insists that {reg0?she:he} will not tolerate any kind of interference and {s5} shall deal with this matter internally."),
# LIEGE EXECUTIONEER
(else_try),
(neq, ":player_leader_of_executer", 1),
(call_script, "script_dplmc_store_troop_is_female", ":deadlord"),
(str_store_string, s6, "@{s6}^^In a royal notice, {s4} declares that {reg0?her:his} death was justified. And will not tolerate any kind of threat from {s2} family or associates."),
(try_end),
# FINAL CONSEQUENCES
#remove dead lord from prison
(try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
(party_count_prisoners_of_type, ":holding_as_prisoner", ":center_no", ":deadlord"),
(gt, ":holding_as_prisoner", 0),
(party_remove_prisoners, ":center_no", ":deadlord", 1),
(try_end),
#increase executioneer controversy
(troop_get_slot, ":controversy", ":executer", slot_troop_controversy),
(val_add, ":controversy", 50),
(val_clamp, ":controversy", 0, 101),
(troop_set_slot, ":executer", slot_troop_controversy, ":controversy"),
#decrease relation between kingdoms
(try_begin),
(is_between, ":deadlord_faction", kingdoms_begin, kingdoms_end),
(is_between, ":executer_faction", kingdoms_begin, kingdoms_end),
(store_relation, ":reln", ":deadlord_faction", ":executer_faction"),
(val_sub, ":reln", 20),
(val_clamp, ":reln", -100, 101),
(set_relation, ":deadlord_faction", ":executer_faction", ":reln"),
(try_end),
#mrc mod end
#lady should be exiled if no hero relative in kingdom
(try_for_range, ":lady", kingdom_ladies_begin, kingdom_ladies_end),
(troop_slot_eq, ":lady", slot_troop_occupation, slto_kingdom_lady),
(troop_get_slot, ":guardian", ":lady", slot_troop_guardian),
(troop_get_slot, ":father", ":lady", slot_troop_father),
(troop_get_slot, ":husband", ":lady", slot_troop_spouse),
(try_begin),
#check if husband is deadlord
(eq, ":husband", ":deadlord"),
(neg|troop_slot_eq, ":lady", slot_troop_occupation, slto_kingdom_hero),
(call_script, "script_change_troop_faction", ":lady", "fac_neutral"),
(troop_set_slot, ":lady", slot_troop_occupation, dplmc_slto_exile),
(troop_set_slot, ":lady", slot_troop_cur_center, -1),
(try_end),
(try_begin),
#check if father is deadlord
(eq, ":father", ":deadlord"),
(neg|troop_slot_eq, ":lady", slot_troop_occupation, slto_kingdom_hero),
(assign, ":do_not_exile", 0),
(try_begin),#fix lady shouldn't be exiled if husband is hero
(ge, ":husband", 0),
(troop_slot_eq, ":husband", slot_troop_occupation, slto_kingdom_hero),
(assign, ":do_not_exile", 1),
(try_end),
(eq, ":do_not_exile", 0),
(call_script, "script_change_troop_faction", ":lady", "fac_neutral"),
(troop_set_slot, ":lady", slot_troop_occupation, dplmc_slto_exile),
(troop_set_slot, ":lady", slot_troop_cur_center, -1),
(try_end),
(try_begin),
#check if guardian (brother) is deadlord
(eq, ":guardian", ":deadlord"),
(neq, ":lady", ":new_guardian"),#should't happen, but keep it just in case
(try_begin),
#exile lady if no guardian found
(lt, ":new_guardian", 0),
(call_script, "script_change_troop_faction", ":lady", "fac_neutral"),
(troop_set_slot, ":lady", slot_troop_occupation, dplmc_slto_exile),
(troop_set_slot, ":lady", slot_troop_cur_center, -1),
(else_try),
#assign new guardian
#(call_script, "script_change_troop_faction", ":lady", ":deadlord_faction"),#removed to not change lady's name
(troop_set_slot, ":lady", slot_troop_guardian, ":new_guardian"),
(try_end),
(try_end),
(try_end),
#set deadlord structure
(call_script, "script_remove_troop_from_prison", ":deadlord"),
(call_script, "script_change_troop_faction", ":deadlord", "fac_neutral"),
(troop_set_slot, ":deadlord", slot_troop_prisoner_of_party, -1),
(troop_set_slot, ":deadlord", slot_troop_occupation, dplmc_slto_dead),
# NOTIFICATION GRAPHICS
(set_fixed_point_multiplier, 100),
(position_set_x, pos0, 55),
(position_set_y, pos0, 20),
(position_set_z, pos0, 100),
(set_game_menu_tableau_mesh, "tableau_troop_note_mesh", "$g_notification_menu_var1", pos0),
],
[
("continue", [
(store_faction_of_troop, ":executer_faction", "$g_notification_menu_var2"),
(neg|faction_slot_eq, ":executer_faction", slot_faction_leader, "trp_player"),
],
"Continue...", [
(change_screen_return),
]),
("executer_takefief", [
(assign, ":executer", "$g_notification_menu_var2"),
(store_faction_of_troop, ":executer_faction", ":executer"),
(faction_slot_eq, ":executer_faction", slot_faction_leader, "trp_player"),
(neq, ":executer", "trp_player"),
(assign, ":best_center", -1),
(assign, ":highest_prosperity", -1),
(try_for_range, ":center_no", centers_begin, centers_end),
(party_slot_eq, ":center_no", slot_town_lord, ":executer"),
(party_get_slot, ":prosperity", ":center_no", slot_town_prosperity),
(try_begin),
(party_slot_eq, ":center_no", slot_party_type, spt_town),
(val_mul, ":prosperity", 3),
(else_try),
(party_slot_eq, ":center_no", slot_party_type, spt_castle),
(val_mul, ":prosperity", 2),
(try_end),
(gt, ":prosperity", ":highest_prosperity"),
(assign, ":highest_prosperity", ":prosperity"),
(assign, ":best_center", ":center_no"),
(try_end),
(neq, ":best_center", -1),
(str_store_party_name, s7, ":best_center"),
(str_store_troop_name, s8, ":executer"),
],
"Dispose {s8} from possesion of {s7}.", [
(assign, ":executer", "$g_notification_menu_var2"),
(assign, ":best_center", -1),
(assign, ":highest_prosperity", -1),
(try_for_range, ":center_no", centers_begin, centers_end),
(party_slot_eq, ":center_no", slot_town_lord, ":executer"),
(party_get_slot, ":prosperity", ":center_no", slot_town_prosperity),
(try_begin),
(party_slot_eq, ":center_no", slot_party_type, spt_town),
(val_mul, ":prosperity", 3),
(else_try),
(party_slot_eq, ":center_no", slot_party_type, spt_castle),
(val_mul, ":prosperity", 2),
(try_end),
(gt, ":prosperity", ":highest_prosperity"),
(assign, ":highest_prosperity", ":prosperity"),
(assign, ":best_center", ":center_no"),
(try_end),
(party_set_slot, ":best_center", slot_town_lord, stl_unassigned),
(party_set_banner_icon, ":best_center", 0),
(str_store_party_name_link, s7, ":best_center"),
(str_store_troop_name_link, s8, ":executer"),
(str_store_faction_name, s9, "$players_kingdom"),
(display_log_message, "@{playername} of {s9} strips {s8} from possession of {s7}. And should not receive new honors for a while.", color_quest_and_faction_news),
(troop_set_slot, ":executer", slot_troop_controversy, 100),
#decrease liege relation with executioneer
(troop_get_slot, ":rep", ":executer", slot_lord_reputation_type),
(try_begin),
(this_or_next|eq, ":rep", lrep_quarrelsome),
(eq, ":rep", lrep_debauched),
(assign, ":penalty", -12),
(else_try),
(this_or_next|eq, ":rep", lrep_selfrighteous),
(eq, ":rep", lrep_cunning),
(assign, ":penalty", -9),
(else_try),
(this_or_next|eq, ":rep", lrep_martial),
(eq, ":rep", lrep_none),
(assign, ":penalty", -6),
(else_try),
(this_or_next|eq, ":rep", lrep_goodnatured),
(eq, ":rep", lrep_upstanding),
(assign, ":penalty", -1),
(else_try),
(assign, ":penalty", -3),#commoners/ladies
(try_end),
(call_script, "script_change_player_relation_with_troop", ":executer", ":penalty"),
(call_script, "script_change_player_honor", 3),
(call_script, "script_change_player_right_to_rule", 3),
(change_screen_return),
]),
("executer_controversy", [
(assign, ":executer", "$g_notification_menu_var2"),
(store_faction_of_troop, ":executer_faction", ":executer"),
(faction_slot_eq, ":executer_faction", slot_faction_leader, "trp_player"),
(neq, ":executer", "trp_player"),
(str_store_troop_name, s8, ":executer"),
],
"Declare {s8} should not receive honors for a while.", [
(assign, ":executer", "$g_notification_menu_var2"),
(str_store_troop_name_link, s8, ":executer"),
(str_store_faction_name, s9, "$players_kingdom"),
(display_message, "@{playername} of {s9} declares {s8} should not receive honors for a while.", color_quest_and_faction_news),
(troop_set_slot, ":executer", slot_troop_controversy, 100),
#decrease liege relation with executioneer
(troop_get_slot, ":rep", ":executer", slot_lord_reputation_type),
(try_begin),
(this_or_next|eq, ":rep", lrep_quarrelsome),
(eq, ":rep", lrep_debauched),
(assign, ":penalty", -9),
(else_try),
(this_or_next|eq, ":rep", lrep_selfrighteous),
(eq, ":rep", lrep_cunning),
(assign, ":penalty", -6),
(else_try),
(this_or_next|eq, ":rep", lrep_martial),
(eq, ":rep", lrep_none),
(assign, ":penalty", -3),
(else_try),
(this_or_next|eq, ":rep", lrep_goodnatured),
(eq, ":rep", lrep_upstanding),
(assign, ":penalty", 1),
(else_try),
(assign, ":penalty", -1),#commoners/ladies
(try_end),
(call_script, "script_change_player_relation_with_troop", ":executer", ":penalty"),
(change_screen_return),
]),
("executer_nothing", [
(assign, ":executer", "$g_notification_menu_var2"),
(store_faction_of_troop, ":executer_faction", ":executer"),
(faction_slot_eq, ":executer_faction", slot_faction_leader, "trp_player"),
(neq, ":executer", "trp_player"),
],
"Do nothing.", [
(assign, ":executer", "$g_notification_menu_var2"),
(str_store_troop_name_link, s8, ":executer"),
(str_store_faction_name, s9, "$players_kingdom"),
(display_message, "@{playername} of {s9} does nothing against {s8}. And it's viewed as one that agrees with this kind of behavior.", color_quest_and_faction_news),
#decrease liege relation with executioneer
(troop_get_slot, ":rep", ":executer", slot_lord_reputation_type),
(try_begin),
(this_or_next|eq, ":rep", lrep_quarrelsome),
(eq, ":rep", lrep_debauched),
(assign, ":penalty", 9),
(else_try),
(this_or_next|eq, ":rep", lrep_selfrighteous),
(eq, ":rep", lrep_cunning),
(assign, ":penalty", 6),
(else_try),
(this_or_next|eq, ":rep", lrep_martial),
(eq, ":rep", lrep_none),
(assign, ":penalty", 3),
(else_try),
(this_or_next|eq, ":rep", lrep_goodnatured),
(eq, ":rep", lrep_upstanding),
(assign, ":penalty", -1),
(else_try),
(assign, ":penalty", 1),#commoners/ladies
(try_end),
(call_script, "script_change_player_relation_with_troop", ":executer", ":penalty"),
(call_script, "script_change_player_honor", -3),
(call_script, "script_change_player_right_to_rule", -3),
(troop_get_slot, ":controversy", "trp_player", slot_troop_controversy),
(val_add, ":controversy", 20),
(val_clamp, ":controversy", 0, 101),
(troop_set_slot, "trp_player", slot_troop_controversy, ":controversy"),
(change_screen_return),
]),
]
),
##mrc menus end
]
When I have looked at other game menus, I will sometimes find the "continue...." option in the code script, so my assumption is that I'd have to place the option somewhere at the end of the menu.py file. Each time I tried, however, I kept messing it up with the syntax. I'm not a coder nor do I know much about python script, so I was wondering if one of you could explain to me where in the code I can add the "continue..." option and how to word it out. If this isn't the issue, could you please offer some insight. The source files for version 1.2 of the mod can be found in the former link if you want to take a look at them yourself. Thanks.
Last edited: