Age modding

From Europa Universalis 4 Wiki
Jump to navigation Jump to search

Ages are dynamic periods ingame that activate special rules such as Absolutism and permit the spending of Splendor, gained through objectives, on age-specific modifiers.

Ages[edit]

The Ages for the game are defined in /Europa Universalis IV/common/ages/*.txt. You can have as a little as one age, or as many as you can create.

Ages follow this format:

<age> = {
    # The year when the can_start trigger will begin being checked
    start = <year>
    
    # When the Age may begin
    can_start = {
        <triggers>
    }
    
    # Added to enable the Religious Conflict features, i.e. Crusades.
    religious_conflicts = yes
    
    # Added to enable the Absolutism feature.
    absolutism = {
        # Each entry defines the absolutism gain or loss from the action.
		<entries>
	}
    
    # Objectives ...
    objectives = {
        <objective> = {
            # When to show the objective
            allow = {
                <triggers>
            }
            
            # When the objective is met
            <trigger>
        }
    }
    
    # Abilities ...
    abilities = {
        <ability> = {
            # When to show the ability
            allow = {
                <triggers>
            }
            
            # Effect to execute when ability is taken
            effect = {
                <effect>
            }
            
            # Modifier to grant when ability is taken
            modifier = {
                <modifier>
            }
            
            # Rule ability to grant when ability is taken
            rule = {
                <rule>
            }
            
            # How likely the AI is to take this ability
            ai_will_do = {
                factor = <int>
            }
        }
    }
}

Absolutism entries[edit]

The absolutism scope takes specific commands, with the value representing the amount of Absolutism lost or gained when the action is taken.

harsh_treatment
stability = <float>
decrease_autonomy_command = <float>
strengthen_government = <float>
increase_autonomy_command = <float>
debase_currency = <float>
execute_rebel_acceptance_command = <float>
seat_in_parliament = <float>
war_exhaustion = <float>

Abilities[edit]

The following modifiers are unique to Ages, they are used in the rule = { } scope within an ability.

can_transfer_vassal_wargoal = yes
can_chain_claim = yes
can_colony_boost_development = yes
attack_bonus_in_capital_terrain = yes
force_march_free = yes
ignore_coring_distance = yes

Interface[edit]

New ages must be added to ages_view.gui as a new WindowType within the ages_view window.

For example:

WindowType = {
    name = "<age name>"
	# ...
}

Abilites and Objectives[edit]

The icons for abilities and objectives must be defined in a .gfx file. For example:

spriteType = {
    name = "GFX_obj_discover_america"
    texturefile = "gfx/interface/ages/obj_discover_america.dds"
}

spriteType = {
    name = "GFX_ab_allow_feudal_de_jure_law"
    texturefile = "gfx/interface/ages/ab_allow_feudal_de_jure_law.dds"
}

Topbar[edit]

It is important to note that Ages will edit the top-bar background when entering a Golden Age. Without the following spriteTypes, the game will crash when entering a golden age:

GFX_topbar_liberty_overlay_golden
GFX_age_frame_addon_golden
GFX_age_button_golden
GFX_topbar_bg_golden
GFX_topbar_portrait_value_bg_golden
Documentation EffectsTriggersModifiersScopesVariablesLocalisationCustomizable localizationRun files
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 ValidatorRun files
Guides Adding a provinceSave-game editing