Difference between revisions of "Institutions modding"

From Europa Universalis 4 Wiki
Jump to navigation Jump to search
Line 1: Line 1:
{{Version|1.25}}
+
{{Version|1.30}}
[[Institution modding|New Institution Modding page]]
+
 
 +
== Institution file ==
 
<pre>
 
<pre>
<name> = {
+
#
penalty = <float> # factor of technology cost. penalty .5 is 50% maximum penalty
+
# remember to add graphics for relevant ones when you add to this
 +
#
 +
# if a modifier is scaled, its multiplied with development in the province.
  
 +
 +
# any_friendly_coast_border_province is a special scope made for institution spread.
 +
# It checks for adjacent provinces or provinces one seazone away.
 +
# Friendly is defined as at positive relations or owned by the same country that owns the province.
 +
<institution> = {
 +
penalty = <float> #penalty for not having embraced the institution
 
bonus = {
 
bonus = {
  <modifier(s)>
+
<effects>
 
}
 
}
 
 
historical_start_date = <date>
 
historical_start_province = <int>
 
   
 
        history = {
 
            <trigger>
 
        }
 
   
 
 
 
can_start = {
+
historical_start_date = <year.month.day> #Not needed if the institution extist before 1444.11.1
    <trigger> #Determines which province it can spawn in, it does not accept IF blocks or any kind of prioritisation
+
historical_start_province = <province id> #Not needed if the institution extist before 1444.11.1
 +
 +
history = { #Determins which countries have the instution at start
 +
<triggers>
 
}
 
}
start_chance = <int?> #in 100 for when a province can_start
 
 
on_start = <event id>
 
 
 
 +
can_start = { <triggers> }
 +
start_chance = <float> #In 100 for when a province can_start
 +
on_start = <event> #This activates an event when the institution begins
 +
 
can_embrace = {
 
can_embrace = {
            <trigger> #This only affects whether an institution can spread or be developed in a province, it does not affect whether you can click the "embrace institution" button in the technology screen
+
always = <bool>
 
}
 
}
   
+
 
    embracement_speed = {
+
embracement_speed = {
 
modifier = {
 
modifier = {
factor = <float> #how fast is the institution embraced. percent per year?
+
factor = <float>
<condition>
+
scale = <bool>
 +
potential = <trigger>
 +
custom_trigger_tooltip = {
 +
tooltip = <key>
 +
any_friendly_coast_border_province = {
 +
feudalism = <float>
 +
}
 +
}
 +
custom_trigger_tooltip = {
 +
tooltip = <key>
 +
is_owned_by_trade_company = <bool>
 +
<trigger>
 +
}
 
}
 
}
                .....
 
 
 
}
 
}
 
 
ai_will_do = { #Cost of embracing institution must be lower than this factor * last month's regular income, and higher if loans are needed. (Or it has a more than long term goal...)
+
ai_will_do = { #Cost of embracing institution must be < (factor * last month's regular income) & higher if loans are needed.
factor = <int?>
+
factor = <float>
 
 
 
modifier = {
 
modifier = {
 
factor = <float>
 
factor = <float>
<condition>
+
<triggers>
 
}
 
}
                .....
 
 
}
 
}
}</pre>
+
}
 
+
</pre>
Some observations on working with this. History must be set to some trigger that will not be true when the game begins to have the new institution not already be embraced.
 
  
The can_start trigger when satisfied will check the start_chance and if the roll on start chance passes the threshold, the on start event will be fired and the % embraced of the institution will be set to 100% in the province.(unsure if can_embrace is checked in this)
+
== GFX ==
 +
The icons for each institution can be found here:
 +
{{path|gfx/interface/*.dds}}.
 +
'*' represents the name of institution
 +
* Each icon is 48 x 48
 +
The tab icon shown in the institutions page begin with {{path|gfx/interface/institution_tab_*.dds}} and contain a normal and selected icon in the .dds
 +
* The normal icon is 74 x 67
 +
* The selected icon is 74 x 82
  
 
{{Modding navbox}}
 
{{Modding navbox}}
 
[[Category:Modding]]
 
[[Category:Modding]]

Revision as of 18:11, 19 June 2020

Institution file

#
# remember to add graphics for relevant ones when you add to this
#
# if a modifier is scaled, its multiplied with development in the province.


# any_friendly_coast_border_province is a special scope made for institution spread.
# It checks for adjacent provinces or provinces one seazone away.
# Friendly is defined as at positive relations or owned by the same country that owns the province.
<institution> = {
	penalty = <float> #penalty for not having embraced the institution
	bonus = {
		<effects>
	}
	
	historical_start_date = <year.month.day> #Not needed if the institution extist before 1444.11.1
	historical_start_province = <province id> #Not needed if the institution extist before 1444.11.1
	
	history = { #Determins which countries have the instution at start
		<triggers>
	}
	
	can_start = {	<triggers>	}
	start_chance = <float> #In 100 for when a province can_start
	on_start = <event> #This activates an event when the institution begins

	can_embrace = {
		always = <bool>
	}

	embracement_speed = {
		modifier = {
			factor = <float>
			scale = <bool>
			potential = <trigger>
			custom_trigger_tooltip = {
				tooltip = <key>
				any_friendly_coast_border_province = {
					feudalism = <float>
				}
			}
			custom_trigger_tooltip = {
				tooltip = <key>
				is_owned_by_trade_company = <bool>
				<trigger>
			}
		}
	}
	
	ai_will_do = { #Cost of embracing institution must be < (factor * last month's regular income) & higher if loans are needed.
		factor = <float>
		
		modifier = {
			factor = <float>
			<triggers>
		}
	}
}

GFX

The icons for each institution can be found here: /Europa Universalis IV/gfx/interface/*.dds. '*' represents the name of institution

  • Each icon is 48 x 48

The tab icon shown in the institutions page begin with /Europa Universalis IV/gfx/interface/institution_tab_*.dds and contain a normal and selected icon in the .dds

  • The normal icon is 74 x 67
  • The selected icon is 74 x 82
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