Modding: Basics

From Surviving the Aftermath Wiki
Jump to navigation Jump to search

Installation[edit]

These instructions are not for installing already built mods. This is for installing the tools for mod building. For basic installation you need to download Unity editor (needs to be version 2019.4.18f1) from Unity Website. Also install "Addressables" from Window -> Package Manager.

Download the mod tool project from Github and use the Unity editor to open the project.

There is an example building provided called Fish Factory and it can be tested ingame by picking Mod/Build Mod from top menu. After building, you can launch the game, enter the Mod menu and activate the mod. After this it will show up in-game, in the food building section.

To mod game Events, check out the instructions at Modding: Events.

Basic Mod Setup[edit]

After the project is open in Unity, remove the example content by removing the Fish Factory folder, then create a new Folder in the root of the Assets folder. This will be where the main content for the mod should be added in.

Inside your mod folder, right click and pick Create -> Aftermath -> Mod.

In this asset you can set the name, version and icon for your mod.

Adding content for Mod[edit]

There are multiple types of content you can add into your mod. For now we support adding scripts written with Javascript, new Buildings, new Events and new Localization strings.

To add scripting create a .script file inside your mod folder and insert your javascript into the file. The code will be executed on load time when the mod is active.

To add a new building, right click in the Asset section and select Create->Mod->Building, this will create a BuildingTemplate asset, where the correct settings should be defined for the building. Functionality for the building can be added through Building Properties, which are added from the Create->Aftermath->Data->BuildingProperties menu.

To add an event, create a .event file inside your mod folder and insert event XML into the file as described in the Event Modding section.

To add localization strings, create a .loc file inside your mod folder and add new localization strings in cvs format.

Other assets supported by Unity, such as textures, models etc. can be freely added into the mods folder and linked through the created assets into the game.

Building your Mod[edit]

To build and test your mod ingame, pick Mod->Build Mod from the main toolbar at the top. After building the game suggest either continuing editing the mod or launching the game. In the game you can find the mod in the Mods menu.

Uploading your Mod[edit]

After completing the mod package, it can be uploaded into Paradox Mod service through website: Paradox Mods

Uploading a mod requires a Paradox account to be created.

Adding Mods To The Game[edit]

Go to \Documents\Paradox Interactive\Surviving the Aftermath\ and create a Mods folder.

Copy + Paste the downloaded .mod file(s) from your Downloads folder (or where you downloaded it to) into this Mods folder.

You can rename the mod file to better reflect the file contents if you want, just keep the .mod file extension. If you cannot see the file extension, put a tick in the Filename extension checkbox in the Show/Hide panel, under the View menu.

Start the Launcher. Do not enable Mod in Launcher by clicking Mods. see Current Limitations below for explanation. Instead, click on the "Play" button and then in the game load screen, click MODS menu. Click the mod you wish to use, by placing a tick in the checkbox. Then click BACK.

Current limitations Mods cannot be enabled from the Launcher screen or by using the Subscribe button (nothing happens) on the Paradox Mod page website. As shown in the image below, even with the mods enabled in the Launcher screen, once you go to the Select Mods screen in the game, none of the mods are available. The screen is just blank. As with most other games, you can only have one play-through per loading of the game, meaning you need to Quit the game totally to the Windows Desktop in order to load another Save or to enable another mod. Loading another Save or starting a second NEW game without Quitting to Desktop has always resulted in the game hanging on me and I had to Ctrl+Alt+Del the process or close window from the Taskbar (another reason why I run in Windowed mode while creating mods and testing in-game).

Cannot use a newly downloaded mod in a pre-existing SAVE game. Must always start a NEW game.