Stuck on a Menu Screen (Mod Help)

Users who are viewing this thread

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
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:
Solution
So would it look something like this:

Python:
("continue","Continue...", [
(change_screen_return), ]),

I'm not sure if the line spacing is correct, but I think the idea you both were referring to make the continue script a simple process to just jump back to the game screen instead of all the other mumbo jumbo included in the script.
Python:
("continue", [
            ],
            "Continue...", [
            (change_screen_return),
            ]),
Just delete that part but do not modify anything else, as shown above by me.
  1. 4.1 is the last official version of Diplomacy; its later editions were not made by original developers of the mod,
  2. that 4.3 version has its source code uploaded under Miscellaneous files in https://www.nexusmods.com/mbwarband/mods/6044?tab=files,
  3. if you want to modify Diplomacy 4.3+ from Steam (https://steamcommunity.com/workshop/filedetails/discussion/285119009/451850849180281143/), here is its source code - https://www.dropbox.com/sh/679r1y39...zITSD8za/source?dl=0&subfolder_nav_tracking=1,
  4. refer to other game menus to learn how to return to some other screen or the world map, it is very easy. That other Diplomacy version has its script ready, so you may just copy it over.
 
Upvote 0
  1. 4.1 is the last official version of Diplomacy; its later editions were not made by original developers of the mod,
  2. that 4.3 version has its source code uploaded under Miscellaneous files in https://www.nexusmods.com/mbwarband/mods/6044?tab=files,
  3. if you want to modify Diplomacy 4.3+ from Steam (https://steamcommunity.com/workshop/filedetails/discussion/285119009/451850849180281143/), here is its source code - https://www.dropbox.com/sh/679r1y39...zITSD8za/source?dl=0&subfolder_nav_tracking=1,
  4. refer to other game menus to learn how to return to some other screen or the world map, it is very easy. That other Diplomacy version has its script ready, so you may just copy it over.
My fault. I used the wrong wording. I am not referring to Diplomacy itself as a mod; I was referring to the Diplomacy 4.3 mod created by mrclopes. His mod is "1.3." In my former post I was referring to it as "4.3" but it is supposed to be "1.3." That was my fault. It should be fixed now.

In the link, mrclopes' mod is considered version "1.3." For his source files, he only has versions "1.1" and "1.2." He doesn't have the source files for "1.3" which is his final mod. I also just noticed that he made mentioned for his updated 1.3 that he "fixed a bug where a "Continue" button was not being displayed when a player condem a lord to death (which is the same issue I am addressing)." So I am not referring to the Diplomacy 4.1 mod but the various versions of mrclopes Diplomacy 4.3- Mrcmod and bugfixes. There isn't a source file for 1.3 final version where he actually fixed the troubleshooting I referred to in my former post.

I was trying to look through the various game menus on my own, but I am stuck at how to word it or place it under the execution screen. I have tried a couple times, but I keep getting syntax errors. I don't understand coding too well, so I was asking if someone could show an example of how to do it or just walk me through it. If not, I'll keep trying on my own, but it's getting frustrating on my end as I have no idea what I am doing. I doubt it should be a hard issue, but when you have no coding experience it all looks like a bunch of paranthesis, brackets, and commas and I really haven't found a useful guide that explains the purpose of these punctuations.

Note: I don't have Warband on Steam as I downloaded it from their official site. I doubt messing with steam's version will help in my situation.
 
Upvote 0
In the link, mrclopes' mod is considered version "1.3." For his source files, he only has versions "1.1" and "1.2." He doesn't have the source files for "1.3" which is his final mod. I also just noticed that he made mentioned for his updated 1.3 that he "fixed a bug where a "Continue" button was not being displayed when a player condem a lord to death (which is the same issue I am addressing)." So I am not referring to the Diplomacy 4.1 mod but the various versions of mrclopes Diplomacy 4.3- Mrcmod and bugfixes. There isn't a source file for 1.3 final version where he actually fixed the troubleshooting I referred to in my former post.
The solution is simple, use 1.2 and add a simple exit option to this specific menu implement the below solution.
I was trying to look through the various game menus on my own, but I am stuck at how to word it or place it under the execution screen. I have tried a couple times, but I keep getting syntax errors. I don't understand coding too well, so I was asking if someone could show an example of how to do it or just walk me through it. If not, I'll keep trying on my own, but it's getting frustrating on my end as I have no idea what I am doing. I doubt it should be a hard issue, but when you have no coding experience it all looks like a bunch of paranthesis, brackets, and commas and I really haven't found a useful guide that explains the purpose of these punctuations.
If you cannot grasp the basics of modding, just leave it alone then because you will end up frustrated when doing it. If you want to keep going, make sure to read tutorials on syntax (there are many of them, so it is impossible to not have stumbled upon them). Experience does not have anything to do with it; I had no experience when I started out but through careful examination of scripts I became a proficient coder. I advise you to do the same.
Note: I don't have Warband on Steam as I downloaded it from their official site. I doubt messing with steam's version will help in my situation.
If you know how to, you will not mess up the Steam directory of the game.

I think you should try removing the following from continue submenu to see what happens next: (store_faction_of_troop, ":executer_faction", "$g_notification_menu_var2"), (neg|faction_slot_eq, ":executer_faction", slot_faction_leader, "trp_player"), because the rest of it looks fine.
 
Upvote 0
The solution is simple, use 1.2 and add a simple exit option to this specific menu implement the below solution.

If you cannot grasp the basics of modding, just leave it alone then because you will end up frustrated when doing it. If you want to keep going, make sure to read tutorials on syntax (there are many of them, so it is impossible to not have stumbled upon them). Experience does not have anything to do with it; I had no experience when I started out but through careful examination of scripts I became a proficient coder. I advise you to do the same.

If you know how to, you will not mess up the Steam directory of the game.

I think you should try removing the following from continue submenu to see what happens next: (store_faction_of_troop, ":executer_faction", "$g_notification_menu_var2"), (neg|faction_slot_eq, ":executer_faction", slot_faction_leader, "trp_player"), because the rest of it looks fine.
I agree with valedentella. in this code, if the player is not the owner of :executioner_faction, it enables the continue button to open, you should delete it and try again
 
Upvote 0
The solution is simple, use 1.2 and add a simple exit option to this specific menu implement the below solution.

If you cannot grasp the basics of modding, just leave it alone then because you will end up frustrated when doing it. If you want to keep going, make sure to read tutorials on syntax (there are many of them, so it is impossible to not have stumbled upon them). Experience does not have anything to do with it; I had no experience when I started out but through careful examination of scripts I became a proficient coder. I advise you to do the same.

If you know how to, you will not mess up the Steam directory of the game.

I think you should try removing the following from continue submenu to see what happens next: (store_faction_of_troop, ":executer_faction", "$g_notification_menu_var2"), (neg|faction_slot_eq, ":executer_faction", slot_faction_leader, "trp_player"), because the rest of it looks fine.
So would it look something like this:

Python:
("continue","Continue...", [
(change_screen_return), ]),

I'm not sure if the line spacing is correct, but I think the idea you both were referring to make the continue script a simple process to just jump back to the game screen instead of all the other mumbo jumbo included in the script.
 
Upvote 0
So would it look something like this:

Python:
("continue","Continue...", [
(change_screen_return), ]),

I'm not sure if the line spacing is correct, but I think the idea you both were referring to make the continue script a simple process to just jump back to the game screen instead of all the other mumbo jumbo included in the script.
Python:
("continue", [
            ],
            "Continue...", [
            (change_screen_return),
            ]),
Just delete that part but do not modify anything else, as shown above by me.
 
Upvote 0
Solution
Python:
("continue", [
            ],
            "Continue...", [
            (change_screen_return),
            ]),
Just delete that part but do not modify anything else, as shown above by me.
It worked.

As you can tell by the way you corrected my code, I probably would have been stuck on it for awhile since the spacing would have confused me. I appreciate your help a lot. Thanks.
 
Upvote 0
Back
Top Bottom