• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Mikhail_Mengsk

Major
30 Badges
Nov 10, 2016
627
120
  • Crusader Kings II
  • Europa Universalis IV: Res Publica
  • Magicka
  • Leviathan: Warships
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV
  • Shadowrun: Hong Kong
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Hearts of Iron IV: Cadet
  • Imperator: Rome
  • Hearts of Iron IV: No Step Back
  • Stellaris: Digital Anniversary Edition
  • Tyranny: Archon Edition
  • Stellaris
  • Pillars of Eternity
  • Europa Universalis IV: El Dorado
  • Warlock: Master of the Arcane
  • Victoria 2
  • Europa Universalis III
  • Darkest Hour
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
I have a question. Suppose i have three mods:

Mod A- modifies the line "X" in "00_defines", using a txt named "modA_defines"
Mod B- modifies the line "X and Y" in "00_defines" by modifying a few lines in a duplicate of the original "00_defines"
Mod C- modifies the line "Y" in "00_defines", using a txt named "modC_defines"

What will happen? When i launch the game, what changes will be actually implemented? What overwrites the actual game files?


Sorry for not being very clear. The "real life" scenario is that i have Guilli's Planet Modifiers mod, my own mod and Glavius AI mod, in that order, and some files are modified by two or more mods. Guilli and my mod both modifies the 00_deposits.txt, and my mod and Glavius modifies specialist_job.txt.
 
That depends on what you're trying to override. Some folders are governed by FIOS (first in, only served), others are governed by LIOS (last in, only served).

An explanation about the system and a list of some of the rules for specific folders (that may or may not be up to date) can be found here:
https://stellaris.paradoxwikis.com/Modding#Overwriting_Specific_Elements

The entry about defines is a bit unclear (imho), but they work based on a very simple LIOS-ruleset. In your specific example, the changes made by Mod B would come first, then Mod A would override define X, and then Mod C would override define Y. If mod C also changed define X, it would override Mod A as well.

Not sure what happens when two mods try to override the same file with the same file name like in your second example though. I assume that it's LIOS based on the mod name (because that's how the mods are loaded into the system iirc), but that's pure speculation. Shouldn't be too hard to figure out with some experimentation though
 
Files are loaded in alphabetical (ASCII) order. The mod's name (from the .mod file) is used as a tie breaker for files defined by multiple mods. The vanilla file is only used if no mod defines it. The same relative path is only ever loaded once from the first mod (or vanilla) that defines it.

This means the launcher's order for mods is thus effectively the game's load order as well. This is why you'll see mods with exclamation points (to be loaded first) or tildes (to be loaded last) as the first character in their names. An example of this is Glavius's AI mod, which is prepended with a ~ so that other mods take priority.

So, to answer your specific scenario this is what would happen:
  1. 00_defines will be loaded from mod B. This defines X/Y initially.
  2. modA_defines will be loaded from mod A. This overrides X
  3. modC_defines will be loaded from mod C. This overrides Y
 
Last edited: