Casus belli modding

From Europa Universalis 4 Wiki
Jump to navigation Jump to search

Description[edit | edit source]

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 | edit source]

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 Triggers. 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 | edit source]

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 | edit source]

  • 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_provinces_are_eligible = yes (optional): whether or not you can take provinces outside of the allowed ones
  • Allowed peace offers
  • Name of war

Localisation[edit | edit source]

The values you need to localise are the following:

  • cb_restore_personal_union
  • cb_restore_personal_union_desc

If you have chosen to create a new war goal, then the following lines need to be localised:

  • take_capital_personal_union
  • take_capital_personal_union_desc
  • UNION_WAR_NAME

What do these values change?

  • The first two will show up when declaring the war.
  • The next two will show up when hovering over the war goal in the war screen.
  • The last one will be the war name. For example, "English-French Colonial War"

Of course these values will change to fit your needs.

Documentation EffectsTriggersModifiersScopesVariablesLocalisationCustomizable localizationRun files
Scripting Scripted functionAdvisorsAgesBookmarksBuildingsCasus belliColonial regionsCountriesCultureDecisionsDefinesDiplomatic actionsDisastersEmpire of ChinaEstatesEventsFactionsGovernmentGreat projectsHistoryHoly Roman EmpireIdea groupsInstitutionsMercenariesMissionsModifiersNation designerOn ActionsParliamentPeace treatiesPoliciesRebel typesReligionSubject typesTechnologyTrade companiesTrade goodsUnits
Map MapNation designerRandom New WorldTrade nodes
Graphics 3D ModelsInterfaceGraphical AssetsFontsParticlesShadersUnit models
Audio MusicSound
Other Console commandsChecksumJoroDox mod making toolMod structureTroubleshootingThe ValidatorRun files
Guides Adding a provinceSave-game editingScripting Tutorial