Crusader Kings III

Crusader Kings III

Mercenary Society
Morven 10 Jul, 2022 @ 10:26pm
Scaling Hiring Costs
Hey mate, I've added compatibility to Mercenary Society with my "Contract Assistance Costs Scale With Title Tier" mod here:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2833176719

But if you want to include it directly in your mod with your own values (I balanced mine around the Iberian struggle where kingdoms can be as small as dukedoms), then feel free to use the code below.

Because at the moment you use a mix of the vanilla value for the scripted effect and the custom modded value for the character interaction I've included both.

EDIT: Fixed a duplicated key bug.

#Save to \common\script_values\<my_mod_name>.txt #Same scripted value called upon in three different instances #Needs to determine which instance it is being called in, and to set the scopes correctly for that instance without triggering the blocs for the other instances #Calculation repeated each time for each scope instance #Set hire army costs here count_hire_cost_mod = { value = 80 } duke_hire_cost_mod = { value = 180 } king_hire_cost_mod = { value = 240 } emperor_hire_cost_mod = { value = 400 } offer_assistance_interaction_gold_value = { if = { #When called in fp2_contract_assistance_war_pay_effect in \common\scripted_effects\03_dlc_fp2_scripted_effects.txt #This is what actually effects the payment limit = { exists = scope:contract_assistance_helper exists = scope:contract_assistance_helper.primary_title scope:contract_assistance_helper.primary_title.tier > 0 } if = { limit = { scope:contract_assistance_helper.primary_title.tier = 2 } add = count_hire_cost_mod } if = { limit = { scope:contract_assistance_helper.primary_title.tier = 3 } add = duke_hire_cost_mod } if = { limit = { scope:contract_assistance_helper.primary_title.tier = 4 } add = king_hire_cost_mod } if = { limit = { scope:contract_assistance_helper.primary_title.tier = 5 } add = emperor_hire_cost_mod } } else_if = { #When called in request_contract_assistance_interaction in \common\character_interactions\03_fp2_interactions.txt #Ensures the tooltip displays correctly and the AI makes good decisions in the interaction limit = { exists = scope:actor exists = scope:actor.primary_title scope:actor.primary_title.tier > 0 #Distinguihes it from contract_assistance_interaction scope:actor = { is_at_war = no } } if = { limit = { scope:actor.primary_title.tier = 2 } add = count_hire_cost_mod } if = { limit = { scope:actor.primary_title.tier = 3 } add = duke_hire_cost_mod } if = { limit = { scope:actor.primary_title.tier = 4 } add = king_hire_cost_mod } if = { limit = { scope:actor.primary_title.tier = 5 } add = emperor_hire_cost_mod } } else_if = { #When called in the contract_assistance_interaction in \common\character_interactions\03_fp2_interactions.txt #Ensures the tooltip displays correctly and the AI makes good decisions in the interaction limit = { exists = scope:recipient exists = scope:recipient.primary_title scope:recipient.primary_title.tier > 0 #Distinguishes it from request_contract_assistance_interaction scope:recipient = { is_at_war = no } } if = { limit = { scope:recipient.primary_title.tier = 2 } add = count_hire_cost_mod } if = { limit = { scope:recipient.primary_title.tier = 3 } add = duke_hire_cost_mod } if = { limit = { scope:recipient.primary_title.tier = 4 } add = king_hire_cost_mod } if = { limit = { scope:recipient.primary_title.tier = 5 } add = emperor_hire_cost_mod } } else = { #Catch all returns to vanilla value if something goes wrong add = 100 } } offer_assistance_interaction_gold_modifier_value = { value = scope:recipient.gold divide = offer_assistance_interaction_gold_value floor = yes max = 5 } #Mercenary Society by Thunderhood ms_offer_assistance_interaction_gold_value = { if = { #POTENTIALLY when called in fp2_contract_assistance_war_pay_effect in \common\scripted_effects\03_ms_scripted_effects.txt #Mercenary Society presently uses the vanilla offer_assistance_interaction_gold_value to effect payment in \common\scripted_effects\03_ms_scripted_effects.txt #This is what actually effects the payment limit = { exists = scope:contract_assistance_helper exists = scope:contract_assistance_helper.primary_title scope:contract_assistance_helper.primary_title.tier > 0 } if = { limit = { scope:contract_assistance_helper.primary_title.tier = 2 } add = count_hire_cost_mod } if = { limit = { scope:contract_assistance_helper.primary_title.tier = 3 } add = duke_hire_cost_mod } if = { limit = { scope:contract_assistance_helper.primary_title.tier = 4 } add = king_hire_cost_mod } if = { limit = { scope:contract_assistance_helper.primary_title.tier = 5 } add = emperor_hire_cost_mod } } else_if = { #When called in ms_request_contract_assistance_interaction in \common\character_interactions\ms_contract_assistance_interaction.txt #Ensures the tooltip displays correctly and the AI makes good decisions in the interaction limit = { exists = scope:actor exists = scope:actor.primary_title scope:actor.primary_title.tier > 0 #Distinguihes it from contract_assistance_interaction scope:actor = { is_at_war = no } } if = { limit = { scope:actor.primary_title.tier = 2 } add = count_hire_cost_mod } if = { limit = { scope:actor.primary_title.tier = 3 } add = duke_hire_cost_mod } if = { limit = { scope:actor.primary_title.tier = 4 } add = king_hire_cost_mod } if = { limit = { scope:actor.primary_title.tier = 5 } add = emperor_hire_cost_mod } } else_if = { #When called in the ms_contract_assistance_interaction in \common\character_interactions\ms_contract_assistance_interaction.txt #Ensures the tooltip displays correctly and the AI makes good decisions in the interaction limit = { exists = scope:recipient exists = scope:recipient.primary_title scope:recipient.primary_title.tier > 0 #Distinguishes it from request_contract_assistance_interaction scope:recipient = { is_at_war = no } } if = { limit = { scope:recipient.primary_title.tier = 2 } add = count_hire_cost_mod } if = { limit = { scope:recipient.primary_title.tier = 3 } add = duke_hire_cost_mod } if = { limit = { scope:recipient.primary_title.tier = 4 } add = king_hire_cost_mod } if = { limit = { scope:recipient.primary_title.tier = 5 } add = emperor_hire_cost_mod } } else = { #Catch all returns to vanilla value if something goes wrong add = 100 } } ms_offer_assistance_interaction_gold_modifier_value = { value = scope:recipient.gold divide = ms_offer_assistance_interaction_gold_value floor = yes max = 5 }
Last edited by Morven; 11 Jul, 2022 @ 3:10pm
< >
Showing 1-2 of 2 comments
Morven 11 Jul, 2022 @ 3:11pm 
Edited it to fix a duplicated key bug.
Boss 17 Mar, 2024 @ 9:56pm 
No response, but nice work man.
< >
Showing 1-2 of 2 comments
Per page: 1530 50