Difference between revisions of "Modding"

From Stellaris Wiki
Jump to navigation Jump to search
(formatting)
m (Adding a thumbnail: t)
(87 intermediate revisions by 34 users not shown)
Line 1: Line 1:
{{Template:ModdingNavbox}}
+
{{version|2.5}}
{{version|Timeless}}
 
  
 
'''Modding''', or creating [[mods]], is the act of modifying the behavior of the base game (often referred to as ''vanilla''), either for personal use, or to release publicly to other players, for instance via the [[Steam Workshop]].
 
'''Modding''', or creating [[mods]], is the act of modifying the behavior of the base game (often referred to as ''vanilla''), either for personal use, or to release publicly to other players, for instance via the [[Steam Workshop]].
  
As for all Paradox games, [[Stellaris]] is moddable to a great extent. Motivations of modders may vary widely; better translation to native language, more events or decisions, better map, major overhaul, etc.
+
As with all Paradox games, [[Stellaris]] is moddable to a great extent. Motivations of modders may vary widely; better translation to native language, more events or decisions, better map, major overhaul, shameless cheating, etc.
  
 
This guide is intended to lower the entry barriers to the world of Stellaris modding. However, there is still a learning curve to it, and it cannot replace the need to read some working vanilla code, and do lots of trial and error experimentation!
 
This guide is intended to lower the entry barriers to the world of Stellaris modding. However, there is still a learning curve to it, and it cannot replace the need to read some working vanilla code, and do lots of trial and error experimentation!
  
==Step by Step Guide==
+
<div style="float: right;" class="mw-collapsible">{{ModdingNavbox}}</div>
 +
__TOC__
  
Mod creation on Windows:
+
== Guidelines ==
* Start the game
 
* In the launcher, go to the Mod Tab.
 
* click on "Mod tools".
 
* click on "Create Mod"
 
* select a name, a foldername and at least one Tag for the mod. This will create the empty mod file and folder
 
* close the Game/Launcher. It will only detect mods during startup. The actual parsing of the code can happen at a later time.
 
* Find the ([[#Mod_structure|mod location]]). You will find one pre-created .mod file and Folder with the same name.
 
* Copy the relevant part of the game structure. Assume that the content of your modfolder is inside the Stellaris game folder.
 
* Copy the initial gamefile you want to overwrite or create the gamefile you want to add, in the appropriate folder.
 
* Start the game and select your mod in the launcher, to be loaded on this and all further starts.
 
  
Mod Uploading on Windows:
+
*'''Create a mod for your modifications''': use a [[#Mod structure|personal mod]] even for small changes, and never directly modify the game files in the Steam Stellaris folder, as they may be overwritten without warning.
* Start the game
+
*'''Use a good text editor''' (recommended: [https://code.visualstudio.com/ Visual Studio Code]) to edit files and search into multiple files. A good text editor can also format the displayed text so that braces can be collapsed if complete, and complete/incomplete pairs are highlighted.
* In the launcher, go to the Mod Tab.
+
*'''Use the Error.log file to get execution errors''': The log folder can be found right next to the mod folder. Good Editors usually have the ability to track changes to files from outside the program and prompt for a reload, thus showing you errors with one glance at the file. Note that some modifications need a game to be loaded or even the option to be used on screen/in the back-end before their code will run.
* click on "Mod tools"
+
*'''Use CWTools for advanced validation and auto-complete''': CWTools is a syntax validator for Stellaris modding, developed as an extension for Visual Studio Code and also available for Sublime. Read the [https://forum.paradoxplaza.com/forum/index.php?threads/tool-cwtools-a-mod-validating-extension-for-vs-code.1066033/ forum post] by the developer for more info.
* click on "Upload Mod"
+
*'''Minimize overwrites of vanilla files''', unless that is your main goal or somehow necessary (on_action triggers). Adding separate files and use [[#Game structure|loading from folders]] whenever possible, to improve mod compatibility and maintenance. Your files can have any name, all files in the folder will be loaded by the game. So choose a prefix no one else will ever use like the name of your mod. Even DLC follows that pattern.
* select the mod you want to upload in the list
+
*'''Use a proper merge tool''' (like [http://winmerge.org/ WinMerge], or the Visual Studio Code Extension [https://marketplace.visualstudio.com/items?itemName=L13RARY.l13-diff L13 Diff] ), to [[Merging guide|merge between folders]], and update modified vanilla files to a new vanilla patch.
* click on "Fetch Info". This will try to find the mod and it's Mod ID on the Steam Workshop. If you have not uploaded the mod or are not logged in as uploader, the action will fail with "Mod not found. Will create new mod."
 
* click upload.
 
* wait for the message saying the upload was successful
 
 
 
==Guidelines==
 
 
 
*'''Create a mod for your modifications''': use a [[#Mod_structure|personal mod]] even for small changes, and never modify directly game files in Steam Stellaris folder, as they may be overwritten without warning.
 
*'''Use a good text editor''' (like [https://atom.io Atom], [http://notepad-plus-plus.org/ Notepad++] or [https://www.sublimetext.com/ Sublime Text]) to edit files and search into multiple files. A good text editor can also format the displayed text so that braces can be collapsed if complete, and complete/incomplete pairs are highlighted.
 
*'''Use the Error.log file to get execution errors''': The log folder can be found right next to the mod folder. Good Editors usually have the ability to track changes to files from outside the program and prompt for a reload, thus showing you errors with one glance onto the file. Note that some modifications need a game to be loaded or even the option to be used on screen/in the back-end before their code will run.
 
*'''Minimize overwrites of vanilla files''', unless that is your main goal or somehow necessary (on_action triggers). Adding separate files and use [[#Game structure|loading from folders]] whenever possible, to improve mod compatibility and maintenance. Your files can have any name, all files in the folder will be loaded by the game. So choose a prefix no one else will ever use like the name of your mod. Even DLC follow that pattern.
 
*'''Use a proper merge tool''' (like [http://winmerge.org/ WinMerge]), to [[Merging guide|merge between folders]], and update modified vanilla files to a new vanilla patch.
 
 
*'''Backup your work''' to avoid losing everything. Consider using a source control system like [https://git-scm.com/ Git] and a collaborative forge like [https://github.com/ GitHub] to manage team collaboration.
 
*'''Backup your work''' to avoid losing everything. Consider using a source control system like [https://git-scm.com/ Git] and a collaborative forge like [https://github.com/ GitHub] to manage team collaboration.
*'''Use UTF-8 encoding''' for text files.
+
*'''Use UTF-8 encoding''' for text and .mod files.
*'''Use UTF-8 with BOM''' for localization, name list, and .mod files.
+
*'''Use UTF-8 with BOM''' for localization and name list files.
 
*'''Indent properly''' and, again, use a good text editor, to easily spot unclosed curly braces. Vanilla uses 1 tab for indentation rather than spaces.
 
*'''Indent properly''' and, again, use a good text editor, to easily spot unclosed curly braces. Vanilla uses 1 tab for indentation rather than spaces.
*'''Use comments''' starting with # character, to remember reasons for writing tricky stuff.
+
*'''Use comments''' starting with a # character, to remember your reasons for writing tricky stuff.
 +
 
 +
== Mod management ==
  
==Mod structure==
+
The first steps of modding is getting to know where the mods are located, how they're structured and what to do when uploading your first mod!
  
Mods are located in the folder:
+
=== Mod folder location ===
  
 
{| class="wikitable"
 
{| class="wikitable"
| '''OS''' || '''Path'''
+
! OS !! Path
 
|-
 
|-
 
| Linux || <code>~/.local/share/Paradox Interactive/Stellaris/mod</code>
 
| Linux || <code>~/.local/share/Paradox Interactive/Stellaris/mod</code>
 
|-
 
|-
| Windows || <code>C:\Users\<Username>\Documents\Paradox Interactive\Stellaris\mod</code>
+
| Windows || <code>\Documents\Paradox Interactive\Stellaris\mod</code>
 
|-
 
|-
 
| Mac OS ||<code>~/Documents/Paradox Interactive/Stellaris/mod</code>
 
| Mac OS ||<code>~/Documents/Paradox Interactive/Stellaris/mod</code>
 
|}
 
|}
which must contain:
 
  
* the .mod file, to tell the launcher what to do with the mod-folder.
+
Mods from the Steam Workshop will be placed in <code>…\SteamLibrary\SteamApps\workshop\content\281990</code>, sorted by their Workshop ID.<br>
* the mod folder or zip containing the mod data. The mod data must have the same [[#Game structure|file and folder structure]] as if it was along with stellaris.exe in the game directory.
+
Mods from Paradox Mods will be placed in the mod folder location, named <code>PDX_*MOD_ID*</code>.
  
(Subscribed and downloaded mods from the steam workshop are in <code>.../Paradox Interactive/Stellaris/workshop/content/281990</code> or <code>...\SteamLibrary\SteamApps\workshop\content\281990</code>)
+
=== File and folder structure ===
  
Note that folder and file names are case sensitive on Mac OS X and Linux. Additionally, the path has to be relative to the <code>.../Paradox Interactive/Stellaris</code> folder; absolute path to another directory will not work.
+
Getting the structure set up correctly when creating a mod is essential for it to run properly.
  
For example, a new text file called ''test1.mod'' can be created in the <code>.../Paradox Interactive/Stellaris/mod</code> folder, alongside a new 'test1' folder.
+
This is the required structure inside the main mod folder:
 +
* <code>modname.mod</code> – Includes the information used by the Stellaris launcher
 +
* <code>modname</code> – Folder where all the modified files are placed, in the same [[#Game structure|file and folder structure]] as the game folder
 +
** Mod contents
 +
** <code>descriptor.mod</code> – Required for the [[Patch 2.4|new launcher]] added in patch 2.4. Ignored in the old launcher.
 +
** <code>image.ext</code> – PNG and JPEG files are supported. With the new 2.4 launcher, must be a PNG named <code>thumbnail.png</code>
  
name="Test1"
+
<code>modname.mod</code> and <code>descriptor.mod</code> both contain the mod information that the launcher uses when displaying the mod and uploading it.<br>
path="mod/test1"
+
The 2.4 launcher prefers <code>descriptor.mod</code> and will modify <code>modname.mod</code> to match the information in <code>descriptor.mod</code>, however if the file is not found, it'll use the information in <code>modname.mod</code>. The pre-2.4 launcher ignores it.<br>
tags={
+
The <code>path="XXX"</code> is not needed in descriptor.mod.<br>
"Economy"
+
Note that folder and file names are case sensitive on Mac OS X and Linux.
}
 
picture="test1.jpg"
 
supported_version="1.0.3"
 
  
In the ''test1'' folder, the ''test1.mod'' file should be copied and can be renamed to ''descriptor.mod''.
+
'''modname.mod structure'''<br>
 +
This also applies to <code>descriptor.mod</code>.
  
It is important that your thumbnail image is in the ".jpg" format, otherwise steam gives an error during upload.  
+
{| class="wikitable"
 +
!Name
 +
!Required
 +
!Description
 +
!Example
 +
|-
 +
| <code>name</code>
 +
| '''Yes'''
 +
| Name of your mod.
 +
| <code>name="My Stellaris Mod"</code>
 +
|-
 +
| <code>path</code>
 +
| modname.mod: '''Yes'''<br>descriptor.mod: '''No''' (Ignored)
 +
| Defines which folder is the mod's folder. It is relative to ''…\Documents\Paradox Interactive\Stellaris\'' folder.
 +
| <code>path="mod/MyStellarisMod"</code>
 +
|-
 +
| <code>dependencies</code>
 +
| No
 +
| Specifies if the mod should be loaded after the listed mod(s), if they exist.<br>Very useful for submods or compatibility patches to make sure they overrule certain mods.
 +
|
 +
<pre>
 +
dependencies={
 +
"My Other Stellaris Mod"
 +
"Not My Stellaris Mod"
 +
}
 +
</pre>
 +
|-
 +
| <code>picture<code>
 +
| No
 +
| Specifies the mod thumbnail used on [[Steam Workshop]]. With the new 2.4 launcher, this must be a PNG file named <code>thumbnail.png</code>.
 +
| <code>picture="thumbnail.png"<code>
 +
|-
 +
| <code>tags</code>
 +
| No
 +
| List of tags for [[Steam Workshop]]. Using tags besides the predefined ones may prevent uploading on Paradox Mods.<br>Warning: don't forget quotes for tags that contain spaces.
 +
|
 +
<pre>
 +
tags={
 +
"Tag1"
 +
"Tag2"
 +
}
 +
</pre>
 +
|-
 +
| <code>supported_version</code>
 +
| Recommended
 +
| Specifies what game version the mod supports.<br>The last number can be replaced with the asterisk (*) symbol to tell the launcher that mod supports any value, like 2.4.*.<br>Only the last number supports this.
 +
| <code>supported_version="2.4.1"</code>
 +
|-
 +
| <code>remote_file_id</code>
 +
| No
 +
| Property added by the launcher that includes the Steam Workshop ID. Ignore it.
 +
| <code>remote_file_id="1234567890"</code>
 +
|}
 +
The data structure is similar to the proprietary Valve Data Format.<ref>VDF is a ad-hoc file format designed by Valve to support storage of hierarchical data, which is also used by [https://developer.valvesoftware.com/wiki/SDK_Installation Steam]. Open VDF parser: https://github.com/rossengeorgiev/vdf-parser/, [https://github.com/shravan2x/Gameloop.Vdf for .NET]</ref>
  
Game files can now be replaced using the same structure as the game directory. Here, a ''common'' folder was created, with a ''traits'' subfolder that contains the ''00_species_traits.txt'' from the game folder.  
+
'''Example modname.mod file'''
The structure now looks like the following:
+
<pre>
 +
name="Somemod"
 +
path="mod/somemod"
 +
dependencies={
 +
"othermod"
 +
"another mod"
 +
}
 +
tags={
 +
"Graphics"
 +
"Economy"
 +
"Overhaul"
 +
}
 +
picture="thumbnail.png"
 +
remote_file_id="1234567890"
 +
supported_version="2.4.*"
 +
</pre>
  
  ''C:\Users\Jason\Documents\Paradox Interactive\Stellaris\mod''
+
=== Adding a thumbnail ===
    test1.mod
 
    test1 (dir)
 
      test1.jpg
 
      descriptor.mod
 
      common (dir)
 
        traits (dir)
 
          00_species_traits.txt
 
  
A new trait with various bonuses called ''trait_super'' can be added. It has a high cost so the AI does not use it, but the user could load it using the console commands. (Using ''is_ai = no'' also seems to also do the trick)
+
The Steam Workshop allows for a preview thumbnail picture that'll be displayed when searching for mods and as a preview picture if you haven't uploaded any, otherwise it'll be placed to the right of the preview pictures.<br>
 +
It's recommended to make the thumbnail 512px × 512px at minimum, which is used by the workshop frontpage.<br>
 +
Additionally, the thumbnail file should be under '''1&nbsp;MB''' in size, otherwise, it will not be uploaded.<br>
 +
Both JPEG and PNG are supported, and after 2.4, the image file must be named '''thumbnail.png'''.
 +
# Make sure the Stellaris launcher is closed, so that it doesn't revert your changes
 +
# Open up <code>modname.mod</code> and <code>descriptor.mod</code> files
 +
# Make sure <code>picture="thumbnail.png"</code> exists, if not, add it
 +
# Add your image file in your mod folder
 +
# Start up the launcher and update your mod
 +
# Thumbnail should now show up at the [[Steam Workshop]] mod page
  
trait_super = {
+
You can always update the thumbnail at any time by updating the mod (unless you are only a co-author).
cost = 1000
 
modifier = {
 
tile_resource_food_mult = 10
 
tile_resource_energy_mult = 10
 
tile_resource_minerals_mult = 10
 
}
 
}
 
  
In addition, downloaded mods will use content in zip files.  Their '.mod' files will contain lines defining the 'remote_file_id' and 'archive'.
+
=== Creating a mod ===
Here is an example:
 
  
name="999 Core Planets - All your planets are belong to you"
+
You can use the game launcher to set up a the mod structure for you by following these simple steps according to your launcher of choice:
archive="workshop/content/281990/678893824/999cores.zip"
+
{| style="text-align:center;" class="wikitable"
tags={
+
!#
"Balance"
+
!Launcher v1 (<=2.3.3)
"Gameplay"
+
!Launcher v2 (>=2.4.0)
"Utilities"
+
|-
}
+
|1||colspan="2"| Launch the game
remote_file_id="678893824"
+
|-
supported_version="1.0.0"
+
|2||colspan="2"| Navigate to the mods tab
 +
|-
 +
|3||colspan="2"| Click '''Mod Tools'''
 +
|-
 +
|4||Click '''Create Mod'''
 +
|-
 +
|5||colspan="2"| Insert the relevant information and click '''Create Mod''' at the bottom
 +
|-
 +
|6||colspan="2"| Navigate to the [[#Mod folder location|mod folder]] and locate your mod folder
 +
|-
 +
|7||colspan="2"| Start modding!
 +
|}
  
This directory is based off the Stellaris directory in your documents folder, for instance this zip file is:
+
=== Uploading and updating a mod ===
  
C:\Users\<Username>\Documents\Paradox Interactive\Stellaris\workshop\content\281990\678893824\999cores.zip
+
Uploading and updating a mod follows the the same procedure, depending on your launcher of choice:
 +
{| style="text-align:center;" class="wikitable"
 +
!#
 +
!Launcher v1 (<=2.3.3)
 +
!Launcher v2 (>=2.4.0)
 +
|-
 +
|1||colspan="2"|Launch the game
 +
|-
 +
|2||colspan="2"|Navigate to the mods tab
 +
|-
 +
|3||colspan="2"|Click '''Mod Tools'''
 +
|-
 +
|4||Click '''Upload Mod'''||Click '''Upload a Mod'''
 +
|-
 +
|5||colspan="2"|Select your mod from the list
 +
|-
 +
|6||Click '''Fetch Info''' and wait for a response||Select mod site
 +
|-
 +
|7|| ||Insert description<sup>'''*'''</sup>
 +
|-
 +
|8||Click '''Upload'''||Click '''Upload Mod'''
 +
|-
 +
|9||colspan="2"|The launcher will now upload your changes and inform you when it's done or if an error occurred.
 +
|-
 +
|10||colspan="2"|Navigate to the mod service of choice and locate your mod;<br>'''Steam Workshop''', visit the [https://steamcommunity.com/app/281990/workshop/ Workshop] page, and locate the "Files you've posted" button by hovering over "Your Files" on the right<br>'''Paradox Mods''', visit the [https://mods.paradoxplaza.com/ Mods] page, login, and click "My uploaded mods" in the dropdown menu that appears when hovering over your name
 +
|-
 +
|+ style="caption-side:bottom; font-size:small;"|* - The inserted description will replace the current one used on the mod page!
 +
|}
  
Here is an example of how to make a ''.mod file'' for a Sub Mod (Mod for a Mod)
+
Note that if you subscribe to an uploaded version of your mod while you still have the .mod file of your original mod in the mods folder, the uploaded mod will likely not work.
  
name="Fight For Universe: Infinite Legacy - No Maintenance"
+
== Game data ==
path="mod/ffu_ilno"
 
dependencies={
 
"Fight For Universe: Infinite Legacy"
 
}
 
replace_path="Fight For Universe: Infinite Legacy"
 
tags={
 
"Balance"
 
"Overhaul"
 
"Graphics"
 
"Gameplay"
 
}
 
picture="NoMaintenance.png"
 
remote_file_id="911971558"
 
supported_version="1.5.1"
 
  
==Game data==
 
 
* [[Console commands]], useful for debugging mods.
 
* [[Console commands]], useful for debugging mods.
* [[Defines]], which allow to influence some hardcoded vanilla behaviors
+
* [[Defines]], which allows you to influence some hardcoded vanilla behaviors
 
* [[Scopes]], [[Conditions]], and [[Commands]] used for scripting
 
* [[Scopes]], [[Conditions]], and [[Commands]] used for scripting
 
* [[Modifiers]], used to influence calculations made by the game
 
* [[Modifiers]], used to influence calculations made by the game
Line 147: Line 215:
 
* [[Map]], used for pre-generated galaxy maps
 
* [[Map]], used for pre-generated galaxy maps
  
==Game structure==
+
== Game structure ==
  
Below is a list of game files and folders, with associated modding guide.
+
Below is a list of game files and folders, listed alongside the modding guide for each.
  
 
==== Stellaris/common/ ====
 
==== Stellaris/common/ ====
{| class = "wikitable"
+
 
 +
{| class="wikitable"
 
!Folder/File
 
!Folder/File
 
!Summary
 
!Summary
 
!Guides
 
!Guides
 
|-
 
|-
| agendas  
+
| agendas
 
| Agendas are given to leader-candidates in Oligarchic government-forms
 
| Agendas are given to leader-candidates in Oligarchic government-forms
 
| [[Agenda modding|Agendas]]
 
| [[Agenda modding|Agendas]]
 +
|-
 +
| ai_budget
 +
| Determine how AI should handle resources.
 +
| [[AI modding|AI]]
 
|-
 
|-
 
| ambient_objects
 
| ambient_objects
 
| References used by code to spawn ambient objects
 
| References used by code to spawn ambient objects
 
| [[Model modding|Models]]
 
| [[Model modding|Models]]
 +
|-
 +
| archaeological_site_types
 +
| Definitions for Archaeological Sites to be discovered and delved by Science Ships.
 +
| [[Ancestral Relics modding|Ancestral Relics]]
 
|-
 
|-
 
| anomalies
 
| anomalies
Line 173: Line 250:
 
| [[Army modding|Armies]]
 
| [[Army modding|Armies]]
 
|-
 
|-
| army_attachments
+
| <del>army_attachments</del> ''(Deprecated)''
| Definitions for attachments that can be added to armies
+
|
| [[Army modding|Armies]]
+
|
 +
|-
 +
| artifact_actions
 +
| Definitions for Artifact Actions.
 +
| [[Ancestral Relics modding|Ancestral Relics]]
 +
|-
 +
| ascension_perks
 +
| Definitions for Ascension Perks.
 +
| [[Tradition modding|Traditions]]
 
|-
 
|-
 
| attitudes
 
| attitudes
Line 181: Line 266:
 
| [[AI modding|AI]]
 
| [[AI modding|AI]]
 
|-
 
|-
| buildable_pops
+
| bombardment_stances
| Definitions for buildable pops. i.e. Robots
+
| Definitions of bombardment stances.
| [[Pops modding|Pops]]
+
| [[Bombardment Stance modding|Bombardment Stances]]
 +
|-
 +
| <del>buildable_pops</del> ''(Deprecated)''
 +
|
 +
|
 
|-
 
|-
 
| buildings
 
| buildings
 
| Setup for buildings constructable on planets, and those given through events
 
| Setup for buildings constructable on planets, and those given through events
| [[Planet modding|Planets]]
+
| [[Building modding|Buildings]]
 +
|-
 +
| button_effects
 +
| Definitions for button effects.
 +
| [[Graphics modding|Graphics]]
 +
|-
 +
| bypass
 +
| Definitions for bypasses (gateway, worm hole and l-gate)
 +
| [[Bypass modding|Bypasses]]
 +
|-
 +
| casus_belli
 +
| Definitions for casus belli.
 +
| [[War modding|Wars]]
 +
|-
 +
| colony_automation
 +
| Definitions for colony autobuild types.
 +
| [[Colony Automation modding|Colony Automations]]
 +
|-
 +
| colony_automation_exceptions
 +
| Definitions for colony autobuild types.
 +
| [[Colony Automation modding|Colony Automations]]
 
|-
 
|-
 
| colors
 
| colors
Line 193: Line 302:
 
| [[Country modding|Countries]]
 
| [[Country modding|Countries]]
 
|-
 
|-
| component_flags
+
| <del>component_flags</del> ''(Deprecated)''
| List of flags used by the AI for selecting components
+
|
| [[Ship modding|Ships]]
+
|
 
|-
 
|-
 
| component_sets
 
| component_sets
 
| List of the sets of components used by ships
 
| List of the sets of components used by ships
 +
| [[Ship modding|Ships]]
 +
|-
 +
| component_slot_templates
 +
| Slot templates to be used with ship sections.
 
| [[Ship modding|Ships]]
 
| [[Ship modding|Ships]]
 
|-
 
|-
Line 213: Line 326:
 
| [[Country modding|Countries]]
 
| [[Country modding|Countries]]
 
|-
 
|-
| defines  
+
| decisions
| Basic game behaviors and settings  
+
| Definitions for planetary decisions.
|[[Defines]]
+
| [[Decision modding|Decisions]]
 +
|-
 +
| defines
 +
| Basic game behaviors and settings
 +
| [[Defines]]
 +
|-
 +
| deposit_categories
 +
| Deposit categories relevant to deposit generation.
 +
| [[Planet Generation modding|Planet Generation]]
 
|-
 
|-
 
| deposits
 
| deposits
| Setup for the deposits of resources found on planets
+
| Setup for the deposits of resources found on planets as well as blockers spawned on habitable planets.
| [[Planet modding|Planets]]
+
| [[Planet Generation modding|Planet Generation]]
 
|-
 
|-
 
| diplo_phrases
 
| diplo_phrases
 
| Setup for the logic behind the diplomatic phrases used between countries.
 
| Setup for the logic behind the diplomatic phrases used between countries.
 
| [[AI modding|AI]]
 
| [[AI modding|AI]]
 +
|-
 +
| diplomacy_economy
 +
| Economy units based on diplomacy. Diplomatic upkeeps like influence upkeep of Federations are defined here.
 +
| [[Diplomacy modding|Diplomacy]]
 
|-
 
|-
 
| diplomatic_actions
 
| diplomatic_actions
 
| Setup for the rules for diplomatic actions.
 
| Setup for the rules for diplomatic actions.
| [[Gameplay modding|Gameplay]]
+
| [[Diplomacy modding|Diplomacy]]
 +
|-
 +
| districts
 +
| Definitions for districts.
 +
| [[Building modding|Buildings]]
 +
|-
 +
| economic_categories
 +
| Definitions for economic categories.
 +
| [[Economy modding|Economy]]
 +
|-
 +
| economic_plans
 +
| Definitions for AI economy plans.
 +
| [[AI modding|AI]]
 
|-
 
|-
 
| edicts
 
| edicts
| Setup for the edicts used by planets and countries.
+
| Setup for the edicts used by countries.
 
| [[Edicts modding|Edicts]]
 
| [[Edicts modding|Edicts]]
 
|-
 
|-
Line 244: Line 381:
 
| Sets up the countries and system initializer used for fallen empires
 
| Sets up the countries and system initializer used for fallen empires
 
| [[System modding|Systems]]
 
| [[System modding|Systems]]
 +
|-
 +
| federation_law_categories
 +
| Definitions for federation law categories.
 +
| [[Diplomacy modding|Diplomacy]]
 +
|-
 +
| federation_laws
 +
| Definitions for federation laws.
 +
| [[Diplomacy modding|Diplomacy]]
 +
|-
 +
| federation_perks
 +
| Definitions for federation perks.
 +
| [[Diplomacy modding|Diplomacy]]
 +
|-
 +
| federation_types
 +
| Definitions for federation types.
 +
| [[Diplomacy modding|Diplomacy]]
 +
|-
 +
| galactic_focuses
 +
| Definitions for galactic focuses relevant to the Galactic Community.
 +
| [[Diplomacy modding|Diplomacy]]
 
|-
 
|-
 
| game_rules
 
| game_rules
Line 258: Line 415:
 
|-
 
|-
 
| graphical_culture
 
| graphical_culture
| Controls the lightning used for ships, which differs between graphical cultures.
+
| Controls the lighting used for ships, which differs between graphical cultures.
 
| [[Species modding|Species]]
 
| [[Species modding|Species]]
 +
|-
 +
| lawsuits
 +
| Unused.
 +
|
 +
|-
 +
| leader_classes
 +
| Definitions for leader classes.
 +
| [[Leader modding|Leaders]]
 
|-
 
|-
 
| mandates
 
| mandates
 
| Controls the mandates used by factions
 
| Controls the mandates used by factions
 
| [[Mandate modding|Mandates]]
 
| [[Mandate modding|Mandates]]
 +
|-
 +
| map_modes
 +
| Definitions for map modes to be used in the galaxy view.
 +
| [[Map Mode modding|Map Modes]]
 +
|-
 +
| megastructures
 +
| Definations for megastructures.
 +
| [[Megastructure modding|Megastructures]]
 
|-
 
|-
 
| name_lists
 
| name_lists
 
| Sets up the names used for each species.
 
| Sets up the names used for each species.
 
| [[Species modding|Species]]
 
| [[Species modding|Species]]
 +
|-
 +
| notification_modifiers
 +
| A variation of static modifiers. They have no modifiers and can only be added to empires.
 +
| [[Modifiers#Static Modifiers|Static Modifiers]]
 
|-
 
|-
 
| observation_station_missions
 
| observation_station_missions
Line 279: Line 456:
 
| opinion_modifiers
 
| opinion_modifiers
 
| Opinion of Empires on other Empires depending on Political status and Ethics.
 
| Opinion of Empires on other Empires depending on Political status and Ethics.
| [[Gameplay modding|Gameplay]]
+
| [[Opinion modifier modding|Opinion Modifiers]]
 
|-
 
|-
 
| personalities
 
| personalities
Line 286: Line 463:
 
|-
 
|-
 
| planet_classes
 
| planet_classes
| The setup for all the planets in the game.
+
| The setup for all the planets and stars in the game.
 
| [[Planet modding|Planets]]
 
| [[Planet modding|Planets]]
 
|-
 
|-
 
| planet_modifiers
 
| planet_modifiers
 
| Spawn chances planet modifiers (f.e. lush, hazardous weather, etc.).
 
| Spawn chances planet modifiers (f.e. lush, hazardous weather, etc.).
| [[Planet modding|Planets]]
+
| [[Planet Generation modding|Planet Generation]]
 
|-
 
|-
 
| policies
 
| policies
 
| AI Policy grabbing (What order they take policies in)
 
| AI Policy grabbing (What order they take policies in)
 
| [[Policies modding|Policies]]
 
| [[Policies modding|Policies]]
 +
|-
 +
| pop_categories
 +
| Definitions for pop categories (social strata).
 +
| [[Pop Job modding|Pop Jobs]]
 
|-
 
|-
 
| pop_faction_types
 
| pop_faction_types
| Population faction types and personalities
+
| Population faction types and personalities
| [[Pops modding|Pops]]
+
| [[Pop Faction modding|Pop Factions]]
 +
|-
 +
| pop_jobs
 +
| Definitions for pop jobs.
 +
| [[Pop Job modding|Pop Jobs]]
 
|-
 
|-
 
| precursor_civilizations
 
| precursor_civilizations
| Precursor civilisation weightings
+
| Precursor civilization weightings
 
| [[Planet modding|Planets]]
 
| [[Planet modding|Planets]]
 
|-
 
|-
Line 308: Line 493:
 
| Lists of random names for Empires
 
| Lists of random names for Empires
 
| [[Gameplay modding|Gameplay]]
 
| [[Gameplay modding|Gameplay]]
 +
|-
 +
| relics
 +
| Definitions for Relics.
 +
| [[Ancestral Relics modding|Ancestral Relics]]
 +
|-
 +
| resolution_categories
 +
| Definitions for resolution categories relevant to the Galactic Community.
 +
| [[Diplomacy modding|Diplomacy]]
 +
|-
 +
| resolutions
 +
| Definitions for resolutions relevant to the Galactic Community.
 +
| [[Diplomacy modding|Diplomacy]]
 
|-
 
|-
 
| scripted_effects
 
| scripted_effects
| Events that give buffs or de-buffs (effects).
+
| Pre-defined blocks of [[Effects]] to be called elsewhere.
| [[Gameplay modding|Gameplay]]
+
| [[Dynamic modding|Dynamic]]
 +
|-
 +
| scripted_loc
 +
| Pre-defined methods to provide text based on the scoped object's attributes.
 +
| [[Dynamic modding|Dynamic]]
 
|-
 
|-
 
| scripted_triggers
 
| scripted_triggers
| Scripted events and how they trigger.
+
| Pre-defined blocks of [[Conditions]] to be called elsewhere.
| [[Gameplay modding|Gameplay]]
+
| [[Dynamic modding|Dynamic]]
 +
|-
 +
| scripted_variables
 +
| Pre-defined "@" variables to be called from other game files.
 +
| [[Dynamic modding|Dynamic]]
 
|-
 
|-
 
| section_templates
 
| section_templates
| Different Ship AI and how it acts.
+
| Container of components that consist actual ships.
 
| [[Ship modding|Ship]]
 
| [[Ship modding|Ship]]
 +
|-
 +
| sector_focuses
 +
| Types of sectors and how they act.
 +
| [[Colony Automation modding|Colony Automations]]
 
|-
 
|-
 
| sector_types
 
| sector_types
 
| Types of sectors and how they act.
 
| Types of sectors and how they act.
| [[Gameplay modding|Gameplay]]
+
| [[Colony Automation modding|Colony Automations]]
 
|-
 
|-
 
| ship_behaviours
 
| ship_behaviours
Line 337: Line 546:
 
| [[System modding|Systems]]
 
| [[System modding|Systems]]
 
|-
 
|-
| spaceport_modules
+
| <del>spaceport_modules</del> ''(Deprecated)''
|  
+
|
| [[Planet modding|Planets]]
+
|
 
|-
 
|-
 
| special_projects
 
| special_projects
 
|
 
|
 
| [[Special Project modding|Special Projects]]
 
| [[Special Project modding|Special Projects]]
 +
|-
 +
| species_archetypes
 +
| Definitions for species archetypes to give some shared attributes to species classes.
 +
| [[Species modding|Species]]
 
|-
 
|-
 
| species_classes
 
| species_classes
|
+
| Definitions for species classes that are sets of species portraits.
 +
| [[Species modding|Species]]
 +
|-
 +
| species_names
 +
| Definitions for species random names.
 +
| [[Species modding|Species]]
 +
|-
 +
| species_rights
 +
| Definitions for species rights.
 
| [[Species modding|Species]]
 
| [[Species modding|Species]]
|-  
+
|-
 +
| star_classes
 +
| Types of solar systems (NOT individual stars themselves!)
 +
| [[System modding|Systems]]
 +
|-
 +
| starbase_buildings
 +
| Definitions for starbase buildings that each starbase can only have one of each of them.
 +
| [[Starbase modding|Starbases]]
 +
|-
 +
| starbase_levels
 +
| Definitions for starbase levels.
 +
| [[Starbase modding|Starbases]]
 +
|-
 +
| starbase_modules
 +
| Definitions for starbase modules.
 +
| [[Starbase modding|Starbases]]
 +
|-
 +
| starbase_types
 +
| Definitions for starbase types. To players, no effects, flavor only. To the AI, a starbase auto-build guide.
 +
| [[Starbase modding|Starbases]]
 +
|-
 
| start_screen_messages
 
| start_screen_messages
|
+
| Messages that should be shown to the player at the start of the game.
 
| [[Gameplay modding|Gameplay]]
 
| [[Gameplay modding|Gameplay]]
 
|-
 
|-
 
| static_modifiers
 
| static_modifiers
|
+
| Blocks of [[Modifiers]] to be added to objects.
| [[Gameplay modding|Gameplay]]
+
| [[Modifiers#Static Modifiers|Static Modifiers]]
 
|-
 
|-
 
| strategic_resources
 
| strategic_resources
|
+
| Definitions for resources, not just strategic resources.
| [[Planet modding|Planet]]
+
| [[Economy modding|Economy]]
 
|-
 
|-
 
| subjects
 
| subjects
|
+
| Definitions for subject types.
| [[Gameplay modding|Gameplay]]
+
| [[Diplomacy modding|Diplomacy]]
 +
|-
 +
| system_types
 +
| Definitions for system types. No effects, flavor only.
 +
| [[Starbase modding|Starbases]]
 
|-
 
|-
 
| technology
 
| technology
|  
+
| Definitions for technologies.
 
| [[Technology modding|Technology]]
 
| [[Technology modding|Technology]]
 
|-
 
|-
| terraform  
+
| terraform
 +
| Definitions for terraform methods.
 +
| [[Planet modding|Planets]]
 +
|-
 +
| trade_conversions
 +
| Definitions for trade value conversions.
 +
| [[Economy modding|Economy]]
 +
|-
 +
| <del>tile_blockers</del> ''(Deprecated)''
 
|
 
|
| [[Planet modding|Planets]]
 
|-
 
| tile_blockers
 
 
|
 
|
| [[Planet modding|Planets]]
+
|-
 +
| tradition_categories
 +
| Definitions for tradition groups.
 +
| [[Tradition modding|Traditions]]
 +
|-
 +
| traditions
 +
| Definitions for traditions.
 +
| [[Tradition modding|Traditions]]
 
|-
 
|-
 
| traits
 
| traits
|
+
| Definitions for species traits and leader traits.
 
| [[Traits modding|Traits]]
 
| [[Traits modding|Traits]]
 
|-
 
|-
| triggered_modifiers
+
| <del>triggered_modifiers</del> ''(Deprecated)''
 +
|
 
|
 
|
| [[Gameplay modding|Gameplay]]
 
 
|-
 
|-
| war_demand_counters
+
| <del>war_demand_counters</del> ''(Deprecated)''
 +
|
 
|
 
|
| [[War modding|Wars]]
 
 
|-
 
|-
| war_demand_types
+
| <del>war_demand_types</del> ''(Deprecated)''
 
|
 
|
 +
|
 +
|-
 +
| war_goals
 +
| Definitions for war goals.
 
| [[War modding|Wars]]
 
| [[War modding|Wars]]
 
|-
 
|-
 
| achievements.txt
 
| achievements.txt
 +
| Definitions for achievements. Modding this file doesn't make sense, since achievements are disabled for any "common" changing/expanding mods anyway.
 
|
 
|
| None
 
 
|-
 
|-
 
| alerts.txt
 
| alerts.txt
 
|
 
|
| [[Gameplay modding|Gameplay]]
+
| [[Message modding|Messages]]
 
|-
 
|-
 
| message_types.txt
 
| message_types.txt
 
|
 
|
| [[Gameplay modding|Gameplay]]
+
| [[Message modding|Messages]]
 
|-
 
|-
 
|}
 
|}
  
 
==== Stellaris/events/ ====
 
==== Stellaris/events/ ====
{| class = "wikitable"
+
 
 +
{| class="wikitable"
 
!Folder/File
 
!Folder/File
 
!Summary
 
!Summary
Line 417: Line 679:
 
| [[Event modding|Events]]
 
| [[Event modding|Events]]
 
|}
 
|}
 +
 
==== Stellaris/flags/ ====
 
==== Stellaris/flags/ ====
{| class = "wikitable"
+
 
 +
{| class="wikitable"
 
!Folder/File
 
!Folder/File
 
!Summary
 
!Summary
Line 431: Line 695:
 
| [[Flag modding|Flags]]
 
| [[Flag modding|Flags]]
 
|}
 
|}
 +
 
==== Stellaris/fonts/ ====
 
==== Stellaris/fonts/ ====
{| class = "wikitable"
+
 
 +
{| class="wikitable"
 
!File
 
!File
 
!Summary
 
!Summary
Line 441: Line 707:
 
| [[Font modding|Fonts]]
 
| [[Font modding|Fonts]]
 
|}
 
|}
 +
 
==== Stellaris/gfx/ ====
 
==== Stellaris/gfx/ ====
{| class = "wikitable"
+
 
 +
{| class="wikitable"
 
!Folder/File
 
!Folder/File
 
!Summary
 
!Summary
Line 614: Line 882:
  
 
==== Stellaris/interface/ ====
 
==== Stellaris/interface/ ====
{| class = "wikitable"
+
 
 +
{| class="wikitable"
 
!Folder
 
!Folder
 
!Summary
 
!Summary
Line 629: Line 898:
  
 
==== Stellaris/localisation/ ====
 
==== Stellaris/localisation/ ====
{| class = "wikitable"
+
 
 +
{| class="wikitable"
 
!File
 
!File
 
!Summary
 
!Summary
 
!Guides
 
!Guides
 +
|-
 +
| *l_simp_chinese.yml
 +
| Contains Chinese localisation
 +
| [[Localisation modding|Localisation]]
 
|-
 
|-
 
| *l_english.yml
 
| *l_english.yml
Line 664: Line 938:
  
 
==== Stellaris/map/ ====
 
==== Stellaris/map/ ====
{| class = "wikitable"
+
 
 +
{| class="wikitable"
 
!Folder/File
 
!Folder/File
 
!Summary
 
!Summary
Line 679: Line 954:
  
 
==== Stellaris/music/ ====
 
==== Stellaris/music/ ====
{| class = "wikitable"
+
 
 +
{| class="wikitable"
 
!Folder/File
 
!Folder/File
 
!Summary
 
!Summary
Line 693: Line 969:
 
|-
 
|-
 
| songs.txt
 
| songs.txt
|  
+
|
 
| [[Music modding|Music]]
 
| [[Music modding|Music]]
 
|}
 
|}
  
 
==== Stellaris/prescripted_countries/ ====
 
==== Stellaris/prescripted_countries/ ====
{| class = "wikitable"
+
 
 +
{| class="wikitable"
 
!Folder/File
 
!Folder/File
 
!Summary
 
!Summary
Line 713: Line 990:
  
 
==== Stellaris/sound/ ====
 
==== Stellaris/sound/ ====
{| class = "wikitable"
+
 
 +
{| class="wikitable"
 
!Folder/File
 
!Folder/File
 
!Summary
 
!Summary
Line 727: Line 1,005:
 
|}
 
|}
  
==Overwriting Specific Elements==
+
== Overwriting Specific Elements ==
 +
 
 +
Occasionally, it is possible to overwrite a specific game element without needing to replace the entire vanilla file. In some cases adding an element with a similar identifier into another file will duplicate that element for the game. But in other cases, the version that comes first (First In, Only Served; FIOS)/last (Last In, Only Served; LIOS) will be used instead.<ref>https://forum.paradoxplaza.com/forum/index.php?threads/object-types-that-can-be-replaced-in-separate-files.990537/</ref> The order in which files are processed is based on ASCIIbetical order of the filenames. If the names are the same, they'll be processed based on the reverse-ASCIIbetical order of the mod display name, with vanilla always being first (if it's at the ''top'' of the mod list, it'll be loaded ''last''). Note that if there are multiple mods with the same display name, only the one whose mod file comes first, will be used.
 +
 
 +
Note that this feature is not documented and thus might be subject to arbitrary changes between versions.
 +
 
 +
{{SVersion|2.5}}
 +
 
 +
=== Common folder ===
 +
 
 +
{{box wrapper}}
 +
{| class="mw-collapsible wikitable" style="float: left; margin-left: 10px;"
 +
|+ A-N (Agendas – Notification<br>Modifiers)
 +
|-
 +
! File Type
 +
! Overwrite<br>Type
 +
! Error Log
 +
! Notes
 +
|-
 +
| Agendas
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| AI Budget
 +
|
 +
|
 +
|
 +
|-
 +
| Ambient Objects
 +
|
 +
|
 +
|
 +
|-
 +
| Anomalies
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Armies
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Artifact Actions
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Ascension Perks
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Asteroid Belts
 +
|
 +
|
 +
|
 +
|-
 +
| Attitudes
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Bombardment Stances
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Buildings
 +
| LIOS
 +
| Object key already exists
 +
| Breaks auto-<br>generated modifiers
 +
|-
 +
| Button Effects
 +
|
 +
|
 +
|
 +
|-
 +
| Bypass
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Casus Belli
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Colony Types
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Colors
 +
|
 +
|
 +
|
 +
|-
 +
| Component Sets
 +
| FIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Component Tags
 +
|
 +
|
 +
|
 +
|-
 +
| Component Templates
 +
| FIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Country Customization
 +
|
 +
|
 +
|
 +
|-
 +
| Country Types
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Decisions
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| style="height: 90px" | Defines
 +
| LIOS
 +
| {{small|''[none]''}}
 +
| The block the define is<br>in must be included as well.<br>E.g: ''NGameplay = {<br>POLICY_YEARS = 10 }''
 +
|-
 +
| Deposit Categories
 +
|
 +
|
 +
|
 +
|-
 +
| Deposits
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Diplomatic Phrases
 +
|
 +
|
 +
|
 +
|-
 +
| Diplomatic Economy
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Diplomatic Actions
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| style="height: 45px" | Districts
 +
| LIOS
 +
| Object key already exists
 +
| Breaks auto-<br>generated modifiers
 +
|-
 +
| Economic Categories
 +
|
 +
|
 +
|
 +
|-
 +
| Edicts
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| style="height: 45px" | Ethics
 +
| LIOS
 +
| {{small|''[none]''}}
 +
| Might break "selected<br>ethic" graphic
 +
|-
 +
| Event Chains
 +
| FIOS
 +
| {{small|''[none]''}}
 +
|
 +
|-
 +
| Fallen Empires
 +
|
 +
|
 +
|
 +
|-
 +
| Game Rules
 +
| LIOS
 +
| {{small|''[none]''}}
 +
|
 +
|-
 +
| Global Ship Designs
 +
| FIOS
 +
| A ship design already exists
 +
|
 +
|-
 +
| Governments
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| ├───Authorities
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| └───Civics
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Graphical Culture
 +
|
 +
|
 +
|
 +
|-
 +
| Leader Classes
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Mandates
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Map Modes
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Megastructures
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Name Lists
 +
|
 +
|
 +
|
 +
|-
 +
| Notification Modifiers
 +
|
 +
|
 +
|
 +
|}
 +
{| class="mw-collapsible wikitable" style="float: left; margin-left: 10px;"
 +
|+ O-Z (Observation Station<br>Missions – War Goals)
 +
|-
 +
! File Type
 +
! Overwrite<br>Type
 +
! Error Log
 +
! Notes
 +
|-
 +
| Observation Station Missions
 +
|
 +
|
 +
|
 +
|-
 +
| style="height: 46px" | On Actions
 +
| NO
 +
| {{small|''[none]''}}
 +
| Cannot modify<br>existing entries
 +
|-
 +
| Opinion Modifiers
 +
| DUPL/LIOS
 +
| {{small|''[none]''}}
 +
| <code>add_opinion_modifier</code> is LIOS
 +
|-
 +
| Personalities
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Planet Classes
 +
| LIOS
 +
| {{small|''[none]''}}
 +
|
 +
|-
 +
| Planet Modifiers
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Policies
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Pop Categories
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Pop Faction Types
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| style="height: 46px" | Pop Jobs
 +
| LIOS [?]
 +
| {{small|''[none]''}}
 +
| Breaks auto-<br>generated modifiers
 +
|-
 +
| Precursor Civilizations
 +
|
 +
|
 +
|
 +
|-
 +
| Random Names
 +
|
 +
|
 +
|
 +
|-
 +
| Scripted Effects
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Scripted Localisation
 +
|
 +
|
 +
|
 +
|-
 +
| Scripted Triggers
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Scripted Variables
 +
| FIOS
 +
| Variable name taken
 +
|
 +
|-
 +
| Section Templates
 +
| FIOS
 +
| Duplicate section template found
 +
|
 +
|-
 +
| Sector Focuses
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Sector Types
 +
|
 +
|
 +
|
 +
|-
 +
| Ship Behaviors
 +
| FIOS
 +
| Behavior name already exists
 +
|
 +
|-
 +
| Ship Sizes
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Solar System Initializers
 +
| FIOS
 +
| Initializer already exists
 +
|
 +
|-
 +
| Special Projects
 +
| FIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| style="height: 46px" | Species Archetypes
 +
| LIOS
 +
| Object key already exists
 +
| Breaks auto-<br>generated modifiers
 +
|-
 +
| Species Classes
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Species Names
 +
|
 +
|
 +
|
 +
|-
 +
| style="height: 46px" | Species Rights
 +
| LIOS
 +
| Object key already exists
 +
| Effect tooltips are<br>independent of the effects
 +
|-
 +
| Star Classes
 +
| FIOS
 +
|
 +
|
 +
|-
 +
| Starbase Buildings
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Starbase Levels
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Starbase Modules
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Starbase Types
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| style="height: 69px" | Start Screen Messages
 +
| FIOS
 +
| {{small|''[none]''}}
 +
| The first valid part for each<br>location will be used and the<br>rest discarded without issue.
 +
|-
 +
| Static Modifiers
 +
| FIOS
 +
| {{small|''[none]''}}
 +
|
 +
|-
 +
| Strategic Resources
 +
| FIOS
 +
| {{small|''[none]''}}
 +
|
 +
|-
 +
| Subjects
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| System Types
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| Technology
 +
| LIOS
 +
| Duplicate technology
 +
|
 +
|-
 +
| └───Tiers
 +
| LIOS
 +
|
 +
|
 +
|-
 +
| Terraform (Links)
 +
| DUPL
 +
| {{small|''[none]''}}
 +
|
 +
|-
 +
| Trade Conversions
 +
| LIOS
 +
| Object key already exists
 +
| Trade Policy
 +
|-
 +
| Tradition Categories
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|-
 +
| style="height: 46px" | Traditions
 +
| LIOS
 +
| Object key already exists
 +
| Effect tooltips are<br>independent of the effects
 +
|-
 +
| Traits
 +
| DUPL
 +
| {{small|''[none]''}}
 +
|
 +
|-
 +
| War Goals
 +
| LIOS
 +
| Object key already exists
 +
|
 +
|}
 +
{{end box wrapper}}
 +
FIOS – First in, only served
 +
 
 +
LIOS – Last in, only served
 +
 
 +
DUPL – Duplicates
 +
 
 +
NO – Cannot individually overwrite
 +
 
 +
Please note that not everything could be tested extensively.
 +
 
 +
=== Localisation folder ===
 +
 
 +
Localisation is likely LIOS
 +
 
 +
A guide for overwriting localisation can be found [[Localisation modding#Overwriting Vanilla Text|here]].
 +
 
 +
=== Events folder ===
  
In rare cases it is possible to override a specific game element, without needing to replace the entire vanilla file. In many cases adding a similar identifier element into another file will duplicate that element for the game. But in these rare cases the version that comes first (First in, only Served; FIOS)/last (Last in, only Served; LIOS) will be used instead. <ref>https://forum.paradoxplaza.com/forum/index.php?threads/object-types-that-can-be-replaced-in-separate-files.990537/</ref>. The order in wich files are processed appears to be based on ASCII order of the filenames.
+
Events are treated as FIOS
  
Note that this feature is not documented and thus might be subject to arbitrarily changes between versions.
+
=== Interface folder ===
  
Specific cases:
+
Interface is likely LIOS
* Game Rules (00_rules.txt): LIOS
 
* Policies (00_policies.txt): LIOS
 
* Scripted Triggers (00_scripted_triggers.txt): LIOS
 
* Species rights (species_rights.txt): LIOS
 
* Localisations: create a folder 'common/localisation/replace' and put any replaced string into '<new_file>_l_<language>.yml'
 
* Defines: Can be overwritten if the complete block is included, e.g. <code>NGameplay = { PRESCRIPTED_PLANETS_NUM = 0 }</code>
 
* Buildings: However the Upgrade Options will list multiple variants, despite only one being used
 
* Events: FIOS; Will produce a error in the gamelog when vanilla version is reached (this can help you confirm that the correct file is being overwritten)
 
* Static modifiers: FIOS, no error in log.
 
* Civics: LIOS; Tooltips might display both versions requirements and effects.
 
* Art Assets (gfx): Confiremd only for Planets, LIOS<ref>https://forum.paradoxplaza.com/forum/index.php?threads/object-types-that-can-be-replaced-in-separate-files.990537/#post-23267665</ref>
 
* Spaceport Modules: LIOS; Will produce a error in the gamelog
 
* Ascension Perks: LIOS; Will produce a error in the gamelog
 
* On Actions: These are cumulative. So to overwrite Vanilla, you'd have to overwrite the whole file. However, to add a new event being called, you just need a file with the individual on action calling only this particular event. Random events are also cumulative here, i.e. all lists of random events for the particular on action are added together and one option is selected from the consolidated list.
 
* Diplomatic actions (00_actions.txt): Appears to be LIOS (non-extensively tested)
 
  
Guaranteed Duplication:
+
== Tools & utilities ==
* Component templates
 
* Edicts
 
* Ethics
 
* Ship sizes
 
* Technologies: While technologies seem not duplicated, it might break the appearance of other Technologies. Including gateway technologies (e.g. "cruisers" tech).
 
* Traits
 
* War Demands: While only one will appear, the effects for all versions are executed.
 
  
==Tools & utilities==
+
* [http://notepad-plus-plus.org/ Notepad++] Powerful editor to change files.
* [http://notepad-plus-plus.org/ Notepad++] - Powerful editor to change files.
+
* [http://winmerge.org/ WinMerge] Contrasts the difference between two text files. Useful for updating mods.
* [http://winmerge.org/ WinMerge] - Contrasts the difference between two text files. Useful for updating mods.
+
* [https://code.visualstudio.com/ VS Code] Powerful, hackable, free open source editor from Microsoft.
* [https://code.visualstudio.com/ VS Code] - Powerful, hackable, free open source editor from Microsoft.
+
* [[Maya exporter]] Clausewitz Maya Exporter to create your own 3D models.
* [[Maya exporter]] - Clausewitz Maya Exporter to create your own 3D models.
+
* [https://github.com/a1studmuffin/SpaceshipGenerator/ Spaceship Generator] A Blender script to procedurally generate 3D spaceships
* [https://github.com/a1studmuffin/SpaceshipGenerator/ Spaceship Generator] - A Blender script to procedurally generate 3D spaceships
+
* [https://forum.paradoxplaza.com/forum/index.php?threads/modding-tool-retalyx-stellaris-static-galaxy-generator-v0-9.951308/ Static Galaxy Generator] A static galaxy generator and editor for your mods. ([https://steamcommunity.com/sharedfiles/filedetails/?id=699098812 How to use])
* [https://forum.paradoxplaza.com/forum/index.php?threads/modding-tool-retalyx-stellaris-static-galaxy-generator-v0-9.951308/ Static Galaxy Generator] - A static galaxy generator and editor for your mods. ([https://steamcommunity.com/sharedfiles/filedetails/?id=699098812 How to use])
+
* [[Steam Workshop]] The place for where you can share your creations with other players.
* [[Steam Workshop]] - The place for where you can share your creations with other players.
+
* [https://www.sublimetext.com/ Sublime Text] Powerful, moddable, hackable text editor. Install packages as your needs evolve.
* [https://www.sublimetext.com/ Sublime Text] - Powerful, moddable, hackable text editor. Install packages as your needs evolve.
 
 
* [https://reddit.com/r/StellarisMods Stellaris Modding Subreddit]
 
* [https://reddit.com/r/StellarisMods Stellaris Modding Subreddit]
* [https://discord.gg/bHVez2C The Stellaris Modding Den] - the central modding discord for Stellaris.
+
* [https://discord.gg/bHVez2C The Stellaris Modding Den] the central modding discord for Stellaris.
 +
* [https://docs.google.com/document/d/17knnrF_RzaVFo_s66360m7rCypSH6yMTymA8B0jpTog/edit Paradox Graphics – A Comprehensive Guide] – In-depth documentation for preparing 3d models for Clausewitz engine games like Stellaris.
 +
 
 +
== Advanced tips ==
 +
 
 +
* For the bigger mods using a source control management tool (Git, …), it is handy to create a symbolic link between Stellaris mod folder and the working directory of the local repository, especially if the mod also has sub-mods. Note that you'll still need to copy the .mod file(s) manually, but they rarely change. Run the following command from the parent directory of main git folder, replacing:
 +
** <mod_path_name> by the value of <code>path</code> attribute from .mod file
 +
** <git_mod_folder> by the name of the sub-folder that contain mod data (folders common, decisions, events, etc…)
 +
mklink /J "%USERPROFILE%\Documents\Paradox Interactive\Stellaris\mod\<mod_path_name>" ".\<git_mod_folder>"
 +
 
 +
=== Testing Mods ===
 +
 
 +
Certain, more obscure [[Console commands]] (that don't show up if you type 'help' in the console) are extremely useful in the process of testing a mod and more specific alterations.
 +
* <code>observe</code> – switches you to Observer Mode. You will no longer play as any specific character – this will allow the game to run for a long period of time, uninterrupted. It also makes every invisible trait and secret religion visible.
 +
* <code>run</code> <filename.txt> – runs script in a txt file located in the in the Documents install directory. It will be executed from the player's scope. Useful for testing tricky scripts – you can just have the script open in a different window, run it, tweak the script, save it, and run it again – it will be recompiled every time.
 +
* <small><s><code>reloadevents</code> – reloads and recompiles every single event (may take a while depending on your hardware). Useful if you want to tweak an entire event or chain of events without rebooting the game every time.</s> not yet implemented</small>
 +
* <small><s><code>reloadloc</code></s><code>reload text</code></small> – reloads the entire localisation table. Useful if you spot a typo while testing your mod, or if you are trying to fit as much text in an event frame as possible.
  
==External links==
+
== External links ==
[https://forum.paradoxplaza.com/forum/index.php?threads/stellaris-dev-diary-31-modding-scripting-anomalies.923348/ Stellaris Dev Diary #31 - Modding (Scripting Anomalies)]
 
<br />[https://forum.paradoxplaza.com/forum/index.php?threads/stellaris-dev-diary-32-modding-art.924762/ Stellaris Dev Diary #32 - Modding art]
 
  
==See also==
+
[https://forum.paradoxplaza.com/forum/index.php?threads/stellaris-dev-diary-31-modding-scripting-anomalies.923348/ Stellaris Dev Diary #31 – Modding (Scripting Anomalies)]<br>[https://forum.paradoxplaza.com/forum/index.php?threads/stellaris-dev-diary-32-modding-art.924762/ Stellaris Dev Diary #32 – Modding art]
 +
 
 +
== See also ==
  
 
*[[Mods]]
 
*[[Mods]]
  
 
== References ==
 
== References ==
 
 
<references />
 
<references />
  
  
 +
{{ModdingNavbox}}
 
[[Category:Modding|#]]
 
[[Category:Modding|#]]

Revision as of 10:45, 26 July 2020

Version

Outliner top.png
Please help with verifying or updating older sections of this article. At least some were last verified for version 2.5.

This article is for the PC version of Stellaris only.

Modding, or creating mods, is the act of modifying the behavior of the base game (often referred to as vanilla), either for personal use, or to release publicly to other players, for instance via the Steam Workshop.

As with all Paradox games, Stellaris is moddable to a great extent. Motivations of modders may vary widely; better translation to native language, more events or decisions, better map, major overhaul, shameless cheating, etc.

This guide is intended to lower the entry barriers to the world of Stellaris modding. However, there is still a learning curve to it, and it cannot replace the need to read some working vanilla code, and do lots of trial and error experimentation!

Guidelines

  • Create a mod for your modifications: use a personal mod even for small changes, and never directly modify the game files in the Steam Stellaris folder, as they may be overwritten without warning.
  • Use a good text editor (recommended: Visual Studio Code) to edit files and search into multiple files. A good text editor can also format the displayed text so that braces can be collapsed if complete, and complete/incomplete pairs are highlighted.
  • Use the Error.log file to get execution errors: The log folder can be found right next to the mod folder. Good Editors usually have the ability to track changes to files from outside the program and prompt for a reload, thus showing you errors with one glance at the file. Note that some modifications need a game to be loaded or even the option to be used on screen/in the back-end before their code will run.
  • Use CWTools for advanced validation and auto-complete: CWTools is a syntax validator for Stellaris modding, developed as an extension for Visual Studio Code and also available for Sublime. Read the forum post by the developer for more info.
  • Minimize overwrites of vanilla files, unless that is your main goal or somehow necessary (on_action triggers). Adding separate files and use loading from folders whenever possible, to improve mod compatibility and maintenance. Your files can have any name, all files in the folder will be loaded by the game. So choose a prefix no one else will ever use like the name of your mod. Even DLC follows that pattern.
  • Use a proper merge tool (like WinMerge, or the Visual Studio Code Extension L13 Diff ), to merge between folders, and update modified vanilla files to a new vanilla patch.
  • Backup your work to avoid losing everything. Consider using a source control system like Git and a collaborative forge like GitHub to manage team collaboration.
  • Use UTF-8 encoding for text and .mod files.
  • Use UTF-8 with BOM for localization and name list files.
  • Indent properly and, again, use a good text editor, to easily spot unclosed curly braces. Vanilla uses 1 tab for indentation rather than spaces.
  • Use comments starting with a # character, to remember your reasons for writing tricky stuff.

Mod management

The first steps of modding is getting to know where the mods are located, how they're structured and what to do when uploading your first mod!

Mod folder location

OS Path
Linux ~/.local/share/Paradox Interactive/Stellaris/mod
Windows …\Documents\Paradox Interactive\Stellaris\mod
Mac OS ~/Documents/Paradox Interactive/Stellaris/mod

Mods from the Steam Workshop will be placed in …\SteamLibrary\SteamApps\workshop\content\281990, sorted by their Workshop ID.
Mods from Paradox Mods will be placed in the mod folder location, named PDX_*MOD_ID*.

File and folder structure

Getting the structure set up correctly when creating a mod is essential for it to run properly.

This is the required structure inside the main mod folder:

  • modname.mod – Includes the information used by the Stellaris launcher
  • modname – Folder where all the modified files are placed, in the same file and folder structure as the game folder
    • Mod contents
    • descriptor.mod – Required for the new launcher added in patch 2.4. Ignored in the old launcher.
    • image.ext – PNG and JPEG files are supported. With the new 2.4 launcher, must be a PNG named thumbnail.png

modname.mod and descriptor.mod both contain the mod information that the launcher uses when displaying the mod and uploading it.
The 2.4 launcher prefers descriptor.mod and will modify modname.mod to match the information in descriptor.mod, however if the file is not found, it'll use the information in modname.mod. The pre-2.4 launcher ignores it.
The path="XXX" is not needed in descriptor.mod.
Note that folder and file names are case sensitive on Mac OS X and Linux.

modname.mod structure
This also applies to descriptor.mod.

Name Required Description Example
name Yes Name of your mod. name="My Stellaris Mod"
path modname.mod: Yes
descriptor.mod: No (Ignored)
Defines which folder is the mod's folder. It is relative to …\Documents\Paradox Interactive\Stellaris\ folder. path="mod/MyStellarisMod"
dependencies No Specifies if the mod should be loaded after the listed mod(s), if they exist.
Very useful for submods or compatibility patches to make sure they overrule certain mods.
dependencies={
	"My Other Stellaris Mod"
	"Not My Stellaris Mod"
}
picture No Specifies the mod thumbnail used on Steam Workshop. With the new 2.4 launcher, this must be a PNG file named thumbnail.png. picture="thumbnail.png"
tags No List of tags for Steam Workshop. Using tags besides the predefined ones may prevent uploading on Paradox Mods.
Warning: don't forget quotes for tags that contain spaces.
tags={
	"Tag1"
	"Tag2"
}
supported_version Recommended Specifies what game version the mod supports.
The last number can be replaced with the asterisk (*) symbol to tell the launcher that mod supports any value, like 2.4.*.
Only the last number supports this.
supported_version="2.4.1"
remote_file_id No Property added by the launcher that includes the Steam Workshop ID. Ignore it. remote_file_id="1234567890"

The data structure is similar to the proprietary Valve Data Format.[1]

Example modname.mod file

name="Somemod"
path="mod/somemod"
dependencies={
	"othermod"
	"another mod"
}
tags={
	"Graphics"
	"Economy"
	"Overhaul"
}
picture="thumbnail.png"
remote_file_id="1234567890"
supported_version="2.4.*"

Adding a thumbnail

The Steam Workshop allows for a preview thumbnail picture that'll be displayed when searching for mods and as a preview picture if you haven't uploaded any, otherwise it'll be placed to the right of the preview pictures.
It's recommended to make the thumbnail 512px × 512px at minimum, which is used by the workshop frontpage.
Additionally, the thumbnail file should be under 1 MB in size, otherwise, it will not be uploaded.
Both JPEG and PNG are supported, and after 2.4, the image file must be named thumbnail.png.

  1. Make sure the Stellaris launcher is closed, so that it doesn't revert your changes
  2. Open up modname.mod and descriptor.mod files
  3. Make sure picture="thumbnail.png" exists, if not, add it
  4. Add your image file in your mod folder
  5. Start up the launcher and update your mod
  6. Thumbnail should now show up at the Steam Workshop mod page

You can always update the thumbnail at any time by updating the mod (unless you are only a co-author).

Creating a mod

You can use the game launcher to set up a the mod structure for you by following these simple steps according to your launcher of choice:

# Launcher v1 (<=2.3.3) Launcher v2 (>=2.4.0)
1 Launch the game
2 Navigate to the mods tab
3 Click Mod Tools
4 Click Create Mod
5 Insert the relevant information and click Create Mod at the bottom
6 Navigate to the mod folder and locate your mod folder
7 Start modding!

Uploading and updating a mod

Uploading and updating a mod follows the the same procedure, depending on your launcher of choice:

# Launcher v1 (<=2.3.3) Launcher v2 (>=2.4.0)
1 Launch the game
2 Navigate to the mods tab
3 Click Mod Tools
4 Click Upload Mod Click Upload a Mod
5 Select your mod from the list
6 Click Fetch Info and wait for a response Select mod site
7 Insert description*
8 Click Upload Click Upload Mod
9 The launcher will now upload your changes and inform you when it's done or if an error occurred.
10 Navigate to the mod service of choice and locate your mod;
Steam Workshop, visit the Workshop page, and locate the "Files you've posted" button by hovering over "Your Files" on the right
Paradox Mods, visit the Mods page, login, and click "My uploaded mods" in the dropdown menu that appears when hovering over your name
* - The inserted description will replace the current one used on the mod page!

Note that if you subscribe to an uploaded version of your mod while you still have the .mod file of your original mod in the mods folder, the uploaded mod will likely not work.

Game data

Game structure

Below is a list of game files and folders, listed alongside the modding guide for each.

Stellaris/common/

Folder/File Summary Guides
agendas Agendas are given to leader-candidates in Oligarchic government-forms Agendas
ai_budget Determine how AI should handle resources. AI
ambient_objects References used by code to spawn ambient objects Models
archaeological_site_types Definitions for Archaeological Sites to be discovered and delved by Science Ships. Ancestral Relics
anomalies Events that occur for research ships Anomalies
armies Definitions for army types Armies
army_attachments (Deprecated)
artifact_actions Definitions for Artifact Actions. Ancestral Relics
ascension_perks Definitions for Ascension Perks. Traditions
attitudes Definitions containing the restrictions for each attitude used by the AI AI
bombardment_stances Definitions of bombardment stances. Bombardment Stances
buildable_pops (Deprecated)
buildings Setup for buildings constructable on planets, and those given through events Buildings
button_effects Definitions for button effects. Graphics
bypass Definitions for bypasses (gateway, worm hole and l-gate) Bypasses
casus_belli Definitions for casus belli. Wars
colony_automation Definitions for colony autobuild types. Colony Automations
colony_automation_exceptions Definitions for colony autobuild types. Colony Automations
colors Color definitions used for the country color selection Countries
component_flags (Deprecated)
component_sets List of the sets of components used by ships Ships
component_slot_templates Slot templates to be used with ship sections. Ships
component_tags Used to group components together for common modifiers Ships
component_templates Attribute setup for each weapon and the templates used for ships Ships
country_types Rules for each country within the game. Countries
decisions Definitions for planetary decisions. Decisions
defines Basic game behaviors and settings Defines
deposit_categories Deposit categories relevant to deposit generation. Planet Generation
deposits Setup for the deposits of resources found on planets as well as blockers spawned on habitable planets. Planet Generation
diplo_phrases Setup for the logic behind the diplomatic phrases used between countries. AI
diplomacy_economy Economy units based on diplomacy. Diplomatic upkeeps like influence upkeep of Federations are defined here. Diplomacy
diplomatic_actions Setup for the rules for diplomatic actions. Diplomacy
districts Definitions for districts. Buildings
economic_categories Definitions for economic categories. Economy
economic_plans Definitions for AI economy plans. AI
edicts Setup for the edicts used by countries. Edicts
ethics Setup for ethics, controlling their modifiers and categories Ethics
event_chains Setup for the event chains used in the events folder Event chains
fallen_empires Sets up the countries and system initializer used for fallen empires Systems
federation_law_categories Definitions for federation law categories. Diplomacy
federation_laws Definitions for federation laws. Diplomacy
federation_perks Definitions for federation perks. Diplomacy
federation_types Definitions for federation types. Diplomacy
galactic_focuses Definitions for galactic focuses relevant to the Galactic Community. Diplomacy
game_rules Logic used for various game actions, i.e. can_enslave_pop. Logic here does not override hardcoded rules. Gameplay
global_ship_designs Designs used by the ship designer for each species Ships
governments Setup for the governments. Governments
graphical_culture Controls the lighting used for ships, which differs between graphical cultures. Species
lawsuits Unused.
leader_classes Definitions for leader classes. Leaders
mandates Controls the mandates used by factions Mandates
map_modes Definitions for map modes to be used in the galaxy view. Map Modes
megastructures Definations for megastructures. Megastructures
name_lists Sets up the names used for each species. Species
notification_modifiers A variation of static modifiers. They have no modifiers and can only be added to empires. Static Modifiers
observation_station_missions Actions that can be done with observation stations depending on ethic choices. Gameplay
on_actions Events and actions that happens when you move, or do anything. Events
opinion_modifiers Opinion of Empires on other Empires depending on Political status and Ethics. Opinion Modifiers
personalities Shows the personalities of Empires AI traits and of Fallen Empires and enables editing them. AI
planet_classes The setup for all the planets and stars in the game. Planets
planet_modifiers Spawn chances planet modifiers (f.e. lush, hazardous weather, etc.). Planet Generation
policies AI Policy grabbing (What order they take policies in) Policies
pop_categories Definitions for pop categories (social strata). Pop Jobs
pop_faction_types Population faction types and personalities Pop Factions
pop_jobs Definitions for pop jobs. Pop Jobs
precursor_civilizations Precursor civilization weightings Planets
random_names Lists of random names for Empires Gameplay
relics Definitions for Relics. Ancestral Relics
resolution_categories Definitions for resolution categories relevant to the Galactic Community. Diplomacy
resolutions Definitions for resolutions relevant to the Galactic Community. Diplomacy
scripted_effects Pre-defined blocks of Effects to be called elsewhere. Dynamic
scripted_loc Pre-defined methods to provide text based on the scoped object's attributes. Dynamic
scripted_triggers Pre-defined blocks of Conditions to be called elsewhere. Dynamic
scripted_variables Pre-defined "@" variables to be called from other game files. Dynamic
section_templates Container of components that consist actual ships. Ship
sector_focuses Types of sectors and how they act. Colony Automations
sector_types Types of sectors and how they act. Colony Automations
ship_behaviours Standard ship behaviours. Ship
ship_sizes Sizes of the Ships. Ship
solar_system_initializers Defines starting systems for players, AI, event systems, hostile systems, etc. Systems
spaceport_modules (Deprecated)
special_projects Special Projects
species_archetypes Definitions for species archetypes to give some shared attributes to species classes. Species
species_classes Definitions for species classes that are sets of species portraits. Species
species_names Definitions for species random names. Species
species_rights Definitions for species rights. Species
star_classes Types of solar systems (NOT individual stars themselves!) Systems
starbase_buildings Definitions for starbase buildings that each starbase can only have one of each of them. Starbases
starbase_levels Definitions for starbase levels. Starbases
starbase_modules Definitions for starbase modules. Starbases
starbase_types Definitions for starbase types. To players, no effects, flavor only. To the AI, a starbase auto-build guide. Starbases
start_screen_messages Messages that should be shown to the player at the start of the game. Gameplay
static_modifiers Blocks of Modifiers to be added to objects. Static Modifiers
strategic_resources Definitions for resources, not just strategic resources. Economy
subjects Definitions for subject types. Diplomacy
system_types Definitions for system types. No effects, flavor only. Starbases
technology Definitions for technologies. Technology
terraform Definitions for terraform methods. Planets
trade_conversions Definitions for trade value conversions. Economy
tile_blockers (Deprecated)
tradition_categories Definitions for tradition groups. Traditions
traditions Definitions for traditions. Traditions
traits Definitions for species traits and leader traits. Traits
triggered_modifiers (Deprecated)
war_demand_counters (Deprecated)
war_demand_types (Deprecated)
war_goals Definitions for war goals. Wars
achievements.txt Definitions for achievements. Modding this file doesn't make sense, since achievements are disabled for any "common" changing/expanding mods anyway.
alerts.txt Messages
message_types.txt Messages

Stellaris/events/

Folder/File Summary Guides
example_events.txt Contains the event code for a set of events. Events

Stellaris/flags/

Folder/File Summary Guides
*.dds A flag image file. Flags
colors.txt Sets up the allowed colors for flags and the randomizable combos. Flags

Stellaris/fonts/

File Summary Guides
fonts.asset Sets up the fonts used by the game. Fonts

Stellaris/gfx/

Folder/File Summary Guides
advisorwindow Sets up the 3D view for the advisor Graphics
arrows Contains the images used by various arrows ingame. Graphics
cursors Contains the cursor files/images used ingame. Graphics
event_pictures Contains the pictures used in events. Events
fonts Contains the font files used ingame. Fonts
FX Contains the FX shaders used ingame. Graphical Effect
interface/ Contains the images used for interfaces ingame. Graphics
interface/anomaly Contains the images used for the anomaly mechanic Graphics
interface/buttons Contains the images used for buttons Graphics
interface/diplomacy Contains the images used for the diplomacy interface. Graphics
interface/elections Contains the images used for the election interface. Graphics
interface/event_window Contains the images used for the event window. Graphics
interface/flags Contains the image masks used for flags. Graphics
interface/fleet_view Contains the images used for fleets. Graphics
interface/frontend Contains the images used for the frontend interface. Graphics
interface/government_mod_window Contains the images used for the government modification interface. Graphics
interface/icons Contains the icons used for everything in the game. Graphics
interface/main Contains the images used for generic actions. Graphics
interface/old Contains the images used from EU4 Graphics
interface/outliner Contains the images used for the outliner interface. Graphics
interface/planetview Contains the images used for the planet view interface. Graphics
interface/progressbars Contains the images used for progress bars ingame. Graphics
interface/ship_designer Contains the images used for the ship designer interface. Graphics
interface/situation_log Contains the images used for the situation log interface. Graphics
interface/sliders Contains the images used for sliders ingame. Graphics
interface/system Contains the images used for the system view interface. Graphics
interface/tech_view Contains the images used for the technology view interface. Graphics
interface/tiles Contains the images used for the tile view interface. Graphics
interface/topbar Contains the images used for the topbar interface. Graphics
interface/waroverview Contains the images used for the war view interface. Graphics
keyicons Contains the images used for button presses ingame. Graphics
lights Contains the logic used for the light effects ingame. Graphical Effect
loadingscreens Contains the images used for loadscreens. Graphics
models Contains the model .mesh files and images. Models
models/portraits Contains the portrait .mesh files and images. Portraits
particles Contains the logic and images used for particles. Graphics
pingmap Contains the logic used for pings. Graphics
portraits Contains the logic used for portrait images. Portraits
projectiles Contains the logic used for projectiles. Graphics
shipview Contains the logic used for ship view. Graphics
worldgfx Contains the logic and images used for world graphic effects. Graphics

Stellaris/interface/

Folder Summary Guides
*.gfx Controls the assignment of image to interface variable. Interfaces
*.gui Controls the visual logic of an interface. Interfaces

Stellaris/localisation/

File Summary Guides
*l_simp_chinese.yml Contains Chinese localisation Localisation
*l_english.yml Contains English localisation Localisation
*l_french.yml Contains French localisation Localisation
*l_german.yml Contains German localisation Localisation
*l_polish.yml Contains Polish localisation Localisation
*l_russian.yml Contains Russian localisation Localisation
*l_spanish.yml Contains Spanish localisation Localisation
*l_braz_por.yml Contains Brazilian/Portuguese localisation Localisation

Stellaris/map/

Folder/File Summary Guides
galaxy Contains the galaxy options. You cannot add new ones currently. Galaxies
setup_scenarios Controls the logic for different sizes of galaxies. Galaxies

Stellaris/music/

Folder/File Summary Guides
*.ogg A music file. Music
songs.asset Controls the assignment of music to a code name, and sets the volume of playback. Music
songs.txt Music

Stellaris/prescripted_countries/

Folder/File Summary Guides
*.txt Contains a pre-scripted setup for a country. Listed on the side ingame. Galaxies
setup_scenarios Controls the logic for different sizes of galaxies. Galaxies

Stellaris/sound/

Folder/File Summary Guides
*.asset Sets up sounds. Sound
*.wav A sound file. Sound

Overwriting Specific Elements

Occasionally, it is possible to overwrite a specific game element without needing to replace the entire vanilla file. In some cases adding an element with a similar identifier into another file will duplicate that element for the game. But in other cases, the version that comes first (First In, Only Served; FIOS)/last (Last In, Only Served; LIOS) will be used instead.[2] The order in which files are processed is based on ASCIIbetical order of the filenames. If the names are the same, they'll be processed based on the reverse-ASCIIbetical order of the mod display name, with vanilla always being first (if it's at the top of the mod list, it'll be loaded last). Note that if there are multiple mods with the same display name, only the one whose mod file comes first, will be used.

Note that this feature is not documented and thus might be subject to arbitrary changes between versions.

Common folder

A-N (Agendas – Notification
Modifiers)
File Type Overwrite
Type
Error Log Notes
Agendas LIOS Object key already exists
AI Budget
Ambient Objects
Anomalies LIOS Object key already exists
Armies LIOS Object key already exists
Artifact Actions LIOS Object key already exists
Ascension Perks LIOS Object key already exists
Asteroid Belts
Attitudes LIOS Object key already exists
Bombardment Stances LIOS Object key already exists
Buildings LIOS Object key already exists Breaks auto-
generated modifiers
Button Effects
Bypass LIOS Object key already exists
Casus Belli LIOS Object key already exists
Colony Types LIOS Object key already exists
Colors
Component Sets FIOS Object key already exists
Component Tags
Component Templates FIOS Object key already exists
Country Customization
Country Types LIOS Object key already exists
Decisions LIOS Object key already exists
Defines LIOS [none] The block the define is
in must be included as well.
E.g: NGameplay = {
POLICY_YEARS = 10 }
Deposit Categories
Deposits LIOS Object key already exists
Diplomatic Phrases
Diplomatic Economy LIOS Object key already exists
Diplomatic Actions LIOS Object key already exists
Districts LIOS Object key already exists Breaks auto-
generated modifiers
Economic Categories
Edicts LIOS Object key already exists
Ethics LIOS [none] Might break "selected
ethic" graphic
Event Chains FIOS [none]
Fallen Empires
Game Rules LIOS [none]
Global Ship Designs FIOS A ship design already exists
Governments LIOS Object key already exists
├───Authorities LIOS Object key already exists
└───Civics LIOS Object key already exists
Graphical Culture
Leader Classes LIOS Object key already exists
Mandates LIOS Object key already exists
Map Modes LIOS Object key already exists
Megastructures LIOS Object key already exists
Name Lists
Notification Modifiers
O-Z (Observation Station
Missions – War Goals)
File Type Overwrite
Type
Error Log Notes
Observation Station Missions
On Actions NO [none] Cannot modify
existing entries
Opinion Modifiers DUPL/LIOS [none] add_opinion_modifier is LIOS
Personalities LIOS Object key already exists
Planet Classes LIOS [none]
Planet Modifiers LIOS Object key already exists
Policies LIOS Object key already exists
Pop Categories LIOS Object key already exists
Pop Faction Types LIOS Object key already exists
Pop Jobs LIOS [?] [none] Breaks auto-
generated modifiers
Precursor Civilizations
Random Names
Scripted Effects LIOS Object key already exists
Scripted Localisation
Scripted Triggers LIOS Object key already exists
Scripted Variables FIOS Variable name taken
Section Templates FIOS Duplicate section template found
Sector Focuses LIOS Object key already exists
Sector Types
Ship Behaviors FIOS Behavior name already exists
Ship Sizes LIOS Object key already exists
Solar System Initializers FIOS Initializer already exists
Special Projects FIOS Object key already exists
Species Archetypes LIOS Object key already exists Breaks auto-
generated modifiers
Species Classes LIOS Object key already exists
Species Names
Species Rights LIOS Object key already exists Effect tooltips are
independent of the effects
Star Classes FIOS
Starbase Buildings LIOS Object key already exists
Starbase Levels LIOS Object key already exists
Starbase Modules LIOS Object key already exists
Starbase Types LIOS Object key already exists
Start Screen Messages FIOS [none] The first valid part for each
location will be used and the
rest discarded without issue.
Static Modifiers FIOS [none]
Strategic Resources FIOS [none]
Subjects LIOS Object key already exists
System Types LIOS Object key already exists
Technology LIOS Duplicate technology
└───Tiers LIOS
Terraform (Links) DUPL [none]
Trade Conversions LIOS Object key already exists Trade Policy
Tradition Categories LIOS Object key already exists
Traditions LIOS Object key already exists Effect tooltips are
independent of the effects
Traits DUPL [none]
War Goals LIOS Object key already exists

FIOS – First in, only served

LIOS – Last in, only served

DUPL – Duplicates

NO – Cannot individually overwrite

Please note that not everything could be tested extensively.

Localisation folder

Localisation is likely LIOS

A guide for overwriting localisation can be found here.

Events folder

Events are treated as FIOS

Interface folder

Interface is likely LIOS

Tools & utilities

Advanced tips

  • For the bigger mods using a source control management tool (Git, …), it is handy to create a symbolic link between Stellaris mod folder and the working directory of the local repository, especially if the mod also has sub-mods. Note that you'll still need to copy the .mod file(s) manually, but they rarely change. Run the following command from the parent directory of main git folder, replacing:
    • <mod_path_name> by the value of path attribute from .mod file
    • <git_mod_folder> by the name of the sub-folder that contain mod data (folders common, decisions, events, etc…)
mklink /J "%USERPROFILE%\Documents\Paradox Interactive\Stellaris\mod\<mod_path_name>" ".\<git_mod_folder>"

Testing Mods

Certain, more obscure Console commands (that don't show up if you type 'help' in the console) are extremely useful in the process of testing a mod and more specific alterations.

  • observe – switches you to Observer Mode. You will no longer play as any specific character – this will allow the game to run for a long period of time, uninterrupted. It also makes every invisible trait and secret religion visible.
  • run <filename.txt> – runs script in a txt file located in the in the Documents install directory. It will be executed from the player's scope. Useful for testing tricky scripts – you can just have the script open in a different window, run it, tweak the script, save it, and run it again – it will be recompiled every time.
  • reloadevents – reloads and recompiles every single event (may take a while depending on your hardware). Useful if you want to tweak an entire event or chain of events without rebooting the game every time. not yet implemented
  • reloadlocreload text – reloads the entire localisation table. Useful if you spot a typo while testing your mod, or if you are trying to fit as much text in an event frame as possible.

External links

Stellaris Dev Diary #31 – Modding (Scripting Anomalies)
Stellaris Dev Diary #32 – Modding art

See also

References

  1. VDF is a ad-hoc file format designed by Valve to support storage of hierarchical data, which is also used by Steam. Open VDF parser: https://github.com/rossengeorgiev/vdf-parser/, for .NET
  2. https://forum.paradoxplaza.com/forum/index.php?threads/object-types-that-can-be-replaced-in-separate-files.990537/


Empire EmpireEthicsGovernments • Civics • OriginsMandatesAgendasTraditions • Ascension PerksEdictsPoliciesRelicsTechnologiesCustom Empires
Pops JobsFactions
Leaders LeadersLeader Traits
Species SpeciesSpecies Traits
Planets PlanetsPlanetary Feature • Orbital DepositBuildings • DistrictsPlanetary Decisions
Systems SystemsStarbasesMegastructuresBypassesMap
Fleets FleetsShips • Components
Land Warfare ArmiesBombardment Stance
Diplomacy Diplomacy • Federations • Galactic CommunityOpinion ModifiersCasus Belli • War Goals
Events EventsAnomaliesSpecial projectsArchaeological Sites
Gameplay GameplayDefinesResources • Economy
Dynamic modding Dynamic moddingEffectsConditionsScopesModifiersVariablesAI
Media/localisation Maya exporterGraphicsPortraitsFlagsEvent picturesInterfaceIconsMusicLocalisation
Other Console commandsSave-game editingSteam Workshop