History modding

From Europa Universalis 4 Wiki
Jump to navigation Jump to search

History is used in Europa Universalis IV to compose much of the world during specific dates.

Country[edit]

Countries are found in /Europa Universalis IV/history/countries/*.txt. These files control the gameplay parameters that make up a country.

Each country has it's own file, following the naming conversion of: <tag> - <name>.

Here is a general format of a country:

technology_group = <group>      # The technology group of the country. Will set the unit type to this technology group as well.
unit_type = <group>             # Used if you want a different unit group from the defined technology group

government = <government>       # The government form of the country
government_rank = <rank>        # Current government rank: 1, 2 or 3

primary_culture = <culture>     # The primary culture of the country
religion = <religion>           # The religion of the country

add_accepted_culture = <culture>    # Add an accepted culture
remove_accepted_culture = <culture> # Remove an accepted culture

historical_friend = <tag>        # Adds a historical friend
historical_rival = <tag>        # Adds a historical rival

mercantilism = <int>            # Starting mercantilism value
religious_school = <school>     # For countries that have a religion that use Religious Schools, assigns initial school

add_army_professionalism = <value> # Army professionalism to start with

capital = <id>                  # The province that is the default capital
fixed_capital = <id>            # Forces the AI to never move their capital from the specified id, they will seek to move it back there as well if moved.

# Defines a ruler for the country. Normally used within a history entry
monarch = {
    name = <string>             # Name of the ruler
    dynasty = <string>          # Dynasty of the ruler
    adm = <int>                 # ADM skill of the ruler
    dip = <int>                 # DIP skill of the ruler
    mil = <int>                 # MIL skill of the ruler
    birth_date = <date>         # Used to set the age of the ruler. Derived from the date of the history entry the monarch scope is found in.
    female = yes                # Whether the ruler is female
    regent = yes                # Whether the ruler is considered a regency
    religion = <religion>       # The religion of the ruler
    culture = <culture>         # The culture of the ruler
    
    # Makes the defined ruler a leader
    leader = {
        name = <string>     # Name of the leader
        type = <type>       # Type of leader: general, admiral, explorer, conquistidor
        fire = <int>        # Fire value of the leader
        shock = <int>       # Shock value of the leader
        manuever = <int>    # Manuever value of the leader
        siege = <int>       # Siege value of the leader
    }
}

# Defines a heir for the country. Normally used within a history entry
heir = {
    name = <string>             # Name of heir
    monarch_name = <string>     # Name of heir if they become a ruler
    dynasty = <string>          # Dynasty of heir
    birth_date = <date>         # Used to set the age of the heir. Derived from the date of the history entry the monarch scope is found in.
    death_date = <date>         # When the heir should be removed. 
    claim = <int>               # Strength of claim for heir
    adm = <int>                 # ADM skill of the heir
    dip = <int>                 # DIP skill of the heir
    mil = <int>                 # MIL skill of the heir
    female = yes                # Whether the heir is female
    religion = <religion>       # The religion of the heir
    culture = <culture>         # The culture of the heir
}

# Defines a consort for the country. Normally used within a history entry
queen = {
    name = <string>             # Name of consort
    dynasty = <string>          # Dynasty of consort
    birth_date = <date>         # Used to set the age of the consort. Derived from the date of the history entry the monarch scope is found in.
    death_date = <date>         # When the consort should be removed. 
    adm = <int>                 # ADM skill of the consort
    dip = <int>                 # DIP skill of the consort
    mil = <int>                 # MIL skill of the consort
    female = yes                # Whether the consort is female
    country_of_origin = <tag>   # Which country the consort is from
    religion = <religion>       # The religion of the consort
    culture = <culture>         # The culture of the consort
}

# History entry, can contain any of the values above as well as normal country effects
<year>.<month>.<day> = {
    <country effects>
}

Province[edit]

Provinces are found in /Europa Universalis IV/history/provinces/*.txt. These files control the gameplay parameters that make up a province.

Each province has it's own file, following the naming conversion of: <id> - <name>.

Here is a general format of a province:

owner = <tag>           # Who is the current owner of the province
controller = <tag>      # Who is the current controller of the province
add_core = <tag>        # Adds a core for the specified tag
is_city = yes / no      # Whether this province is a proper city, i.e. not a colony. 

culture = <culture>     # The culture of the province
religion = <culture>    # The religion of the province

base_tax = <int>        # The base tax of the province
base_production = <int> # The base production of the province
base_manpower = <int>   # The base manpower of the province

trade_goods = <goods>   # The tradegood assigned to this province, from 00_tradegoods.txt
estate = <estate>       # Adds this estate to the province
hre = yes / no          # Whether this province is in the HRE or not
capital = "<string>"    # The capital name to use for the province, otherwise the province name is used as the capital name.

discovered_by = <technology group>  # Grants the specified technology group vision of this province
reformation_center = <religion>     # Sets this province as a reformation center for the specified religion
unrest = <int>                      # Adds base unrest
<building> = yes / no               # Adds or removes the specified building

# Adds a revolt
revolt = {
    type = <rebel type>
    size = <int>
    leader = <string>
}

# History entry, can contain any of the values above as well as normal province effects
<year>.<month>.<day> = {
    <province effects>
}

Diplomacy[edit]

Diplomacy is found in /Europa Universalis IV/history/diplomacy/*.txt. These files are used to define diplomatic relationships, such as subjects.

Holy Roman Emperor[edit]

Sets the current Holy Roman Emperor

<year>.<month>.<day> = {
    emperor = <tag>
}

Celestial Emperor[edit]

Sets the current Celestial Emperor

<year>.<month>.<day> = {
    celestial_emperor = <tag>
}

Relations[edit]

All relations follow this format:

<type> = {
    first = <tag>       # The overlord, if the relation is a overlord-subject relation
    second = <tag>      # The subject, if the relation is a overlord-subject relation
    start_date = <date> # When to start applying the relationship
    end_date = <date>   # When to stop applying the relationship
}

These are the following valid relations:

  • alliance
  • royal_marriage
  • guarantee
  • warning
  • vassal
  • march
  • union

Dependency[edit]

For custom subject types, you can use the dependency effect, which allows to to specify subject_type:

dependency = {
    subject_type = "<subject type>"
    first = <tag>       # The overlord, if the relation is a overlord-subject relation
    second = <tag>      # The subject, if the relation is a overlord-subject relation
    start_date = <date> # When to start applying the relationship
    end_date = <date>   # When to stop applying the relationship
}

Used for tributaries normally.

Wars[edit]

Wars are found in /Europa Universalis IV/history/wars/*.txt. These files are used to define on-going wars, or recently finished wars (to create truces).

Each war must be within it's own file.

A war follows this format:

name = "<string>"           # Name of the war in the war screen
war_goal = {
    type = <wargoal>        # The wargoal to use from 00_wargoals.txt
    casus_belli = <cb>      # The cb to use from 00_cb_types.txt
}

# Used to start the war at the specified date
<year>.<month>.<day> = {
    add_attacker = <tag>    # Adds a country to the attackers side
    add_defender = <tag>    # Adds a country to the defenders side
}

# Used to add ongoing battles 
<year>.<month>.<day> = {
    batle = { 
        name = "<string>"   # Name of province
        location = <id>     # Province the battle is in
        
        attacker = {
            commander = "<string>"  # Leader of the attacker's army
            infantry = <int>        # Number of infantry. 1 equals 1 soldier
            cavalry = <int>         # Number of cavalry
            artillery = <int>       # Number of artillery
            losses = <float>        # How many of the forces are already dead
            country = <tag>         # The country that is attacking
        }
        
        defender = {
            commander = "<string>"  # Leader of the defender's army
            infantry = <int>        # Number of infantry. 1 equals 1 soldier
            cavalry = <int>         # Number of cavalry
            artillery = <int>       # Number of artillery
            losses = <float>        # How many of the forces are already dead
            country = <tag>         # The country that is defending
        }
        
        result = yes    # Show result
    }
}

# Used to end the war at the specified date
<year>.<month>.<day> = {
    rem_attacker = <tag>    # Removes a country to the attackers side
    rem_defender = <tag>    # Removes a country to the defenders side
}

Advisors[edit]

Historical advisors are found in /Europa Universalis IV/history/advisors/*.txt. Historical advisors are predefined advisors that are linked to specific provinces within a date range.

A historical advisor follows this format:

advisor = {
    advisor_id = <id>           # The advisor's unique id
    name = <string>             # The advisor's full name
    location = <province id>    # The province that the advisor is linked to.
    skill = <int>               # The skill of the advisor
    type = <advisortype>        # The type of advisor
    discount = yes              # Whether to apply SCRIPTED_ADVISOR_DISCOUNT defined value to the advisor's monthly cost
    date = <year>.<month>.<day>         # When this advisor starts appearing
    death_date = <year>.<month>.<day>   # When this advisor stops appearing
    culture = <culture>         # The advisor's culture
    religion = <religion>       # The advisor's religion
}

Historical advisors are added to the advisor pool in addition to the regularly generated advisors.

Troubleshooting[edit]

Often issues within history can cause difficult to diagnose crashes. For example, a bad province id in the capital = line within a country's history file will cause a crash.

Therefore, ensure when editing history files all the references you use (i.e. province ids) are valid.

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