Object types that can be replaced in separate files

Object types that can be replaced in separate files

  • Crusader Kings III Available Now!

    The realm rejoices as Paradox Interactive announces the launch of Crusader Kings III, the latest entry in the publisher’s grand strategy role-playing game franchise. Advisors may now jockey for positions of influence and adversaries should save their schemes for another day, because on this day Crusader Kings III can be purchased on Steam, the Paradox Store, and other major online retailers.


    Real Strategy Requires Cunning

Seomis

Major
45 Badges
Jun 27, 2016
562
418
  • Crusader Kings II: Charlemagne
  • Cities: Skylines - After Dark
  • Stellaris - Path to Destruction bundle
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Crusader Kings II
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV: Art of War
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Prison Architect
  • Hearts of Iron IV: Together for Victory
  • Cities: Skylines - Mass Transit
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Stellaris: Megacorp
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Stellaris: Galaxy Edition
  • Cities: Skylines - Snowfall
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Pre-order
  • Cities: Skylines
  • Victoria 2
  • Stellaris
  • Age of Wonders III
Often, creating an identically named object (technology, trait, etc.) in a separate file will duplicate that object instead of replacing it. Because of this, a modder who wants to change an object from the vanilla game normally has to overwrite an entire core file: This is the main source of conflicts between mods. But (!), there are a handful of object types that will be replaced instead of duplicated:
  • Game rules: Place a modified game rule from common/game_rules/00_rules.txt in a new file that comes after asciibetically.

  • Policies: Place a modified policy from common/policies/00_policies.txt in a new file that comes after asciibetically.

  • Scripted triggers: Place a modified trigger from common/scripted_triggers/00_scripted_triggers.txt in a new file that comes after asciibetically.

  • Species rights: Place a modified species right from common/species_rights/species_rights.txt in a new file that comes after asciibetically.

  • Localisation strings: Create a new folder, common/localisation/replace, and put any modified core localized string in <new_file>_l_<language>.yml.
  • Defines: Definitions in common/defines/00_defines.txt can be overwritten individually in a separate file by including only those entries you wish to change, along with the named block they reside in. E.g., NGameplay = { PRESCRIPTED_PLANETS_NUM = 0 }
  • Buildings are overwritten and not duplicated ... kind of. If a building is redefined in a file that loads after the core file, the second definition will--in most contexts--be the only definition of that building. You will, however, see multiple instances of the same building show up in upgrade options. It is therefore best to avoid doing this except for buildings that are not part of an upgrade chain.
  • Events: Strictly speaking, an event can't be overwritten. What can be done instead is putting a modified vanilla event (same id) in a new file that will be read before the core file. This will cause the game to accept the mod's event and reject the core one, with a warning sent to the error log.
  • Static modifiers: Place a changed static modifier from any of the core files in common/static_modifiers in a new file that comes before asciibetically. This works similarly to events but with the added perk of no warnings getting sent to the error log.
Object types that definitely get duplicated include:
  • Component templates
  • Edicts
  • Ethics
  • Ship sizes
  • Technologies
  • Traits
  • War Demands: On first impression this one appears to be overwritable. Only one instance of a demand will appear when declaring war and while a war is in progress. However, once a war is concluded, a demand's effect is run once for every instance of the demand.

If you come across other replaceable object types or see an error above, post here and I'll update the list.
 
Last edited:
  • 6
Reactions:

Overlord123

Colonel
97 Badges
Aug 14, 2007
997
107
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Pre-order
  • Cities: Skylines - Snowfall
  • Knights of Honor
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Stellaris Sign-up
  • Hearts of Iron IV Sign-up
  • Stellaris: Galaxy Edition
  • Crusader Kings III
  • Age of Wonders: Planetfall Deluxe edition
  • Age of Wonders: Planetfall
  • Imperator: Rome Deluxe Edition
  • Shadowrun Returns
  • Stellaris: Distant Stars
  • Cities: Skylines - Parklife
  • Cities: Skylines - Parklife Pre-Order
  • Age of Wonders III
  • Crusader Kings Complete
  • Crusader Kings II: Way of Life
  • Mount & Blade: Warband
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • 500k Club
  • Victoria 2
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris - Path to Destruction bundle
  • Rome Gold
  • Europa Universalis IV: Call to arms event
  • Stellaris: Distant Stars Pre-Order
  • Imperator: Rome
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Knight (pre-order)
  • Cities: Skylines Deluxe Edition
  • Hearts of Iron III
  • Sword of the Stars II
  • Sword of the Stars
  • Supreme Ruler: Cold War
  • Cities in Motion
  • Impire
Must localisation files end with .txt or .yml? Normally they should be yml but you wrote txt, is that an error on your part?
 

dskod1

Field Marshal
Demi Moderator
129 Badges
Apr 14, 2009
3.279
1.083
  • Europa Universalis IV: Common Sense
  • Imperator: Rome Sign Up
  • Warlock: Master of the Arcane
  • 500k Club
  • VtM - Bloodlines 2 Blood Moon Edition
  • Europa Universalis IV: Mandate of Heaven
  • Cities: Skylines - Green Cities
  • Europa Universalis IV: El Dorado
  • Hearts of Iron: The Card Game
  • Pride of Nations
  • Mount & Blade: Warband
  • Mount & Blade: With Fire and Sword
  • Crusader Kings II: Way of Life
  • Age of Wonders: Planetfall
  • Crusader Kings II: Horse Lords
  • Stellaris: Humanoids Species Pack
  • Tyranny - Bastards Wound
  • Crusader Kings II: Conclave
  • Cities: Skylines - Mass Transit
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Dharma
  • Stellaris: Galaxy Edition
  • Cities: Skylines - Parklife Pre-Order
  • BATTLETECH - Digital Deluxe Edition
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings II: Reapers Due
  • Cities: Skylines - Parklife
  • Crusader Kings II
  • Surviving Mars
  • Steel Division: Normandy 44
  • Europa Universalis IV: Golden Century
  • Surviving Mars: First Colony Edition
  • Crusader Kings II: Monks and Mystics
  • Stellaris: Apocalypse
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Distant Stars
  • Prison Architect
  • Imperator: Rome Deluxe Edition
  • Cities: Skylines - Natural Disasters
  • BATTLETECH
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis III Complete
  • Prison Architect: Psych Ward
  • Steel Division: Normand 44 Sign-up
  • Stellaris: Leviathans Story Pack
  • Europa Universalis III Complete
  • Crusader Kings II: Holy Fury
  • Shadowrun Returns
Also, you can do the same thing with the defines file.

For example by using the following code:
Code:
NDefines.NGraphics.RANDOM_HEIGHT_MIN = 0
NDefines.NGraphics.RANDOM_HEIGHT_MAX = 0
I can just replace 2 lines of code (in a new defines file) rather than overwrite the entire file just to change those two lines.
 
  • 1
Reactions:

Seomis

Major
45 Badges
Jun 27, 2016
562
418
  • Crusader Kings II: Charlemagne
  • Cities: Skylines - After Dark
  • Stellaris - Path to Destruction bundle
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Crusader Kings II
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV: Art of War
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Prison Architect
  • Hearts of Iron IV: Together for Victory
  • Cities: Skylines - Mass Transit
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Stellaris: Megacorp
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Stellaris: Galaxy Edition
  • Cities: Skylines - Snowfall
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Pre-order
  • Cities: Skylines
  • Victoria 2
  • Stellaris
  • Age of Wonders III
Also, you can do the same thing with the defines file.

For example by using the following code:
Code:
NDefines.NGraphics.RANDOM_HEIGHT_MIN = 0
NDefines.NGraphics.RANDOM_HEIGHT_MAX = 0
I can just replace 2 lines of code (in a new defines file) rather than overwrite the entire file just to change those two lines.
Ah, right! Added.
 

UberWaffe

Second Lieutenant
21 Badges
May 23, 2016
185
73
  • Magicka
  • Cities in Motion 2
  • Cities: Skylines Deluxe Edition
  • Age of Wonders: Planetfall
  • Stellaris: Ancient Relics
  • Surviving Mars: First Colony Edition
  • Prison Architect
  • Surviving Mars: First Colony Edition
  • Stellaris: Distant Stars
  • Stellaris: Apocalypse
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Synthetic Dawn
  • Surviving Mars
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Cadet
  • Stellaris
  • Pillars of Eternity
  • Cities: Skylines
  • Teleglitch: Die More Edition
  • Stellaris - Path to Destruction bundle
  • Stellaris: Megacorp
There's output to the error log when this is tried. Is there no other negative consequence?
Not as far as I know.
(Note: I know that both "Harder Invaders" and "Ethics and Governments Rebuild" mods use this approach, and with both of those mods it appears to work fine. I have not had issues with them.)
 

Seomis

Major
45 Badges
Jun 27, 2016
562
418
  • Crusader Kings II: Charlemagne
  • Cities: Skylines - After Dark
  • Stellaris - Path to Destruction bundle
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Crusader Kings II
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV: Art of War
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Prison Architect
  • Hearts of Iron IV: Together for Victory
  • Cities: Skylines - Mass Transit
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Stellaris: Megacorp
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Stellaris: Galaxy Edition
  • Cities: Skylines - Snowfall
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Pre-order
  • Cities: Skylines
  • Victoria 2
  • Stellaris
  • Age of Wonders III
Post updated; just successfully tested overwriting a policy in a separate file.
 

Seomis

Major
45 Badges
Jun 27, 2016
562
418
  • Crusader Kings II: Charlemagne
  • Cities: Skylines - After Dark
  • Stellaris - Path to Destruction bundle
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Crusader Kings II
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV: Art of War
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Prison Architect
  • Hearts of Iron IV: Together for Victory
  • Cities: Skylines - Mass Transit
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Stellaris: Megacorp
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Stellaris: Galaxy Edition
  • Cities: Skylines - Snowfall
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Pre-order
  • Cities: Skylines
  • Victoria 2
  • Stellaris
  • Age of Wonders III
Thanks! I'll update this later today. Incidentally, I did test putting a slightly modified copy of an ethic in a separate file, and on initial impression it appeared to overwrite instead of duplicate. I need to do a more thorough lookover, but it's promising!
 
Last edited:

Mitchz95

Field Marshal
14 Badges
Feb 4, 2016
3.238
1.820
  • Stellaris: Synthetic Dawn
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Major Wiki Contributor
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
Looks like civics can be overridden individually as well, as long as it's in a new file whose name comes after 00_civics (such as 01_civics).

EDIT: Actually, it might just duplicate them. Lemme test some more...

EDIT2: Okay, it seems to work fine as far as I can tell. Only oddity is that the requirements are listed twice:
 
Last edited:

MaxRavenclaw

Corporal
20 Badges
Jun 27, 2016
27
3
  • King Arthur II
  • Leviathan: Warships
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Expansion Pass
  • Shadowrun Returns
  • Stellaris: Apocalypse
  • Hearts of Iron IV: Expansion Pass
  • Age of Wonders III
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris - Path to Destruction bundle
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Cadet
  • Stellaris
  • Magicka: Wizard Wars Founder Wizard
  • Warlock: Master of the Arcane
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sons of Abraham
  • Stellaris: Synthetic Dawn
About buildings showing up twice if they're part of an upgrade chain. I've actually found one mod that doesn't have that issue, for some reason: This one. I'm not sure how the author did it, but despite having modified the level V power plant, when upgrading from IV to V, I don't get the duplicates.
 

Seomis

Major
45 Badges
Jun 27, 2016
562
418
  • Crusader Kings II: Charlemagne
  • Cities: Skylines - After Dark
  • Stellaris - Path to Destruction bundle
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Crusader Kings II
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV: Art of War
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Prison Architect
  • Hearts of Iron IV: Together for Victory
  • Cities: Skylines - Mass Transit
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Stellaris: Megacorp
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Stellaris: Galaxy Edition
  • Cities: Skylines - Snowfall
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Pre-order
  • Cities: Skylines
  • Victoria 2
  • Stellaris
  • Age of Wonders III
About buildings showing up twice if they're part of an upgrade chain. I've actually found one mod that doesn't have that issue, for some reason: This one. I'm not sure how the author did it, but despite having modified the level V power plant, when upgrading from IV to V, I don't get the duplicates.
Check for the duplicate upgrade on a capital planet. The original level 5 upgrade option may not appear on regular planets because it's normally capital only.
 

Mitchz95

Field Marshal
14 Badges
Feb 4, 2016
3.238
1.820
  • Stellaris: Synthetic Dawn
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Major Wiki Contributor
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
Planet entities (in gfx/models/planets) can apparently be overridden individually as well. Works for me, at least.

My file is called "custom_entities", which I guess comes after vanilla "_planetary_entities".