Faction modding

From Europa Universalis 4 Wiki
Jump to navigation Jump to search

This article is about creating and editing factions.

Modding Factions[edit]

All vanilla factions are found in /Europa Universalis IV/common/factions/00_factions.txt. You can add to this file or create your own.

Adding a Faction[edit]

To add a new faction, follow this format:

<faction> = {
    monarch_power = <type> # Monarch power consumed when manually raising influence
    
    # Determines faction visibility in interface. always = yes is default.
    <triggers>
    
    # optional, changes the faction's title and description strings when the trigger is met
    triggered_faction_name = {
        name = <new faction name>
        
        trigger = {
            <triggers>
        }
    }
    
    # Modifiers to apply when in power
    modifier = {
        <country modifiers>
    }
}

Using a Faction[edit]

To add a faction to a country, the faction needs to be added to a government type. To do this, add the following line to a government in /Europa Universalis IV/common/governments/00_governments.txt

faction = <faction>

Additionally, you can enable and disable factions in script (i.e. events) using the following effects:

add_faction = <faction>
remove_faction = <faction>

Faction Influence[edit]

The country-scope modifiers for faction influence are created dynamically. They follow this format:

<faction>_influence

For example, to add 0.25 monthly influence to a hypothetical "faction_tigers" faction, one would use the following:

faction_tigers_influence = 0.25

This can be used anywhere you would use a country modifier. You can also find them at common/static_modifiers.

You can use the add_faction_influence effect to add influence immediately.

add_faction_influence = {
    faction = faction_tigers
    influence = 10
}

Localisation[edit]

The following localisation is used when dealing with factions:

 <faction>: "Faction name"
 <faction>_influence: "Faction Influence"
 <faction>_FACTION_desc: "Faction description"

Interface[edit]

Each new faction requires a graphical definition for its icon and background. They follow this format:

spriteTypes = {
    spriteType = {
        name = "GFX_faction_bg_<faction>"	
        texturefile = "gfx//interface//faction_blue_frame.tga"
        transparencecheck = yes
    }
    spriteType = {
        name = "GFX_faction_<faction>"	
        texturefile = "gfx//interface//<faction icon>.dds"
    }
}

You want the icon itself to be between 90 by 90 pixels to 110 by 110 pixels, depending on the style.

You can add a custom modifier icon for the <faction>_influence modifier by placing an icon called <faction>_influence.dds within /Europa Universalis IV/gfx/interface/EU4_ideas/. These do not require an graphical definition.

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