+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 29

Thread: Heir to the Throne - Casus Belli Scripts

  1. #1
    Game Director Paradox Dev Team Doomdark's Avatar

    Join Date
    Apr 2000
    Location
    Stockholm, Sweden
    Posts
    5,236

    Heir to the Throne - Casus Belli Scripts

    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:

    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
    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).

    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:

    Code:
    	0.75	# _DDEF_DEFENDER_BADBOY_MULT_ (Infamy multiplied by this for defenders in peace treaties, unless the CB is "mutual" )
    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:
    # 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
    
    }
    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.)

    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?
    Henrik Fåhraeus

    Abusus non tollit usum

  2. #2
    So, if I want to conquer the world, I have to pay 4% Stability Cost (4 Infamy) per province? Eek. I guess that's the first thing I will change.

    But yaa, it looks easy to understand.

  3. #3
    Colonel Dominik's Avatar
    200k clubAchtung PanzerArsenal of DemocracyHearts of Iron 2: ArmageddonCrusader Kings II
    Darkest HourDeus VultEuropa Universalis 3EU3 CompleteDivine Wind
    For The GloryFor the MotherlandHearts of Iron IIIHOI3: Their Finest HourHeir to the Throne
    Europa Universalis III: In NomineKing Arthur IIMagickaMarch of the EaglesEU3 Napoleon's Ambition
    Victoria: RevolutionsEuropa Universalis: RomeSemper FiSengokuSword of the Stars
    Victoria 2Victoria II: A House DividedVictoria II: Heart of DarknessRome: Vae VictisMount & Blade: Warband
    Warlock: Master of the ArcaneHearts of Iron: The Card GameCK2: Holy KnightEU3 Collectors Edition500k club
    Europa Universalis IV: Pre-orderEUIV: Call to arms eventWarlock 2: The ExiledEUIV: Wealth of NationsEUIV: Conquest of Paradise

    Join Date
    Apr 2002
    Location
    Poland
    Posts
    1,076
    Code:
    2		# _DDEF_PO_RELEASE_VASSAL_BADBOY_, (Not applied to the winner)
    Things like this become -2 for the loser, right?
    ...

  4. #4
    Game Director Paradox Dev Team Doomdark's Avatar

    Join Date
    Apr 2000
    Location
    Stockholm, Sweden
    Posts
    5,236
    Quote Originally Posted by Dominik View Post
    Code:
    2		# _DDEF_PO_RELEASE_VASSAL_BADBOY_, (Not applied to the winner)
    Things like this become -2 for the loser, right?
    Ayup
    Henrik Fåhraeus

    Abusus non tollit usum

  5. #5
    You can not mod the base peace cost for province demand (normal and overseas ) ??

  6. #6
    Game Director Paradox Dev Team Doomdark's Avatar

    Join Date
    Apr 2000
    Location
    Stockholm, Sweden
    Posts
    5,236
    Quote Originally Posted by Paradygmat View Post
    You can not mod the base peace cost for province demand (normal and overseas ) ??
    A perceptive question. The answer is no; province peace cost is based on many factors in the code and is somewhat difficult to export as defines.
    Henrik Fåhraeus

    Abusus non tollit usum

  7. #7
    Quote Originally Posted by Doomdark View Post
    A perceptive question. The answer is no; province peace cost is based on many factors in the code and is somewhat difficult to export as defines.
    I had a hope , maybe in another expansion :P

    but still those options look very interesting and i can not wait until i will be able to change something :P

  8. #8
    Interesting, other factors could be adjusted though to offset the infamy hit

  9. #9
    Quote Originally Posted by Paradygmat View Post
    You can not mod the base peace cost for province demand (normal and overseas ) ??
    Well, I suppose you can make a casus belli without any requirements, that only affects peace cost, and lower peace cost of all other CBs. It has some unwanted side effects, but you can still achieve what I think you want. Unless you want to make this cost higher, then it might get tricky .

  10. #10
    Quote Originally Posted by _Robbie_ View Post
    Well, I suppose you can make a casus belli without any requirements, that only affects peace cost, and lower peace cost of all other CBs. It has some unwanted side effects, but you can still achieve what I think you want. Unless you want to make this cost higher, then it might get tricky .
    Yes I want to make the cost higher especially the overseas provinces ,for me their peace cost is to low, in our MP rules the peace cost is doubled for overseas provinces ,I have a hope that I will be able to mod that , but maybe just add the modifier in all CB that causing the pease cost for overseas provinces doubled or something like that , if it is possible to increase the peace cost in CB

  11. #11
    Colonel Dominik's Avatar
    200k clubAchtung PanzerArsenal of DemocracyHearts of Iron 2: ArmageddonCrusader Kings II
    Darkest HourDeus VultEuropa Universalis 3EU3 CompleteDivine Wind
    For The GloryFor the MotherlandHearts of Iron IIIHOI3: Their Finest HourHeir to the Throne
    Europa Universalis III: In NomineKing Arthur IIMagickaMarch of the EaglesEU3 Napoleon's Ambition
    Victoria: RevolutionsEuropa Universalis: RomeSemper FiSengokuSword of the Stars
    Victoria 2Victoria II: A House DividedVictoria II: Heart of DarknessRome: Vae VictisMount & Blade: Warband
    Warlock: Master of the ArcaneHearts of Iron: The Card GameCK2: Holy KnightEU3 Collectors Edition500k club
    Europa Universalis IV: Pre-orderEUIV: Call to arms eventWarlock 2: The ExiledEUIV: Wealth of NationsEUIV: Conquest of Paradise

    Join Date
    Apr 2002
    Location
    Poland
    Posts
    1,076
    Would it be possible to add a simple 1/0 flag in defines that would allow those who would like such "house rule" to block all peace options not explicitly allowed in CB code?
    ...

  12. #12
    Quote Originally Posted by Dominik View Post
    Would it be possible to add a simple 1/0 flag in defines that would allow those who would like such "house rule" to block all peace options not explicitly allowed in CB code?
    that would be great , if you can have the rule that allow you only to take that what CB shows :P

  13. #13
    Colonel Dominik's Avatar
    200k clubAchtung PanzerArsenal of DemocracyHearts of Iron 2: ArmageddonCrusader Kings II
    Darkest HourDeus VultEuropa Universalis 3EU3 CompleteDivine Wind
    For The GloryFor the MotherlandHearts of Iron IIIHOI3: Their Finest HourHeir to the Throne
    Europa Universalis III: In NomineKing Arthur IIMagickaMarch of the EaglesEU3 Napoleon's Ambition
    Victoria: RevolutionsEuropa Universalis: RomeSemper FiSengokuSword of the Stars
    Victoria 2Victoria II: A House DividedVictoria II: Heart of DarknessRome: Vae VictisMount & Blade: Warband
    Warlock: Master of the ArcaneHearts of Iron: The Card GameCK2: Holy KnightEU3 Collectors Edition500k club
    Europa Universalis IV: Pre-orderEUIV: Call to arms eventWarlock 2: The ExiledEUIV: Wealth of NationsEUIV: Conquest of Paradise

    Join Date
    Apr 2002
    Location
    Poland
    Posts
    1,076
    Alternatively, increasing infamy penalty 3 or 4 times while properly adjusting infamy reduction in CBs to achieve original levels of infamy gained while conforming with CB goals would have an effect close to blocking. For the player at least, I hope the AI also checks if it will not go over infamy limit with peace options.
    ...

  14. #14
    Field Marshal sprites's Avatar
    200k clubCrusader Kings IIEU3 CompleteDivine WindFor The Glory
    For the MotherlandHearts of Iron IIIHeir to the ThroneMagickaSemper Fi
    Victoria 2Victoria II: A House Divided500k clubEuropa Universalis IV: Pre-order

    Join Date
    May 2008
    Location
    France
    Posts
    6,058
    force vassalizing isn't there , it still cost 0 BB ?
    and i didn't see the 'my religion but not theirs' case in the CB's , i should just use a holy war and get them at normal cost , getting the catholic and muslim at same cost from OE?

    and the 'defect province' if two or more provinces defected , i hope the CB includes them all

  15. #15
    Colonel Dominik's Avatar
    200k clubAchtung PanzerArsenal of DemocracyHearts of Iron 2: ArmageddonCrusader Kings II
    Darkest HourDeus VultEuropa Universalis 3EU3 CompleteDivine Wind
    For The GloryFor the MotherlandHearts of Iron IIIHOI3: Their Finest HourHeir to the Throne
    Europa Universalis III: In NomineKing Arthur IIMagickaMarch of the EaglesEU3 Napoleon's Ambition
    Victoria: RevolutionsEuropa Universalis: RomeSemper FiSengokuSword of the Stars
    Victoria 2Victoria II: A House DividedVictoria II: Heart of DarknessRome: Vae VictisMount & Blade: Warband
    Warlock: Master of the ArcaneHearts of Iron: The Card GameCK2: Holy KnightEU3 Collectors Edition500k club
    Europa Universalis IV: Pre-orderEUIV: Call to arms eventWarlock 2: The ExiledEUIV: Wealth of NationsEUIV: Conquest of Paradise

    Join Date
    Apr 2002
    Location
    Poland
    Posts
    1,076
    I think you are looking for this value:
    Code:
    4		# _DDEF_PO_BECOME_VASSAL_BADBOY_,
    ...

  16. #16
    Game Director Paradox Dev Team Doomdark's Avatar

    Join Date
    Apr 2000
    Location
    Stockholm, Sweden
    Posts
    5,236
    Quote Originally Posted by sprites View Post
    force vassalizing isn't there , it still cost 0 BB ?
    4 # _DDEF_PO_BECOME_VASSAL_BADBOY_,

    and i didn't see the 'my religion but not theirs' case in the CB's , i should just use a holy war and get them at normal cost , getting the catholic and muslim at same cost from OE? and the 'defect province' if two or more provinces defected , i hope the CB includes them all
    There are 30 something different CB scripts. Refer to the Casus Belli Guide Johan posted earlier.
    Henrik Fåhraeus

    Abusus non tollit usum

  17. #17
    Quote Originally Posted by Doomdark View Post
    A perceptive question. The answer is no; province peace cost is based on many factors in the code and is somewhat difficult to export as defines.
    Maybe you can't change the base peace cost, but you can lower the cost of every CB to get around it?

  18. #18
    Game Director Paradox Dev Team Doomdark's Avatar

    Join Date
    Apr 2000
    Location
    Stockholm, Sweden
    Posts
    5,236
    Quote Originally Posted by arstal View Post
    Maybe you can't change the base peace cost, but you can lower the cost of every CB to get around it?
    Oh yes. The base province cost might not be moddable, but it is still modified by the factors in the CBs, obviously.
    Henrik Fåhraeus

    Abusus non tollit usum

  19. #19
    Field Marshal Panopticon's Avatar
    EU3 CompleteDivine WindHeir to the Throne

    Join Date
    Sep 2008
    Location
    Old cold Sweden
    Posts
    2,657
    Hmmm... Is that "purging of heresy" really meant to be like that? There is one thing that seems strange to me..

    If I have Unam Sanctam and I have "heretic country", I can take provinces from every nation with my religion for reduced cost? That seems quite wrong.. I can't really see it works in any other way but I'm not a profesional.. Is it supposed to be like that?

  20. #20
    when we talking about scrips it will be posible to add culture tradition decay like army and navy ??

+ Reply to Thread
Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts