Athena_the_Goddesss
Recruit
Hello! New modder here. I was looking for how to set Lord personalities definitively in my mod, via modulesystem. I wanted to use different behaviors as reflective of different factions' overall behavior. I.E., Faction 1's general culture is more aggressive and militant than other factions: set all/most of their lords' personalities as martial.
I couldn't find any answer for this question. So I threw spaghetti (code) at the wall and found something stuck! In module_scripts.py, there are scripts to determine many different aspects of the companions. This starts under "initialize_npcs". There is one line that sets their lord reputation, for when you appoint them to be a lord. I copy-pasted that line. Moved it below the last companion, Klethi. Replaced the troop id with the lord's specific troop id. So if we copy/paste Klethi's code, replace "trp_npc16" with the lord's id: "trp_knight_1_1". Knight 1_1 is Count Klargus, of Swadia. If you add this line underneath Klethi, it will set Klargus' reputation to whatever you set at the end of the line.
In this example, from module_scripts.py, under "initialize_npcs", following Klethi's entries, I've set all Swadian lords with the "upstanding" reputation:
As you can see, it directly reflects the final line of Klethi's code, simply replacing her troop id with the lord's and replacing the rep_roguish with whichever you like. I assume assigning the lords reputations used for suitors would not go over well, but maybe I'll try it later for kicks and giggles. Hope this helps someone down the line![/ISPOILER]
I couldn't find any answer for this question. So I threw spaghetti (code) at the wall and found something stuck! In module_scripts.py, there are scripts to determine many different aspects of the companions. This starts under "initialize_npcs". There is one line that sets their lord reputation, for when you appoint them to be a lord. I copy-pasted that line. Moved it below the last companion, Klethi. Replaced the troop id with the lord's specific troop id. So if we copy/paste Klethi's code, replace "trp_npc16" with the lord's id: "trp_knight_1_1". Knight 1_1 is Count Klargus, of Swadia. If you add this line underneath Klethi, it will set Klargus' reputation to whatever you set at the end of the line.
In this example, from module_scripts.py, under "initialize_npcs", following Klethi's entries, I've set all Swadian lords with the "upstanding" reputation:
Code:
(troop_set_slot, "trp_npc16", slot_troop_morality_type, tmt_aristocratic), #klethi
(troop_set_slot, "trp_npc16", slot_troop_morality_value, 4),
(troop_set_slot, "trp_npc16", slot_troop_2ary_morality_type, tmt_humanitarian),
(troop_set_slot, "trp_npc16", slot_troop_2ary_morality_value, -1),
(troop_set_slot, "trp_npc16", slot_troop_personalityclash_object, "trp_npc15"), #klethi
(troop_set_slot, "trp_npc16", slot_troop_personalityclash2_object, "trp_npc1"), #klethi - borcha
(troop_set_slot, "trp_npc16", slot_troop_personalitymatch_object, "trp_npc7"), #deshavi - klethi
(troop_set_slot, "trp_npc16", slot_troop_home, "p_village_20"), #Uslum
(troop_set_slot, "trp_npc16", slot_troop_payment_request, 200),
(troop_set_slot, "trp_npc16", slot_troop_kingsupport_argument, argument_lords),
(troop_set_slot, "trp_npc16", slot_troop_kingsupport_opponent, "trp_npc12"), #nizar
(troop_set_slot, "trp_npc16", slot_troop_town_with_contacts, "p_town_9"), #khudan
(troop_set_slot, "trp_npc16", slot_lord_reputation_type, lrep_roguish), #END OF COMPANION CODE
(troop_set_slot, "trp_knight_1_1", slot_lord_reputation_type, lrep_upstanding), #THIS CODE SETS THE LORD'S PERSONALITIES.
(troop_set_slot, "trp_knight_1_2", slot_lord_reputation_type, lrep_upstanding), #
(troop_set_slot, "trp_knight_1_3", slot_lord_reputation_type, lrep_upstanding), #
(troop_set_slot, "trp_knight_1_4", slot_lord_reputation_type, lrep_upstanding), #
(troop_set_slot, "trp_knight_1_5", slot_lord_reputation_type, lrep_upstanding), #
(troop_set_slot, "trp_knight_1_6", slot_lord_reputation_type, lrep_upstanding), #
(troop_set_slot, "trp_knight_1_7", slot_lord_reputation_type, lrep_upstanding), #
(troop_set_slot, "trp_knight_1_8", slot_lord_reputation_type, lrep_upstanding), #
(troop_set_slot, "trp_knight_1_9", slot_lord_reputation_type, lrep_upstanding), #
(troop_set_slot, "trp_knight_1_10", slot_lord_reputation_type, lrep_upstanding), #
(troop_set_slot, "trp_knight_1_11", slot_lord_reputation_type, lrep_upstanding), #
(troop_set_slot, "trp_knight_1_12", slot_lord_reputation_type, lrep_upstanding), #
(troop_set_slot, "trp_knight_1_13", slot_lord_reputation_type, lrep_upstanding), #
(troop_set_slot, "trp_knight_1_14", slot_lord_reputation_type, lrep_upstanding), #
(troop_set_slot, "trp_knight_1_15", slot_lord_reputation_type, lrep_upstanding), #
(troop_set_slot, "trp_knight_1_16", slot_lord_reputation_type, lrep_upstanding), #
(troop_set_slot, "trp_knight_1_17", slot_lord_reputation_type, lrep_upstanding), #
(troop_set_slot, "trp_knight_1_18", slot_lord_reputation_type, lrep_upstanding), #
(troop_set_slot, "trp_knight_1_19", slot_lord_reputation_type, lrep_upstanding), #
(troop_set_slot, "trp_knight_1_20", slot_lord_reputation_type, lrep_upstanding), #
As you can see, it directly reflects the final line of Klethi's code, simply replacing her troop id with the lord's and replacing the rep_roguish with whichever you like. I assume assigning the lords reputations used for suitors would not go over well, but maybe I'll try it later for kicks and giggles. Hope this helps someone down the line![/ISPOILER]
Last edited by a moderator: