Mercenaries modding

From Europa Universalis 4 Wiki
Jump to navigation Jump to search

Mercenary companies are defined in text files within the common/mercenary_companies folder. Multiple companies may be defined in a single file. In-game, they will be listed in the reversed order of how they are defined in files.

Definition of a Mercenary Company[edit | edit source]

The following is a brief explanation on each parameter of a mercenary company, using Hungary's Black Army as an example.

merc_black_army = {
    regiments_per_development = 0.04        # Size of the mercenary company based on the recruiting country's development. (always rounds down)
    cost_modifier = 0.75                    # Cost multiplier of the mercenary company. Note that there is a base +50% maintenance cost on mercenaries applied after this multiplier.

    home_province = 153                     # Mercenary company's province of origin. Distance determines recruitment time and range. If unspecified, will be a local company.

    cavalry_weight = 0.2                    # Fraction of the army that is composed of cavalry.
    artillery_weight = 0.4                  # Fraction of the army that is composed of artillery.
    
    cavalry_cap = 4                         # Mercenary company will never have more than this many cavalry.

    sprites = { easterngfx_sprite_pack }    # Unit graphics that the mercenary company uses.

    trigger = {                             # The conditions for the mercenary company to be shown in the mercenary recruitment tab.
        OR = {
            has_country_modifier = hun_black_army
            has_reform = black_army_reform
        }
    }

    modifier = {                            # Modifier that is applied to the regiments of the mercenary company. Note that they receive your nation's army modifiers as well.
        discipline = 0.05
    }
}

Composition of a Mercenary Company[edit | edit source]

Mercenary companies are composed of infantry by default. You can adjust the composition using cavalry_weight and artillery_weight, as well as capping the number of a regiment type using cavalry_cap. When a regiment type has hit its cap, (using the black army as an example) further regiments will be split according to the ratio of infantry and artillery. Therefor, additional regiments will follow the ratio 0.5:0.0:0.5 rather than 0.4:0.2:0.4.

Localisation of Mercenary Companies[edit | edit source]

Names of mercenary companies are localised as such:

l_english:
 merc_black_army: "Black Army"

Relevant to Modding Mercenary Companies[edit | edit source]

Defines[edit | edit source]

The following are all defines that affect mercenary companies:

NDefines.NEconomy.LAND_TECH_MERC_MAINTENANCE_IMPACT = 0.08;                -- How much mercenary maintenance increases per military tech.
NDefines.NMilitary.PARTICIPATION_SCORE_MERC_MULT = 0.50;                   -- How much less war participation you get from fighting using mercenaries.
NDefines.NMilitary.MERCENARY_REINFORCE_COST_MULTIPLIER = -1.0;             -- Modifies the reinforcement cost for mercenaries.
NDefines.NMilitary.MERCENARY_BASE_COST = 10.0;                             -- Increased hiring cost per regiment in the mercenary company.
NDefines.NMilitary.MERCENARY_COMPANY_HIRING_COST_MONTHS = 48;              -- How many months of maintenance you must pay upfront when hiring a company.
NDefines.NMilitary.MERCENARY_COMPANY_STARTING_MORALE = 0.5;                -- How much morale mercenary armies have upon recruitment.
NDefines.NMilitary.MERCENARY_COMPANY_MIN_REGIMENTS = 4;                    -- Minimum size of a mercenary company, regardless of nation's development.
NDefines.NMilitary.MERCENARY_COMPANY_MAX_REGIMENTS = 60;                   -- Maximum size of a mercenary company, regardless of nation's development.
NDefines.NMilitary.MERCENARY_COMPANY_MANPOWER_PER_REGIMENT = 2.0;          -- How much reserve manpower a company has. (multiplied by 1000 per regiment)
NDefines.NMilitary.MERCENARY_COMPANY_MANPOWER_RECOVERY = 120;              -- How many months it takes for a company to fully replenish its manpower from zero.
NDefines.NMilitary.MERCENARY_COMPANY_HIRED_MANPOWER_RECOVERY_MOD = 2.0;    -- Multiplier on how many months to replenish manpower while employed.
NDefines.NMilitary.MERCENARY_COMPANY_LOW_MANPOWER_THRESHOLD = 0.1;         -- At what fraction of reserve manpower the player is shown an alert.
NDefines.NMilitary.MERCENARY_TRADE_RANGE_MODIFIER = 1.0;                   -- What fraction of trade range is used to determine mercenary recruitment range.
NDefines.NMilitary.MERCENARY_COMPANY_BUILDING_TIME = 0.25;                 -- Multiplies by the distance from company's home province in pixels to determine recruitment time in days.
NDefines.NMilitary.MERCENARY_COMPANY_LOCAL_VIRTUAL_DISTANCE = 40;          -- How many "pixels away" local companies pretend to be.
NDefines.NMilitary.MERCENARY_COMPANY_ARMY_TRADITION = 50.0;                -- At what army tradition mercenary leaders are generated at.
Documentation EffectsTriggersModifiersScopesVariablesLocalisationCustomizable localizationRun files
Scripting Scripted functionAdvisorsAgesBookmarksBuildingsCasus belliColonial regionsCountriesCultureDecisionsDefinesDiplomatic actionsDisastersEmpire of ChinaEstatesEventsFactionsGovernmentGreat projectsHistoryHoly Roman EmpireIdea groupsInstitutionsMercenariesMissionsModifiersNation designerOn ActionsParliamentPeace treatiesPoliciesRebel typesReligionSubject typesTechnologyTrade companiesTrade goodsUnits
Map MapNation designerRandom New WorldTrade nodes
Graphics 3D ModelsInterfaceGraphical AssetsFontsParticlesShadersUnit models
Audio MusicSound
Other Console commandsChecksumJoroDox mod making toolMod structureTroubleshootingThe ValidatorRun files
Guides Adding a provinceSave-game editingScripting Tutorial