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

Warchild421

Captain
99 Badges
Aug 12, 2015
391
91
  • Hearts of Iron IV: By Blood Alone
  • Hearts of Iron IV: No Step Back
This is a Step by Step pictorial guide to creating you first mod. It will be a simple Starting Solar System Mod, but using these steps you will be able to create any number of mods afterwards. The only tool you will need is a text editor, I suggest notepad++ as an first editor.

First Step, use the "Mod Tool" in the launcher:

Capture1.PNG



Type in the name of the Mod you want to create, in this case we will use "Solar Systems". For simplicity on this first mod we will have both Name and Directory called the same thing.

Capture2.PNG


Once you Click the Create Button a Mod will be created in the file:

C:\Users\<user>\Documents\Paradox Interactive\Stellaris\mod

As seen here

Capture3.PNG


Now COPY the "solarsystem" file into the "solarsystem" folder. Once complete edit the solarsystem file INSIDE the folder. Since we are adding a custom solar system and we want a description for it we will also need to add a localization file. The 'path' needs to follow the same 'path' as if it were in the installed game files. Where 'mod' stands in for 'stellaris'

Capture4.PNG


Next we need to mod up a solar system. This first one is just a black hole with one planet with a moon and one asteroid. The text for that can be found in the file at the bottom of the post. You will notice that there are some init_effect for the planet. These are to insure the capital and a few resources are placed. You can copy those or change them to fill all the slots on a planet and any that are left blank will be auto generated randomly. For more modifiers you can look in these game files:

\Stellaris\common\planet_modifiers
\Stellaris\common\planet_classes
\Stellaris\common\buildings
\Stellaris\common\tile_blockers

Once done, using folders create the same 'path' as in the mod file. Saving the system in to there.

Capture5.PNG


Lastly we need create the localisation file. This is to give a description to the system on the planet type selection screen in the species maker. The name of the file is 'solarsystem_l_english.yml' if you speak a different language, ensure the language you pick is supported. The naming convention will be the same. Place the file in the same 'path' for localization as you did for the last file.

Capture3.PNG


Once placed inside the proper file, edit solarsystem_l_english.yml with a texted editor. We will be adding three lines of text to the file. They are:

l_english:
black_hole_system_NAME: "Black Hole"
black_hole_system_DESC: "This is a test system.\n\n$system_initializer_DESC$"

This will give the system a name and description. As you will notice the name here is the same as the name on the system in the Black Hole System file you have previously placed. This is important otherwise the game will not find the name properly.

Once complete you should have a brand new working starter solar system.

Have fun making Mods!
 

Attachments

  • Black Hole System.txt
    2,4 KB · Views: 387
Last edited:
  • 4
  • 2
Reactions:
Lastly we need to add two lines to the localization file. This is to give a description to the system on the planet type selection screen in the species maker. The localization file we want is 'l_english.yml' if you speak a different language than English pick which one you use. The naming convention is the same. Copy the file into the same 'path' for localization as you did for the last file.

Once placed inside the proper file, edit l_english.yml with a texted editor. We will be adding two lines of text to the file. They are:

black_hole_system_NAME:0 "Black Hole"
black_hole_system_DESC:0 "This is a test system.\n\n$system_initializer_DESC$"

add these lines of text near line '7050' for ease of finding for later modding, if you so choose.

One suggestion: you don't need to replace the l_english.yml file; in fact, any YAML file will do. I called mine nameofmod_l_english.yml. The important part is what's in the .yml file; it just needs to start with the l_english: designation, and have the containing lines indented one space.

Code:
l_english:
black_hole_system_NAME: "Black Hole"
black_hole_system_DESC: "This is a test system.\n\n$system_initializer_DESC$"

(the number before the string is also not necessary.)
 
  • 1
Reactions:
One suggestion: you don't need to replace the l_english.yml file; in fact, any YAML file will do. I called mine nameofmod_l_english.yml. The important part is what's in the .yml file; it just needs to start with the l_english: designation, and have the containing lines indented one space.

Code:
l_english:
black_hole_system_NAME: "Black Hole"
black_hole_system_DESC: "This is a test system.\n\n$system_initializer_DESC$"

(the number before the string is also not necessary.)

Awesome! I shall update that part then. even easier then. Thanks
 
did something change from this game and the last games? I never needed the two path notepad docs before?
 
I am having a hard time modding the defines file, CTD each time, and I only change base planet from 5 to 10. guess i'll work some more at it.
 
I'm not seeing an error message, Looks like you just need to hit upload

Its because your mod actually does not exist. You must have deleted it from the workshop.
http://steamcommunity.com/sharedfiles/filedetails/?id=681703120
Thats a link to your mod ID, but theres nothing there.

Sorry, it was old screen, i hide this first mod.
But have this problem again in my second mod.
http://steamcommunity.com/sharedfiles/filedetails/?id=681933510
fe5dffc035.jpg
 
Well that's a tough one then, one way to go around it is to delete the mod from steam, but that will not let people just update it easy. Have you been able to update any of your other mods?
i have this bug in fist my mod. Instead of updating I upload mod again (second one) and hide first version. And get this bug againe.
 
That sounds like it might be a steam issue then, if you cant update any of the mods. I have yet to be able to reproduce it. Had a few people complain on my mods that there was no description when I forgot to delete them quickly.
 
I'm editing the events, and I'm getting this deal here.

Thing is, I've coded a couple other events and they work perfectly fine. I must be missing something simple, but even if I copypaste another event into this one's slot, the text from the localization file doesn't find its way into the game.

Is this a common problem? What's the deal?
 

Attachments

  • Problem.png
    Problem.png
    211,3 KB · Views: 42
I'm editing the events, and I'm getting this deal here.

Thing is, I've coded a couple other events and they work perfectly fine. I must be missing something simple, but even if I copypaste another event into this one's slot, the text from the localization file doesn't find its way into the game.

Is this a common problem? What's the deal?

Make sure that your localisation file is saved as UTF-8. If you're using Windows Notepad, it saves text files as ASCII by default, but the .yml files need to be in unicode. There's a dropdown in the save as dialog, or you can use something like gVim or Notepad++.
 
  • 2
Reactions:
Hey guys, right now I'm working on improving localisation in 2 of my mods - making them more compatible to be precise.
In one of those mods, I want to change existing line to something else, in other I'm adding completely new lines.
Now, in both cases, in my mod folders I made folder localisation, and in them respectively .yml files: modname1_l_english.yml and modname2_l_english.yml.

Here is how first .yml file looks:

l_english:
#improved trading
TRADE_ITEM_HOLD_KEYS:0 "§GHold £ctrl to change 25 per click.\nHold £shift to change 500 per click.§!"

And here is how second .yml file looks:

l_english:
#my edict
edict_my_edict:0 "My Edict"
edict_my_edict_desc:0 "My Edict Description."

Now, the file with my edict is working properly, when I use that mod alone or with the other. But improved trading doesn't work either way. Right now my working mod improved trading has whole l_english.yml just copied with only one line changed and it works, but I wanted to make a file that wouldn't replace whole l_english.yml but only change TRADE_ITEM_HOLD_KEYS.

Can anyone help me do it?