Scenario modding

## Introduction

This guide will explain how to add new scenarios to the game that can be chosen when a new game is started.

Before attempting to add new scenarios in your mod, please read the main modding guide. Especially parts of it about modifying game data sheets will be vital in this case.

## Adding new scenario

Scenarios are defined in Sandbox.xlsx / Campaigns. Below is a sample row from this data sheet.

To add a custom scenario, you will have to first add a new row to this data sheet in your mod with unique ID in the first column.

## Localization

To add title and description to your newly added scenario, add corresponding rows to Locales.xlsx / UI / CampaignSetupUI like in this example:

 U-96 - Description
 u-boats, U-96, launches in Kiel. Leaving its home port behind, it completes a
 very successful patrol on Atlantic, during which manages to sink 7 Allied
 freighters in two convoys. U-96 now arrives to French ports on Atlantic, from
 where its crew will continue a promising career. Skippers among themselves
 call the current period "Happy Times", because Allies don't seem to
 be ready for the fight against modern u-boats.

## Custom Badge

Badges are treated by the game like any other equipment installed on the boat. That means that to create a new badge you will have to create a new item installable on the u-boat. To do so, follow steps below.

1. First you will want to create the badge texture.
	1. You can create only color texture for your badge to get good results. If you like you can also create additional PBR maps as described in the main modding guide to change metallicity, smoothness and other properties of the underlying surface, but it's not necessary.
	2. Textures with your badge need to follow the UV layout of the conning tower texture.
	3. Color texture has to contain transparency in the background. Take a look at the swordfish texture on the right to have a general idea how it should look.
2. Create a new game object in Unity editor. Name it in a descriptive way. In the case of U-96 we used a "Badge Swordfish" name in the game.
3. Add **Skin** component to the game object.
4. Click foldout button on the "Replacement Data" property.
5. Enter 1 in "Size" sub-property. New entry should appear.
6. In the new entry find "Replaced Albedo GUID" sub-property and paste such value into it: 84aaf432495408b40892be127bff4c5b. It will tell the game that you want to overlay something on top of the base conning tower texture.
7. Find your badge textures in Windows Explorer and open their .meta files in a text editor (your textures need to reside inside Unity project at this point). There should be a GUID property somewhere in it. Copy it and paste into corresponding fields in Skin component. "Albedo Transparency GUID" and "Mask GUID" should both contain GUID of your color texture with alpha.
8. Your prefab is ready. Now store it in your mod, by dragging it somewhere into your mod's Package folder. Preferably there: "Assets/Packages/[mod\_name]/Equipment/".
9. Add your new badge to Entities.xlsx / Equipment data sheet to tell the game that your badge exists and what are its properties. Use "Badge Swordfish" from original data sheet as a reference how it should look. In the case of badges most of the properties in this sheet won't matter.
10. Ensure that your scenario in Sandbox.xlsx / Campaigns has your badge installed on the starting u-boat (Equipment column).
11. It's ready! As you see there is some paper work needed to make it work, but its really unavoidable and it can be done in a few minutes after doing it for the first time.