Casus belli modding

From Europa Universalis 4 Wiki
Jump to navigation Jump to search

Description[edit]

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

Localisation[edit]

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 AdvisorsAgesBookmarksBuildingsCasus belliColonial regionsCountriesCultureDecisionsDefinesDiplomatic actionsDisastersEstatesEventsFactionsGovernmentGreat projectsHistoryIdea groupsInstitutionsMercenariesMissionsModifiersNation designerPoliciesReligionRebel typesSubject typesTechnologyTrade companiesTrade goodsUnits
Map MapRandom New WorldTrade nodes
Graphics 3D ModelsInterfaceGraphical AssetsFontsParticlesShadersUnit models
Audio MusicSound
Other Console commandsChecksumJoroDox mod making toolMod structureTroubleshootingThe ValidatorRun files
Guides Adding a provinceSave-game editing