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:
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:
or add a textfile to your mod named anything EXCEPT '00_strategic_resources.txt', and add the text:
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.
- 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
- 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.
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: