• 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.

TheGrimSleeper

Sergeant
15 Badges
Jun 7, 2014
85
41
  • Crusader Kings II
  • Stellaris
  • Surviving Mars
  • Surviving Mars: Digital Deluxe Edition
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sons of Abraham
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Horse Lords
  • Magicka 2 - Signup Campaign
  • Magicka 2
  • Magicka 2: Ice, Death and Fury
  • Shadowrun Returns
  • Magicka
So I've started making my first steps into customizing my experience and I've taken note that there are basically 2 ways to change something with the files loaded by the game:
  1. Copy the file that you want to change to your mod, make all your changes in this file and override the whole file at runtime
  2. Make a new empty file, write a refernece to the specific field you want to change and use override at runtime to impliment the change.
So for example, if you don't want the resource 'living metal' to be tradeable in the galactic market, then you can either

Copy the file '<stellaris>/common/strategic_resources/00_strategic_resources.txt' to '<your mod>/strategic_resources/00_strategic_resources.txt', and then edit the text in it so lines 197 & 198 are:
Code:
197    sr_living_metal = {
198        tradable = no

or add a textfile to your mod named anything EXCEPT '00_strategic_resources.txt', and add the text:
Code:
sr_living_metal = {
    tradable = no
}

Each of these methods has its advantages and disadvantages.
The 'Copy-full-file' method is easy to understand; if a mod has a file, something in that file has been changed from the base game. So if you want to make a further change, or change a similar parameter, a quick text comparison will have you on your way.
But if two big mods make changes to the same file, it can be an absolute nightmare to figure out how to make them both function properly, usually requiring a compatibility patch mod. This can even lead to an exponentially growing compatibility mod list.

The 'field-override' method is easy to maintain; so long as the syntax does not change, the mod will work on any version, regardless of what new resources the developers add or remove from the base game.
On the other hand, it will be more difficult to find a subtile conflict between mods; if any mod also makes a reference to that field it will undo the change and one would have to do a very deep text search, or possibly nothing short of fully compling the game to find where that change is.

I've already seen that the game developers use similarly named files in the same folder to add new fields to existing sets, and that some mod makers have adopted that practice.
But there are also many mods that override an entire file for what is sometimes only a few changes. And most mod managers (Irony Mod manager iirc) rely on this to find conflicts and prupose solutions.

So what is the 'correct' and 'best' way to make a mod? And in what scenario would say that that rule can be suspended for the better?

Edit: I've found my way to the Stellaris modding den on discord, and it's blowing my mind right now. I have a lot to learn.
 
Last edited:
If you want to overwrite specific element use FIOS/LIOS overwrite, or use full file overwrite. Don't cut out element from the file because it makes harder for everyone to compare what has changed, and also harder for you to update the mod.

If you want to make sure you override specific mod use descriptor override (rarest use, usually if you are making a patch for a given mod).

If you are not changing most of the file use FIOS/LIOS. if you are overhauling the game like NSC2 or StarNet full file overwrite is preferable (unless you only need to change one piece in a file, then LIOS/FIOS). Full file overwrite allows users to control mod priority by changing load order, when using FIOS/LIOS you are trying to decide what gets loaded. Merger of Rules must use exclusively FIOS/LIOS because *it must* take priority, while mod like Ariphaos Unofficial Patch should be overwrtitten as needed by load order.

Refer to wiki, Overwriting specific elements section: https://stellaris.paradoxwikis.com/Modding#Overwriting_specific_elements

Use WinMerge to compare two folders with same filenames (usually full files overwrite mods like Ariphaos Unofficial Patch and StarNet, or different versions of Stellaris) and use Irony Mod Manager if you want exact definition compare.

Refer to list of resources in modding tutorial, especially CWTools, Irony and of course Stellaris Modding Den Discord (see you there by the way!) https://stellaris.paradoxwikis.com/Modding_tutorial
 
  • 1Like
Reactions: