Steel Division 2

Steel Division 2

Not enough ratings
Modding SD2
By Spyyre
A simple guide on how to begin modding SD2.
   
Award
Favorite
Favorited
Unfavorite
Important Directories and Official Modding Guide
For a much more in depth tutorial on modding, see:
Eugen's Modding Guide for Steel Division 44[eugensystems.com]
For the most part modding SD2 is very similar to SD44, at least in my experience

Important Directories for modding:

Game Mods folder:
steam\steamapps\common\Steel Division 2\Mods
This is where the mod tools are located and where all of your actual changes will be made

Saved games mod folder:
C:\Users\YourUserName\Saved Games\EugenSystems\SteelDivision2\mod\
This is simply where the game stores your generated mod and its config.ini
Creating A New Mod
First, you must go into the games location on your hard drive:
Right click in steam > properties > local files > browse.

Once that is open in file explorer, go into the "Mods" folder. This is where the mod tools, and soon your very own mod, are located.

Run CreateNewMod.bat, which is located in the base of the Mods folder.
This will open the command prompt and generate a new folder with the mod name you choose.

Open the newly generated folder.
You will see that it is full of a few directories. The folders containing the files that you can edit is essentially anything inside of CommonData or GameData. You can edit the files with any text editor of your choice, I recommend Notepad++

If you are new to modding, take a look through some of the files inside of GameData/Gameplay.
It is probably also important to note for anyone new to code in general that anything with a // in front of it is what is called a comment, which basically means it is ignored by the game. However, I will stick to creating a mod as this is not a coding tutorial.

For a super simple example of a mod, see the bottom description of my mod Reinforce Infantry, or see the guide for permanent corpses which I linked at the bottom of this guide.

When you have made all of the changes that you would like, go to the root of your newly created mods folder (this is where you will see GenerateMod.bat)

Now, run GenerateMod.bat and the mod tools will generate the mod files for you in the saved games mod folder described at the top of this guide.

At that point, if nothing is wrong with the changes you made and you haven't left behind any syntax errors, you should be able to launch the game and enable your mod in the mod center.

NOTE:
When you create a gameplay mod, the DeckFormat in your mods config.ini will most likely be changed to 1. If you would like to keep your decks from vanilla, change this to 0.
Updating Your Mod
When the game updates, you must also update your mod.
Sometimes this simply requires a version change. Sometimes it requires more.
I will cover both scenarios here.

Simple Version Change
If there is a small hotfix or an update that makes no changes to the code that your mod touches, you can get away with simply changing the version number.

Go to your mods generated mod folder, located here:
C:\Users\YourUserName\Saved Games\EugenSystems\SteelDivision2\mod\YourModName

Open the Config.ini that is within your mod's folder, and change ModGenVersion to the latest version of the game.

Done!

Advanced Update
If there is a large update that makes lots of balancing or unit changes, a new DLC releases, or in general makes changes to the same code/units/maps that your mod also makes changes to, then you MUST update your mod with the mod tools.

To do this, go into the mod directory again as stated at the top of this guide, as if you were going to create a new mod.
Once there, open the folder for your mod from when you created it.
Now, simply run UpdateMod.bat.

Once that completes, you shoudld double check that all of your changes are still in place, as in, go open every file you edited and check that it was not overwritten or has been flagged by the mod tools to be addressed.

You can tell if any of your changes have been overwritten or have been flagged by looking at pages 6 and 7 of THIS[eugensystems.com] guide.

Once you have verified that all of your code changes are good to go, run GenerateMod.bat again.

Done! Your mod is now up to date!

NOTE:
Any time you update your mod using the Advanced Update method (any time you run GenerateMod.bat), the DeckFormat in your mods config.ini will most likely be changed to 1. If you would like to keep your decks from vanilla, change this to 0.
Uploading Mod to Steam Workshop
The location of your generated mod files is:
C:\Users\YourUserName\Saved Games\EugenSystems\SteelDivision2\mod\YourModName

This is also the location of the config in which you can change the name or description, change the mod version if needed as described in the section titled Updating Your Mod, or change the DeckFormat.

To upload your mod to steam, put as simply as possible:
Follow the steps under Updating Your Mod
Then run UploadMod.bat.

If you need to update your mod on the workshop in the future, simply repeat these steps:
A. UpdateMod.bat
B. Check for changes/conflicts/overwrites
C. GenerateMod.bat
D. UploadMod.bat

NOTE:
If you want users of your mod to keep their vanilla decks, make sure that DeckFormat = 0 before you run UploadMod.bat (it will get changed to 1 every time you run GenerateMod.bat)
Extra Mod Related Tips
Keeping Custom Decks While Using Mods
Please keep in mind that your decks are linked to which mods you have enabled, so this is still not a guaranteed solution especially if you are changing around mods a lot.

Before starting the game with a mod, get its ID by right clicking in the mod page and copying the page URL. The mod ID is the number at the end of the URL.

Change the following value in the dedicated "config.ini" file found in
"\steamapps\workshop\content\919640\TheModIDYouJustCopied"

DeckFormatVersion = 0;

Unfortunately, you will need to do this every time the mod is updated if the developer didn't already edit it before uploading. They can do this by following my instructions earlier in this guide. If you are wanting to make this change for a mod that you created, simply visit your config.ini as explained earlier in this guide.

Theoretically, if you wanted to keep your decks whilst using several mods at once, you could set the DeckFromatVersion for ALL of your enabled mods to 0.

Out of Date Mods
If a mod you are subscribed to says "out of date" in the mod center and is not being regularly updated by the developer following one of my methods earlier in this guide, you can try manually changing the version number in the mods config similar to how I explained in the section titled "Updating Your Mod".

Before starting the game with the out of date mod, get its ID by right clicking in the mod page and copying the page URL. The mod ID is the number at the end of the URL.

Change the following value in the dedicated "config.ini" file found in
"\steamapps\workshop\content\919640\TheModIDYouJustCopied"

ModGenVersion = Put the current version of the game here;

You can find the current version of the game by launching the game and looking in the bottom left corner on the main menu.

Please keep in mind, like stated in the section "Updating Your Mod", if there are any large changes or updates, this will likely not work, because the mod developer will have to use the mod tools to update their mod, again like I explained in Updating Your Mod - Advanced Update
Thank you for reading my guide