sirgrigor
Sergeant at Arms

Hello,
I am having fun integrating this mod with my own (Calradia at War). But I am having trouble setting starting factions and having them ruled like they are in native.
My first goal was to recreate faction leaders. I copied them in module_troops.py, but put them at end of npcs so King Harlaus starts at npc79. Then I made the code changes below. But the faction leaders including King Harlaus travel to main character and then disappear. What is going on?
Here is my code: (modified module_scripts.py code for starting factions)
(faction_set_slot, "fac_kingdom_1", slot_faction_culture, "fac_culture_1"),
(faction_set_slot, "fac_kingdom_1", slot_faction_leader, "trp_npc79"),
#(faction_set_slot, "fac_kingdom_1", slot_faction_state, sfs_inactive),
(faction_set_slot, "fac_kingdom_2", slot_faction_culture, "fac_culture_2"),
(faction_set_slot, "fac_kingdom_2", slot_faction_leader, "trp_npc80"),
#(faction_set_slot, "fac_kingdom_2", slot_faction_state, sfs_inactive),
(faction_set_slot, "fac_kingdom_3", slot_faction_culture, "fac_culture_3"),
(faction_set_slot, "fac_kingdom_3", slot_faction_leader, "trp_npc81"),
#(faction_set_slot, "fac_kingdom_3", slot_faction_state, sfs_inactive),
(faction_set_slot, "fac_kingdom_4", slot_faction_culture, "fac_culture_4"),
(faction_set_slot, "fac_kingdom_4", slot_faction_leader, "trp_npc82"),
#(faction_set_slot, "fac_kingdom_4", slot_faction_state, sfs_inactive),
(faction_set_slot, "fac_kingdom_5", slot_faction_culture, "fac_culture_5"),
(faction_set_slot, "fac_kingdom_5", slot_faction_leader, "trp_npc83"),
#(faction_set_slot, "fac_kingdom_5", slot_faction_state, sfs_inactive),
Here is my code: (modified module_scripts.py code for starting Custow)
#################################################################################
# 1. Capital City, Praven, Home of King Harlaus
(party_set_slot, "p_custom_settlement_1", slot_settlement_economic, 2), #Praven will start full for now so people can buy food
(party_set_slot, "p_custom_settlement_1", slot_settlement_military, 2),
(call_script, "script_reset_settlement_icon", "p_custom_settlement_1"),
(party_set_faction,"p_custom_settlement_1","fac_kingdom_1"),
# Ruler of City Code.
(troop_set_slot, "trp_npc79", slot_troop_renown, 500),
(troop_set_slot, "trp_npc79", slot_troop_banner_scene_prop, 1),
(troop_set_slot, "trp_npc79", slot_troop_occupation, slto_settlement_lord),
(troop_set_slot, "trp_npc79", slot_troop_occupation, slto_faction_ruler),
# City and Faction Code
(party_set_slot,"p_custom_settlement_1", slot_town_lord, "trp_npc79"),
(call_script, "script_give_center_to_lord", "p_custom_settlement_1", "trp_npc79", 0),
(faction_set_slot,"fac_kingdom_1",slot_faction_leader,"trp_npc79"),
(faction_set_slot,"fac_kingdom_1",slot_faction_marshall,"trp_npc79"),
(faction_set_slot,"fac_kingdom_1",slot_faction_num_towns,1),
(party_set_faction,"p_custom_settlement_1","fac_kingdom_1"),
(troop_get_slot, ":lords_party","trp_npc79", slot_troop_leaded_party),
(party_set_faction,":lords_party","fac_kingdom_1"),
(party_relocate_near_party, ":lords_party", "p_custom_settlement_1", 0),
(party_set_ai_object, ":lords_party", "p_custom_settlement_1"),
(party_set_ai_behavior, ":lords_party", ai_bhvr_travel_to_party),
(party_add_members,":lords_party","trp_royal_bodyguard",5),
(party_add_members,":lords_party","trp_swadian_knight",10),
(party_add_members,":lords_party","trp_swadian_man_at_arms",35),
#name and icon of a king/queen
(str_store_troop_name,s2,"trp_npc79"),
(party_set_icon, ":lords_party", "icon_flagbearer_b"),
(troop_set_faction,"trp_npc79","fac_kingdom_1"),
(troop_set_slot,"trp_npc79", slot_troop_occupation,slto_faction_ruler),
#message
(str_clear, s2),
(str_clear, s3),
(str_store_faction_name, s2, "fac_kingdom_1"),
(str_store_party_name, s3, "p_custom_settlement_1"),
(display_message,"@The {s2} has risen at the town of {s3}.", 0xFF00ff),
# Setup Town Population
(call_script,"script_get_population_party","p_custom_settlement_1"),
(try_for_range, ":unused", 0, 100),
(party_add_template,"$g_cur_population", "pt_village_immigrants"),
(try_end),
# Setup Garrison
(party_add_members,"p_custom_settlement_1","trp_royal_bodyguard",25),
(party_add_members,"p_custom_settlement_1","trp_p_militia",300),
(party_add_members,"p_custom_settlement_1","trp_p_sentry",300),
(party_add_members,"p_custom_settlement_1","trp_flurry",25),
# Setup Resources
(party_set_slot,"p_custom_settlement_1", slot_settlement_resource_gold, 50000), #gold
(party_set_slot,"p_custom_settlement_1", slot_settlement_resource_wood, 1000), #wood
(party_set_slot,"p_custom_settlement_1", slot_settlement_resource_rock, 1000), #rock
(party_set_slot,"p_custom_settlement_1", slot_settlement_resource_food, 1000), #food
(party_set_slot,"p_custom_settlement_1", slot_settlement_resource_rate_gold, 1),
(party_set_slot,"p_custom_settlement_1", slot_settlement_resource_rate_wood, 1),
(party_set_slot,"p_custom_settlement_1", slot_settlement_resource_rate_rock, 1),
(party_set_slot,"p_custom_settlement_1", slot_settlement_resource_rate_food, 1),
#################################################################################
What am I doing wrong? How can I get Praven to be ruled by King Harlaus (trp_npc79) and have him and his party start there? Currently
Thanks,
s/g
I am having fun integrating this mod with my own (Calradia at War). But I am having trouble setting starting factions and having them ruled like they are in native.
My first goal was to recreate faction leaders. I copied them in module_troops.py, but put them at end of npcs so King Harlaus starts at npc79. Then I made the code changes below. But the faction leaders including King Harlaus travel to main character and then disappear. What is going on?
Here is my code: (modified module_scripts.py code for starting factions)
(faction_set_slot, "fac_kingdom_1", slot_faction_culture, "fac_culture_1"),
(faction_set_slot, "fac_kingdom_1", slot_faction_leader, "trp_npc79"),
#(faction_set_slot, "fac_kingdom_1", slot_faction_state, sfs_inactive),
(faction_set_slot, "fac_kingdom_2", slot_faction_culture, "fac_culture_2"),
(faction_set_slot, "fac_kingdom_2", slot_faction_leader, "trp_npc80"),
#(faction_set_slot, "fac_kingdom_2", slot_faction_state, sfs_inactive),
(faction_set_slot, "fac_kingdom_3", slot_faction_culture, "fac_culture_3"),
(faction_set_slot, "fac_kingdom_3", slot_faction_leader, "trp_npc81"),
#(faction_set_slot, "fac_kingdom_3", slot_faction_state, sfs_inactive),
(faction_set_slot, "fac_kingdom_4", slot_faction_culture, "fac_culture_4"),
(faction_set_slot, "fac_kingdom_4", slot_faction_leader, "trp_npc82"),
#(faction_set_slot, "fac_kingdom_4", slot_faction_state, sfs_inactive),
(faction_set_slot, "fac_kingdom_5", slot_faction_culture, "fac_culture_5"),
(faction_set_slot, "fac_kingdom_5", slot_faction_leader, "trp_npc83"),
#(faction_set_slot, "fac_kingdom_5", slot_faction_state, sfs_inactive),
Here is my code: (modified module_scripts.py code for starting Custow)
#################################################################################
# 1. Capital City, Praven, Home of King Harlaus
(party_set_slot, "p_custom_settlement_1", slot_settlement_economic, 2), #Praven will start full for now so people can buy food
(party_set_slot, "p_custom_settlement_1", slot_settlement_military, 2),
(call_script, "script_reset_settlement_icon", "p_custom_settlement_1"),
(party_set_faction,"p_custom_settlement_1","fac_kingdom_1"),
# Ruler of City Code.
(troop_set_slot, "trp_npc79", slot_troop_renown, 500),
(troop_set_slot, "trp_npc79", slot_troop_banner_scene_prop, 1),
(troop_set_slot, "trp_npc79", slot_troop_occupation, slto_settlement_lord),
(troop_set_slot, "trp_npc79", slot_troop_occupation, slto_faction_ruler),
# City and Faction Code
(party_set_slot,"p_custom_settlement_1", slot_town_lord, "trp_npc79"),
(call_script, "script_give_center_to_lord", "p_custom_settlement_1", "trp_npc79", 0),
(faction_set_slot,"fac_kingdom_1",slot_faction_leader,"trp_npc79"),
(faction_set_slot,"fac_kingdom_1",slot_faction_marshall,"trp_npc79"),
(faction_set_slot,"fac_kingdom_1",slot_faction_num_towns,1),
(party_set_faction,"p_custom_settlement_1","fac_kingdom_1"),
(troop_get_slot, ":lords_party","trp_npc79", slot_troop_leaded_party),
(party_set_faction,":lords_party","fac_kingdom_1"),
(party_relocate_near_party, ":lords_party", "p_custom_settlement_1", 0),
(party_set_ai_object, ":lords_party", "p_custom_settlement_1"),
(party_set_ai_behavior, ":lords_party", ai_bhvr_travel_to_party),
(party_add_members,":lords_party","trp_royal_bodyguard",5),
(party_add_members,":lords_party","trp_swadian_knight",10),
(party_add_members,":lords_party","trp_swadian_man_at_arms",35),
#name and icon of a king/queen
(str_store_troop_name,s2,"trp_npc79"),
(party_set_icon, ":lords_party", "icon_flagbearer_b"),
(troop_set_faction,"trp_npc79","fac_kingdom_1"),
(troop_set_slot,"trp_npc79", slot_troop_occupation,slto_faction_ruler),
#message
(str_clear, s2),
(str_clear, s3),
(str_store_faction_name, s2, "fac_kingdom_1"),
(str_store_party_name, s3, "p_custom_settlement_1"),
(display_message,"@The {s2} has risen at the town of {s3}.", 0xFF00ff),
# Setup Town Population
(call_script,"script_get_population_party","p_custom_settlement_1"),
(try_for_range, ":unused", 0, 100),
(party_add_template,"$g_cur_population", "pt_village_immigrants"),
(try_end),
# Setup Garrison
(party_add_members,"p_custom_settlement_1","trp_royal_bodyguard",25),
(party_add_members,"p_custom_settlement_1","trp_p_militia",300),
(party_add_members,"p_custom_settlement_1","trp_p_sentry",300),
(party_add_members,"p_custom_settlement_1","trp_flurry",25),
# Setup Resources
(party_set_slot,"p_custom_settlement_1", slot_settlement_resource_gold, 50000), #gold
(party_set_slot,"p_custom_settlement_1", slot_settlement_resource_wood, 1000), #wood
(party_set_slot,"p_custom_settlement_1", slot_settlement_resource_rock, 1000), #rock
(party_set_slot,"p_custom_settlement_1", slot_settlement_resource_food, 1000), #food
(party_set_slot,"p_custom_settlement_1", slot_settlement_resource_rate_gold, 1),
(party_set_slot,"p_custom_settlement_1", slot_settlement_resource_rate_wood, 1),
(party_set_slot,"p_custom_settlement_1", slot_settlement_resource_rate_rock, 1),
(party_set_slot,"p_custom_settlement_1", slot_settlement_resource_rate_food, 1),
#################################################################################
What am I doing wrong? How can I get Praven to be ruled by King Harlaus (trp_npc79) and have him and his party start there? Currently
Thanks,
s/g