How to stop lords from a specific faction from defecting

Users who are viewing this thread

Dalloskid

Sergeant
Hello there :smile:

So I've been playing the mod 'Native expansion' for a long time, and in its current state, there is a faction that invades with lords and such, takes land etc.
However, the lords end up defecting straightaway and then end up doing nothing. I was wondering how I would go about making so that the lords from this specific faction CANNOT under any circumstances rebel, except they can be 'recruited' from your dungeon when the faction is defeated.

PS I do not plan on releasing this, but soulmata, the current developer of this mod has released the source files for it and mentioned that if you have a fix for it that we can contact him and he can update it, so I may do that as he himself has mentioned he would do it, but barely updates the mod currently.

Cheers for you time!
 
This was asked & answered just recently.

http://forums.taleworlds.com/index.php/topic,6575.msg6754610.html#msg6754610

But instead of all that just (neq, ":faction", fac_dark_knight_faction_name)
 
I noticed this post before I made this topic, but tbh I was confused. Do I just copy what you wrote in the module_simple_triggers file? and that will make the lords stop defecting? Also, will this work with saves?
 
You need to find the relevant bit of code within simple_triggers.py, in this case:

#Auto-indictment or defection
(try_begin),
(this_or_next|troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
    (eq, ":troop_no", "trp_player"),     

(try_begin),
    (eq, ":troop_no", "trp_player"),
    (assign, ":faction", "$players_kingdom"),
(else_try),
    (store_faction_of_troop, ":faction", ":troop_no"),
(try_end),

(faction_get_slot, ":faction_leader", ":faction", slot_faction_leader),
(neq, ":troop_no", ":faction_leader"),
(call_script, "script_troop_get_relation_with_troop", ":troop_no", ":faction_leader"),
(le, reg0, -75),

and then you need to exit that bit of code if it is trying to defect a lord of the dark knight faction, I don't know what the faction name for them is in Native Expansion since I've never taken a look at their source, but it'll be in factions.py. (You then need to add fac_ to the beginning of that name)

#Auto-indictment or defection
(try_begin),
(this_or_next|troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
    (eq, ":troop_no", "trp_player"),     

(try_begin),
    (eq, ":troop_no", "trp_player"),
    (assign, ":faction", "$players_kingdom"),
(else_try),
    (store_faction_of_troop, ":faction", ":troop_no"),
(try_end),

(neq, ":faction", fac_dark_knight_faction_name), #Continue if faction does not equal dark knights

(faction_get_slot, ":faction_leader", ":faction", slot_faction_leader),
(neq, ":troop_no", ":faction_leader"),
(call_script, "script_troop_get_relation_with_troop", ":troop_no", ":faction_leader"),
(le, reg0, -75),
 
So this cant be done by just editing the text files? I need to use the source code and install python and such?
 
Dalloskid said:
So this cant be done by just editing the text files? I need to use the source code and install python and such?

You can, but it's harder and I can't be bothered to download the source myself, make the change, compile it and then compare the difference in the two .txt files.

If soulmata wants to add this fix then he would want module code anyway, not a text file edit.

So yeah, you'll need python. Just follow the various guides on here/unofficial tutorials about setting it up.
 
OK well thanks for your help :smile: I'm a little annoyed though, coz I only just uninstalled python about a day ago  :roll: haha

anywho, cheers for your time!  :smile:
 
Back
Top Bottom