Policy modding

From Europa Universalis 4 Wiki
Jump to navigation Jump to search

A policy must contain the following:

  • A unique name
  • monarch_power
  • Conditions for it to show up (in vanilla they're based on idea groups)
  • Conditions for it to be allowed (in vanilla they're based on full idea groups)
  • Effects

Optionally, you can also include:

  • The AI likelihood of using it

The string monarch_power determines from which monarch point type it takes maintenance. For example, writing “ADM” (without the quotation marks) at the end would make it cost one administrative monarch point per month. The policies are found in /Europa Universalis IV/common/policies.

Adding a policy[edit]

Conditions for the policy to show in-game go under “potential” while conditions for the policy to be available must be listed under “allow.” The effects go directly under the policy, as demonstrated in this example:

custom_policy = {

	monarch_power = ADM

	potential = {
		is_year = 1500
	}
	allow = {
		monthly_income = 100
	}
	inflation_reduction = 0.1
	prestige = 1

	ai_will_do = {
		factor = 1
	}
}

The policy uses administrative points for maintenance, will not show up before year 1500, and requires at least 100 ducats of monthly income before it can be enacted. It gives 10% inflation reduction and 1.00 yearly prestige. The string “ai_will_do” determines the AI chance of enacting the policy. All vanilla policies use factor = 1 as the base.

We can also guide AI in how to use the policy most efficiently by implementing modifiers with their own factors inside ai_will_do. For the final value, all the factors will be multiplied together (so if one 0 modifier is true, the AI will never pick the policy). For example:

custom_policy = {

	monarch_power = ADM

	potential = {
		is_year = 1500
	}
	allow = {
		monthly_income = 100
	}
	inflation_reduction = 0.1
	prestige = 1

	ai_will_do = {
		factor = 1
		modifier = {
			factor = 0
			NOT = { inflation = 5 }
		}
		modifier = {
			factor = 0
			NOT = { gold_income_percentage = 0.15 }
		}
		modifier = {
			factor = 2
			gold_income_percentage = 0.5
		}
		modifier = {
			factor = 2
			inflation = 15
		}
	}
}


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