In order to answer some of the questions raised in response to the Casus Belli guide, let's open the hatch and sneak a peek at the CB engine. First of all, the base values for infamy (badboy), prestige and peace cost are exported to "defines.txt" and look thusly:
These are the values used in peace treaties when you have no valid CB, or the CB does not apply to what you are demanding or offering. If the CB does apply, the base values are multiplied by a factor set in the CB script. Before we move on to the CB scripts, note that the loser normally gets the inverse of what the winner does. (So, if Castille demands a province from Aragon, Castille gets 4 infamy and Aragon -4.) There are exceptions to this rule, as the comments in the defines show (e.g. demanding the release of a vassal gives no infamy, but complying yields -2).Code:# Peace Option Effects, base values for the winner. The loser gets the inverse. 8 # _DDEF_PO_ANNEX_BADBOY_, (No effect on loser :) 4 # _DDEF_PO_DEMAND_PROVINCES_BADBOY_, (Per province) 0.4 # _DDEF_PO_REVOKE_CORES_BADBOY_, (Per core, Not applied to the winner) 2 # _DDEF_PO_RELEASE_VASSAL_BADBOY_, (Not applied to the winner) 2 # _DDEF_PO_RELEASE_ANNEXED_BADBOY_, (Per province, not applied to the winner) 3 # _DDEF_PO_CHANGE_RELIGION_BADBOY_, (Not applied to the winner) 0 # _DDEF_PO_FORM_PU_BADBOY_, (Not applied to the winner) 0 # _DDEF_PO_JOIN_LEAGUE_BADBOY_, (Not applied to the winner) 0.001 # _DDEF_PO_GOLD_BADBOY_, (Per month of income, not applied to the winner) 4 # _DDEF_PO_BECOME_VASSAL_BADBOY_, 0 # _DDEF_PO_CONCEDE_DEFEAT_BADBOY_, (Not applied to the winner) 0 # _DDEF_PO_REDUCE_SPHERE_BADBOY_, 0 # _DDEF_PO_ANNUL_TREATY_BADBOY_, 0.1 # _DDEF_PO_ANNEX_PRESTIGE_, (No effect on loser :) 0.05 # _DDEF_PO_DEMAND_PROVINCES_PRESTIGE_, (Per province) 0.01 # _DDEF_PO_REVOKE_CORES_PRESTIGE_, (Per core) 0.05 # _DDEF_PO_RELEASE_VASSAL_PRESTIGE_, 0.01 # _DDEF_PO_RELEASE_ANNEXED_PRESTIGE_, (Per released province) 0.1 # _DDEF_PO_CHANGE_RELIGION_PRESTIGE_, 0.2 # _DDEF_PO_FORM_PU_PRESTIGE_, 0.05 # _DDEF_PO_JOIN_LEAGUE_PRESTIGE_, 0.002 # _DDEF_PO_GOLD_PRESTIGE_, (Per month of income) 0.1 # _DDEF_PO_BECOME_VASSAL_PRESTIGE_, 0.05 # _DDEF_PO_CONCEDE_DEFEAT_PRESTIGE_ 0.05 # _DDEF_PO_REDUCE_SPHERE_PRESTIGE_, 0.03 # _DDEF_PO_ANNUL_TREATY_PRESTIGE_, 40 # _DDEF_PEACE_COST_UNION_ Peace cost for forming a personal union 50 # _DDEF_PEACE_COST_CONVERSION_ Peace cost for forced conversion 5 # _DDEF_PEACE_COST_RELEASE_ Base Peace cost for releasing an annexed country (also increases with nr of provinces) 5 # _DDEF_PEACE_COST_CONCEDE_ Base Peace cost for conceding defeat 1 # _DDEF_PEACE_COST_GOLD_STEP_ Peace Cost for 1 month of income 20 # _DDEF_PEACE_COST_SPHERE_ Peace cost for removing a country from a Sphere of Influence 15 # _DDEF_PEACE_COST_ANNUL_ Peace cost for annulment of treaties 10 # _DDEF_PEACE_COST_JOIN_LEAGUE_ Peace Cost for Joining a Trade League
What about the defenders in a war? If the CB has been scripted as being "mutual", it applies to both sides. If not, they operate at the base values, with the following exception:
Furthermore, defenders can always demand core provinces at zero Infamy. Now, on to the CB scripts, where all the cool kids hang out! Here is a pretty interesting example - the Heresy CB:Code:0.75 # _DDEF_DEFENDER_BADBOY_MULT_ (Infamy multiplied by this for defenders in peace treaties, unless the CB is "mutual" )
Most of it is probably pretty self-explanatory to anyone who has modded our scripts before (yes, I have faith in you.) You can see the factors applied to the base values (badboy_factor, prestige_factor and peace_cost_factor.) This CB is active while the conditions inside 'prerequisites' are true (other CBs can only be fired by scripted effects - or from inside the code - and have a fixed duration.)Code:# Purging of Heresy cb_heretic = { mutual = yes badboy_factor = 0.25 prestige_factor = 2 peace_cost_factor = 0.5 prerequisites = { idea = deus_vult # Actually "Unam Sanctam" religion_group = THIS OR = { NOT = { religion = THIS } has_country_modifier = heretic_country THIS = { has_country_modifier = heretic_country } } } allowed_provinces = { religion = THIS } po_change_religion = yes po_demand_provinces = yes country_desc = ALL_HERETICS prov_desc = ALL_REL_PROVS war_name = HERETIC_WAR_NAME }
The 'allowed_provinces' trigger specifies which provinces can be demanded with the CB multipliers. This only applies if the corresponding peace options ('po_demand_provinces' and 'po_annex') are actually allowed by the CB.
An interesting thing to realize is that the order in which the allowed peace options are listed determines the AI's priorities when making peace demands. Thus, if the AI is using this CB, it will demand forced conversion first, then provinces for any remaining warscore, then it will basically default to the old IN logic.
The three last fields in this CB script point to localized text entries. They determine what wars will be called when using this CB, and which text will be used if the target countries or provinces are too many to list conveniently (so, it might simply say "All provinces of our religion" instead of a long list of specific provinces.)
Now, are you more confused, or less?![]()



Reply With Quote

















, maybe in another expansion :P 

.

