Advisor modding

From Europa Universalis 4 Wiki
Jump to navigation Jump to search

Quick checklist[edit]

To add a new advisor type to the game:

  • Create a .txt file in the common/advisortypes folder
  • Create an entry for the new advisor type in this file
  • Add name and description to the localisation.
  • Add a male and female icon for the advisor.

Adding an advisor[edit]

To edit existing advisor types, copy the /Europa Universalis IV/common/advisortypes/00_advisortypes.txt file from the vanilla game files into a mod.

To create new advisor types, instead create a new file in the common/advisortypes/ folder of your mod.

An advisor entry look like this:

philosopher = {
	monarch_power = ADM
	
	# Bonus
	prestige = 1

	skill_scaled_modifier = { meritocracy = 0.5 }

        # allow_only_male = yes
        # allow_only_female = yes

	chance = {
		factor = 1
	}
	
	ai_will_do = {
		factor = 1
	}
}

monarch_power determines which power type the advisor grants and which slot they appear in.

Advisors have bonuses by default, and any country-scope modifiers can be used here, although modifiers are not required for the advisor to work.

skill_scaled_modifier scales the modifiers within it to advisor level. This is used for the Meritocracy government legitimacy in the base game, although you can add any country-scope modifiers.

allow_only_male forces an advisor type to only be male.

allow_only_female forces an advisor type to only be female.

Chance[edit]

chance = { } is used to determine if the advisor appears in a country's court. All base advisors have a factor of 1. You can add modifiers to the chance, like so:

chance = {
    factor = 1
    modifier = {
        factor = 0
        tag = FRA
    }
}

This would prevent this advisor from appearing for France. Any country-scope trigger will work.

AI[edit]

ai_will_do = { } controls how likely the AI is to hire an advisor. This is similar to the chance = { } scope.

ai_will_do = {
    factor = 1
    modifier = {
        factor = 0
        tag = FRA
    }
}

This would prevent AI-controlled France from hiring this advisor. Any country-scope trigger will work.

Localisation[edit]

Main article: Localisation

New advisors should have localised names and descriptions. Localisation for advisors should be formatted as follows:

 philosopher:0 "Philosopher"
 philosopher_desc:0 "An advisor dedicated to the study of the fundamental nature of knowledge, reality and existence."


Portraits[edit]

Graphical assets such as advisor portraits must be registered in a .gfx file. To do this, create a .gfx file in your mod, and follow the format below for each new advisor:

spriteType = {
    name = "GFX_advisor_<advisor>"
    texturefile = "gfx//interface//advisors//<advisor_icon_name>.dds"
    noOfFrames = 1
    norefcount = yes
    effectFile = "gfx/FX/buttonstate.lua"
    loadType = "INGAME"
}

You can add graphical culture-specific versions of portraits by prefixing the graphical culture before the advisor part of the name. For example:

spriteType = {
    name = "GFX_advisor_asiangfx_philosopher"
    texturefile = "gfx//interface//advisors//asian_philosopher.dds"
    # ...
}

Additionally, you can create culture group-specific versions by prefixing the culture group before the advisor part of the name. For example:

spriteType = {
    name = "GFX_advisor_iranian_philosopher"
    texturefile = "gfx//interface//advisors//persian_philosopher.dds"
    # ...

All advisors also have female portraits, which are defined like so:

spriteType = {
    name = "GFX_advisor_asiangfx_philosopher_female"
    texturefile = "gfx//interface//advisors//asian_philosopher_female.dds"
    # ...
}

Portrait icons[edit]

The portrait icon assets themselves should be placed in mod_name/gfx/interface/advisors/ for consistency. The icons are 77 by 77 pixels in the .dds format format.

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