Stellaris

Stellaris

48 ratings
Mod Compatibility
By Ryuichiro
A quick How-To make your mod as compatible as possible.
I'm sure there are more ways than I cover in the the first iteration of this guide, but I will try and update it with new ways I find out or notice in mods of others.
   
Award
Favorite
Favorited
Unfavorite
Basics
In Stellaris you can't make all mods compatible and their isn't a script-merger that can automate the creation of compatibility mods. BUT you can maximize the compatibility of your mod especially when you add new content.

There are a few basic rules:
  • Possible compatibility between mods heavily depends on their content type.
  • You can make new content completely compatible with nearly all other mods.
  • You can make modified content completely compatible with mods that don't modify the same content.
  • Incompatible mods will not crash the game but may lead to bugs.
  • Interface Mods are ♥♥♥♥♥♥ 99% of the time.

Loading Order:
  • Files will load according to name depending on Ascii value.
  • Whatever is loaded first will be used. (check error log if you want to know what wasn't loaded)
  • Except for files with the same name as vanilla files, which will overwrite these completely.
Events
Adding new events
Incompatible when the same id is used.
  1. Create a new *.txt file inside the events subfolder of your mod and name it something that loads before the vanilla file.
  2. Inside this new file set a namespace for your events which again should be related to your mod.
  3. Below the namespace definition add as many events as you like but make sure the ids and links always start with your namespace.
  4. You can now call the id and set a title/description without having to fear that someone else already uses the link names. Except of course when you have the same namespace.
For example my file could start with something like this:
modexample/events/ME_events.txt
############################ # Mod Example # Written by Ryuichiro ############################ namespace = modexample country_event = { id = modexample.1 title = modexample.1.name desc = modexample.1.desc . . .

Modifying old events
Incompatible when the same id is used.
  1. Create a new *.txt file inside the events subfolder of your mod and name it something that loads before the vanilla file.
  2. Inside this new file set the namespace of the events you want to modify.
  3. Below the namespace definition add the events and modify them as you want with the exception of their id.
For example my file could start with something like this:
modexample/events/ME_events.txt
############################ # Mod Example # Written by Ryuichiro ############################ namespace = crisis # Prethoryn Invasion Begins (HIDDEN) country_event = { id = crisis.10 . . .
Technology
Adding new technologies
Incompatible when the same link is used.
  1. Create a new *.txt file inside the common/technology subfolder of your mod and name it something that loads before the vanilla file.
  2. Inside this new file add as many technologies as you like.
  3. Add an icon file for each technology inside the captech/gfx/interface/icons/technologies subfolder of your mod and name them linkoftech.dds.
For example my file could start with something like this:
modexample/common/technology/ME_tech.txt
############################ # Mod Example # Written by Ryuichiro ############################ modexample_improved_mineral_capacity = { area = engineering cost = 3000 . . .
The icon file would be named captech/gfx/interface/icons/technologies/modexample_improved_mineral_capacity.dds

Modifying old technologies
Incompatible when the same link is used.
  1. Create a new *.txt file inside the common\technology subfolder of your mod and name it something that loads before the vanilla file.
  2. Inside this new file add as many technologies as you like.
For example my file could start with something like this:
modexample/common/technology/ME_tech.txt
############################ # Mod Example # Written by Ryuichiro ############################ tech_repeatable_improved_tile_mineral_output = { area = engineering cost = @repeatableTechBaseCost . . .
Localisation
Adding and Modifying localisation
Incompatible when the same link is used.
  1. Create one new *.yml file per language you want to support inside the localisation subfolder of you mod and name them something that loads before the vanilla file.
  2. Inside this new files define the language that will be inside like l_english: or l_german:
  3. Below the language definition add as many names/descriptions as you like.
For example my files could start with something like this:
modexample/localisation/modexample_l_english.txt
l_english: #################### #Technologies modexample_improved_mineral_capacity: "Mineral Capacity" modexample_improved_mineral_capacity_desc: "We can store more minerals."
modexample/localisation/modexample_l_german.txt
l_german: #################### #Technologies tech_repeatable_improved_mineral_capacity: "Mineralien Kapazität" tech_repeatable_improved_mineral_capacity_desc: "Wir können mehr Mineralien lagern."
Vorwort
In Stellaris ist es nicht möglich alle mods kompatibel zu coden und es existiert kein Script-Merger Tool um automatisch Kompatibilitäts Mods zu generieren. Aber man kann die Kompatibilität seiner Mods maximieren, insbesondere wenn man neuen Content hinzufügt.

Es gibt einige grundregeln:
  • Kompatibilität zwischen Mods hängt in erster Linie davon ab ob der Content neu oder modifiziert ist.
  • Man kann neuen Content mit nahezu allen Mods kompatibel machen.
  • Man kann geänderten Content mit Mods kompatibel machen, die nicht den selben Content ändern.
  • Inkompatible Mods werden das Spiel nicht zum Absturz bringen, können aber für Bugs sorgen.
  • Interface Mods sind in 99% der Fälle inkompatibel.

Reihenfolge beim Laden:
  • Dateien werden geordnet nach Namen geladen basierend auf Ascii.
  • Was zuerst geladen wurde wird genutzt (im error log steht, was nicht geladen wrude)
  • Ausnahmen bilden Dateien mit dem selben Namen wie originale Dateien, welche selbige überschreiben.
10 Comments
Ryuichiro  [author] 18 Jun, 2019 @ 4:12am 
I don't think there is a way to check for other mods when your mod is loaded.
If you just have to write events to handle the other mods behavior, you can write new events that can only be triggered by a specific mod (by putting some of it's content in the trigger) and keep them in the main mod.
But if both mods contain the same file there is no way around a separate compatibility mod, as far as I know.
Dr. Drago 16 Jun, 2019 @ 12:30am 
Do you know how to check if a specific mod is present? And if so enable part of the mod.

Or is it better to do a compability mod that eddits your main mod?
Ryuichiro  [author] 16 Mar, 2018 @ 4:34am 
Also you don't just have to check for files with the same name. Overwriting vanilla files is a horrible practise, which should be avoided by all means. Sadly some can only edited this way.

But the main work would be to compare all files at the same relative path for "objects" with the same name. Objects could be events, components, etc.

You would then need to compare all similar objects to their vanilla version and merge the differences into new files which you then put into a local mod that will load first, so name should be something like 000_mergedMods.
Ryuichiro  [author] 16 Mar, 2018 @ 4:26am 
Creating a script merger for local(self made) mods wouldn't be that hard but workshop mods are saved as *.zip files and messing with that while possible is too much work for me.
This doesn't mean it's a lot of work in general, but I've no experience handling compressed files.
nr 16 Mar, 2018 @ 1:23am 
hello Ryuichiro and thanks for your guide. You start by mentioning there's no script merger for the game and that got me wondering, would it be feasible to build one? I have no experience with modding for stellaris but from what I understand after having taken a quick look incompatibilities mostly happen when two different mods try to override the same file right? If so, that shouldnt be so hard to verify/correct with a program/script (I have some programming knowledge and that does not sound crazy hard).
The only issue I have is that it's quite hard to gather info on this when you really start from nothing. Do you think what I say above makes sense?

Thank you in advance
Ryuichiro  [author] 15 Jun, 2017 @ 8:20am 
If you want to delete one of your mods you can do so on the steam workshop page of that mod.
The Stellaris Launcher don't has that feature.
Lrfss 15 Jun, 2017 @ 6:07am 
How do I delete a mod uploaded into my game mod directory that is no longer valid, not seeing a delete mod key only upload etc? Thanks...
Staticwombat 16 Feb, 2017 @ 1:07pm 
I want a German version of this guide
KaiserKatze 1 Feb, 2017 @ 8:17am 
*upvote* :3
Ryuichiro  [author] 1 Feb, 2017 @ 8:16am 
If you want a german version of this guide let me know.