Lords returning from exile missing, module_scripts.py fix?

Users who are viewing this thread

Hey all

Over the last few days I've been trying to find out why lords that have returned from exile in my save have gone missing instead. The best answers I've found are that slto_inactive is not being set to slto_kingdom_hero.

Anyway, long story short, I made a thread on another section and a helpful user told me that there is potentially a simple solution to make the lords active again once they're pardoned and return from exile. Here's the bit of code from module_scripts.py that he highlighted could be changed to resolve the issue:

                      #script_dplmc_lord_return_from_exile
                    # INPUT: arg1 = troop_id, arg2 = new faction_no
                    # OUTPUT: none
                    ("dplmc_lord_return_from_exile",
                    [
                      (store_script_param_1, ":troop_no"),
                      (store_script_param_2, ":faction_no"),
                      #Check validity
                      (try_begin),
                          (is_between, ":troop_no", heroes_begin, heroes_end),
                          (is_between, ":faction_no", kingdoms_begin, kingdoms_end),
                          (neq, ":troop_no", "trp_player"),
                          (faction_get_slot, ":faction_liege", ":faction_no", slot_faction_leader),
                          #The lord definitely should not already belong to a kingdom
                          (store_troop_faction, ":eek:ld_faction", ":troop_no"),
                          (neg|is_between, ":eek:ld_faction", kingdoms_begin, kingdoms_end),
                          (try_begin),
                          #Handle separately for adding to the player's faction
                          #The player may decide to accept or reject the return
                          (this_or_next|eq, ":faction_liege", "trp_player"),
                          (eq, ":faction_no", "fac_player_supporters_faction"),
                          #(eq, 1, 0),#<-- temporarily disable
                          #Lord comes to petition the player instead of automatically returning
                          (call_script, "script_change_troop_faction", ":troop_no", ":faction_no"),
                          (troop_set_slot, ":troop_no", slot_troop_occupation, slto_inactive),
                          #Show event (no log without actual faction change)
                          (str_store_troop_name, s4, ":troop_no"),
                          (str_store_faction_name, s5, ":faction_no"),
                          (str_store_troop_name, s6, ":faction_liege"),
                          (display_message, "@{s4} has returned from exile, seeking refuge with {s6} of {s5}."),
                          #Remove party
                          etc
                    ]),

He says that changing slto_inactive to slto_kingdom_hero should resolve the issue. I'm about to try it out, and hopefully I don't make errors in compiling the files, and I'm going to go ingame and wait for an exiled lord to return.

I just want to know if any Floris modders still roam around here and come across this thread, if this will resolve the issue?

And here's the thread I made on the other section where the other user helped me out: https://forums.taleworlds.com/index.php/topic,356334.0.html
 
Back
Top Bottom