Event trigger.png We are conducting a survey to learn how we can improve the Paradox Wikis experience for our users. Please take the time to fill the Survey Event trigger.png

Estate modding

From Europa Universalis 4 Wiki
Jump to navigation Jump to search

Estates are factions within the nation that influence domestic politics.

Estates[edit]

Estates are found in /Europa Universalis IV/common/estates/*.txt. An estate follows this general format:

<estate> = {
	icon = <index>
	color = { <rgb> }   # What color the estate appears as in the estate mapmode
	
	# If true, country will get estate
	trigger = {
		<triggers>
	}

	# These scale with loyalty & power
	country_modifier_happy = {
		<modifiers>
	}
	country_modifier_neutral = {
		<modifiers>
	}	
	country_modifier_angry = {
		<modifiers>
	}

	land_ownership_modifier = {
		<modifiers>
	}

	province_independence_weight = {
		factor = <float>
		modifier = {
			factor = <float>
			#Insert conditions here
		}
	}

	# Influence modifiers
	base_influence = <float>
	influence_modifier = {
		desc = <key> # The new name to apply
		trigger = {
			<triggers>
		}	
		influence = <float>
	}
	# Loyalty modifiers
	loyalty_modifier = {
		desc = <key> # The new name to apply
		trigger = {
			<triggers>
		}
		loyalty = <float>
	}
	
	custom_name = {
		desc = <key> # The new name to apply
		trigger = {
			OR = {
			
			}
		}
	}
	contributes_to_curia_treasury = <bool> #yes/no

	privileges = {
                #'privileges' includes the names of the estate privileges this estate uses.
                #Estate privileges can be found in the {{path|common/estates_privileges/00_privileges.txt}}
	}

	agendas = {
                #'agendas' includes the names of the estate privileges this estate uses.
                #Estate agendas can be found in the {{path|common/estates_agendas/*.txt}}
	}
	influence_from_dev_modifier = <float>	#Determines percent influence from development
}

Country modifiers for an estate will scale with the estate loyalty and influence.

Estate Privileges[edit]

/Europa Universalis IV/common/estate_privileges

#All scopes are country scope
#All parameters are optional
<estate_privilege> = {
        icon = <index>
        max_absolutism = <float>        #Change in max absolutism while this privilege is enacted
        loyalty = <float>               #Change in percent loyalty caused by this privilege
        influence  = <float>            #Change in percent influence caused by this privilege
 	is_valid = { <triggers> }	#Conditions for whether it is possible for the country to have this privilege
 	can_select = { <triggers> } 	#Conditions for whether the country is allowed to select the privilege
 	on_granted = { <effects> } 	#Effects executed immediately upon the privilege being taken
 	can_revoke = { <triggers> } 	#Conditions for whether the country can revoke the privilege
 	on_revoked = { <effects> } 	#Effects executed upon the privilege being revoked by the country
 	on_invalid = { <effects> } 	#Effects executed upon the privilege being removed due to invalidity
 	penalties = { <modifiers> } 		#Negative modifiers granted while the privilege is active
        benefits = { <modifiers> }              #Positive modifiers granted while the privilege is active
	conditional_modifier = { 			#Modifier that are applied if the specified conditions are true.
 		trigger = { <triggers> }
 		modifier = { <modifiers> }
 		is_bad = <bool>				#yes/no. Whether the modifier should be listed as positive or negative in the tooltips.
 	}
 	modifier_by_land_ownership = { <modifiers> } 	#Multiplies the modifier by the % of land owned by the estate.
 	mechanics = { <mechanics> } 			#Special mechanics the privilege enables
 	cooldown_years = <int> 				#Time limit before which the privilege cannot be revoked
 	on_cooldown_expires = { effects }		#Effect executed once the specified cooldown_years timer has run down
	ai_will_do = {					#If above ESTATE_PRIVILEGE_GRANT_THRESHOLD define, AI will try to apply. If below 
                factor = <float>                                #ESTATE_PRIVILEGE_REVOKE_THRESHOLD, AI will try to revoke.
                modifier = {
                        factor = <float>
                        <triggers>
                }
        }
}

It is important to note the addition of 'benefits = { <modifiers> }', which is not included in /Europa Universalis IV/common/estate_privileges/xx_example.txt

Estate Agendas[edit]

This is taken from /Europa Universalis IV/common/estate_agendas/xx_example.txt

#(Nearly) all scopes are country scope
#All parameters are optional (but it will not be much of an agenda without some of them...)

<estate_agenda> = {
 	max_days_active = <float> 		#Lets you override the default of 20 years for an agenda
 	can_select = { triggers } 		#Conditions for whether the agenda can be offered to you
 	provinces_to_highlight = { triggers }	#Conditions for provinces to be highlighted by the agenda. Root = country, this = province.
 	selection_weight = {			#Determines how likely (compared to the estate's other agendas) this agenda is to be selected.
 		factor = <float>		#initial factor will ignore numbers below 1, use a modifier for that!
 		modifier = { factor = <float> triggers = <triggers> }
 	}
 	pre_effect = { effects }		#Effects executed to set up the task (set flags and targets), before it is shown to the player.
 	immediate_effect = { effects } 		#Effects executed when the agenda is accepted by the country
 	task_requirements = { triggers } 	#Conditions for completing the task successfully
 	task_completed_effect = { effects } 	#Effects executed when the agenda is successfully completed
 	failing_effect = { effects } 		#Effects executed when the agenda is failed (i.e. when fail_if is true or time runs out)
 	fail_if = { triggers } 			#Conditions for when the agenda should be auto-failed
 	on_invalid = { effects } 		#Effects executed when the country no longer has that estate or the invalid_trigger is true.
                                                #Useful for clearing flags, modifiers etc.
 	invalid_trigger = { triggers } 		#Conditions for when the agenda should end without it counting as a fail (executing on_invalid 				 
                                                #rather than failing_effect). Happens by default it the estate giving the agenda is removed.
 	modifier = { modifier } 		#Country modifier granted while the agenda is active
}

Estate Preload[edit]

#Define estate loyalty and influence modifiers here

<estate> = {
	modifier_definition = {
		type = #Either loyalty or influence
		key = <key> #This is what will be referenced in other files
		trigger = {
			<trigger>
		}
	}
}

Estate Crown Land[edit]

/Europa Universalis IV/common/estate_crown_land Bonuses:

<bonus> = {
    key = <key>
    range_from = <float>
    range_to = <float>
    modifier = {
        <modifiers>
    }
}

Interactions:

<interaction> = {
    key = <key>
    random_seed = random_seed 
    cooldown_months = <float>

    trigger = {
		<triggers>
    }
    effect = {
		<effect>
    }
    ai_will_do = {
		factor = <float>
		modifier = {
			factor = <float>
			<triggers>
		}
    }
}

Interface[edit]

For estate pictures to work you have to go into interface/countryestatesview.gfx and edit the noOfFrames at GFX_estates_icons and GFX_estate_interactions to match your amount The icons used for the estates themselves are defined via GFX_estates_icons:

spriteType = {
    name = "GFX_estates_icons"
    texturefile = "gfx//interface//estates//estates_icons.dds"
    noOfFrames = 6
    loadType = "INGAME"
}

All privilege icons have to be defined in this format spriteType = { name = "<key>" texturefile = "gfx/interface/privileges/*.dds" }

GFX[edit]

Estate icons are found in /Europa Universalis IV/gfx/interface/estates_icons.txt

  • Each icon is 44 x 44 pixels

Privilege icons are found in /Europa Universalis IV/gfx/interface/privileges/privilege_*.dds

Localisation[edit]

Typically an estate will need the following localisation keys defined:

<estate>: "Name"
<estate>_desc: "Description"
<privilege>: "Name"
<privilege_desc>: "Description"
<agenda>: "Name"
<agenda_desc>: "Description"

Influence and loyalty modifiers use this: §Y$VAL$%§! within their tooltips to display the amount of influence or loyalty they change.

An estate can be referred to in localisation with: $<estate>$, which will display the current name of the estate, adapting to any custom name entries for the estate. Requires the localisation scope to support dynamic localisation however (i.e. won't work in interaction titles).

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