Casus belli modding

From Europa Universalis 4 Wiki
Jump to navigation Jump to search

Every casus belli is made of:

  • Prerequisites
  • War goal
  • Duration
  • The way how CB is gained
  • Is it possible to be given to subject
  • Name
cb_restore_personal_union = {
	valid_for_subject = no

	is_triggered_only = yes
	months = 240

	prerequisites = {
		OR = {
			government = monarchy
			government = dutch_republic
		}
		is_revolution_target = no
		FROM = {
			government = monarchy
			is_subject = no
		}
	}

	war_goal = take_capital_personal_union
}

It is how the standard CB looks like.

Prerequisites[edit]

Prerequisites are special requirements, needed to obtain specific CB.

  • No prerequsities

If CB does not require anything to be fired, then do not add "prerequisites = {" line. However, if no prerequisites are implemented, CB has to have is_triggered_only = yes, otherwise CB will never be launched.

cb_change_government = {
         valid_for_subject = no
         is_triggered_only = yes
         months = 120
         war_goal = war_goal_change_government	
}
  • Types of prerequsities

Possible requirements for CB are listed in Conditions. The way of scripting these is similar in scripting requirements in events. Also DLC can be added as prerequisite.

Example:

prerequisites = {
       culture_group = east_asian 
       is_subject = no
}

It means CB will only be possible if country is not subject, and has East Asian culture.

War goal[edit]

War goals are the goals of war, as the name says. They are listed in /common/wargoal_types. The player can choose one of them, or create a new one, but wargoal has to be written in wargoal_types files, otherwise your CB will not work.

In CB:

war_goal = war_goal_change_government


In wargoal_types:

war_goal_change_government = {
        type = take_capital
        badboy_factor = 0.75
        prestige_factor = 1
        peace_cost_factor = 1.0	
        allowed_provinces = {
                OR = {
                        is_core = ROOT
                        is_claim = ROOT
                        any_neighbor_province = {
                                owned_by = ROOT
                        }
                }
        }
        po_change_government = yes
        po_demand_provinces = yes
        war_name = CHANGE_GOVERNMENT_WAR_NAME
}

The structure of war goal[edit]

  • Type - what is a main target in a war.
  • Factors - 1 is standard value of each factor. 0,5 means half as much, 2 twice as much.
  • Allowed provinces
  • Allowed peace offers
  • Name of war


Documentation EffectsTriggersModifiersScopesVariablesLocalisationCustomizable localization
Scripting AdvisorsAgesBookmarksBuildingsCasus belliColonial regionsCountriesCultureDecisionsDefinesDiplomatic actionsDisastersEstatesEventsFactionsGovernmentGreat projectsHistoryIdea groupsInstitutionsMissionsModifiersNation designerPoliciesReligionRebel typesSubject typesTechnologyTrade companiesTrade goodsUnits
Map MapRandom New WorldTrade nodes
Graphics 3D ModelsInterfaceGraphical AssetsFontsParticlesShadersUnit models
Audio MusicSound
Other Console commandsChecksumJoroDox mod making toolMod structureTroubleshootingThe Validator
Guides Adding a province