# Creating mod

{% hint style="info" %}
Before starting to work on a mod, we recommend familiarizing yourself with the basic principles of mod creation and [the resource architecture](https://bestway-1.gitbook.io/documentation/foundational-knowledge/game-resource-architecture) in Men of War II.
{% endhint %}

Created and modified game resources in the editor are automatically saved to the "Editor local changes" folder, located in the editor's "Working Packages" folder.

## Steps to сonnect new and modified resources to the game via mods

1. Create a package for the mod and [connect it to the game](https://bestway-1.gitbook.io/documentation/mod-development/..#package-activation).
2. Transfer both the new and modified resources from "Editor local changes" to the mod package.
3. Configure the package properties.
4. Test the mod.
5. Publish in the Workshop.

## Creating a mod package

1. Srart the Game
2. Open the Options and select the PACKAGES tab
3. Click the "Create" button (located below the list of packages).

<figure><img src="https://2358506489-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2UV9d5d9aTZPISbocWyo%2Fuploads%2FB1f2O3RihXgwPMzAbI9Y%2FPackages%20window.jpg?alt=media&#x26;token=a46dc7e7-95e0-4530-ba59-7bbd30bf0ff6" alt=""><figcaption><p>The Packages tab in the Game Options</p></figcaption></figure>

4. Enter a name for your new mod package in the dialog box that appears and click "OK".&#x20;

<figure><img src="https://2358506489-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2UV9d5d9aTZPISbocWyo%2Fuploads%2FtCVLGpIykrI4DxEB3EwK%2FCreating%20a%20mod%20package.png?alt=media&#x26;token=b9d38e50-2e79-44f1-9814-b595de7207d3" alt=""><figcaption><p>Confirm your intention to create a package for the mod</p></figcaption></figure>

<figure><img src="https://2358506489-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2UV9d5d9aTZPISbocWyo%2Fuploads%2FWdfQG2SSaa32ZwFIU3Eu%2FEnter%20a%20name%20.png?alt=media&#x26;token=5a492c12-86ef-4018-ab30-fff54219fdf9" alt=""><figcaption><p>Enter the package name</p></figcaption></figure>

The package name will appear in the general list of packages.

6. Enable the mod package to the game and editor. \
   Check the box in the line with name of the created package and click the "Apply" button.

<figure><img src="https://2358506489-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2UV9d5d9aTZPISbocWyo%2Fuploads%2FFuplAb7jgPfs2nU0znj4%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202024-05-02%20%D0%B2%2016.24.12.png?alt=media&#x26;token=a28644b8-c74b-4389-a95c-19a6e3f45c0a" alt=""><figcaption><p><strong>Illustration of enabling the package to the game</strong></p></figcaption></figure>

<figure><img src="https://2358506489-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2UV9d5d9aTZPISbocWyo%2Fuploads%2F7qvQfyQEJiGUaQHvJXtb%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202024-05-02%20%D0%B2%2016.23.23.png?alt=media&#x26;token=fe375498-2f4a-4bb8-acb3-6c57f7563e88" alt=""><figcaption><p>Window with information about a mod package</p></figcaption></figure>

{% hint style="info" %}
Hovering over the package displays a popup window with basic information about the package:

* Package type
* ID
* Path to the package folder
* Creation date and author
  {% endhint %}

At this step, the mod package is created and enabled. The package's resources are available for loading in the game and the editor.

## Transferring new and modified resources to the mod package

1. Open the "Working Packages" folder in File Explorer and find the folder of the created raw package.
2. Transfer resources from the "Editor local changes" folder to the created package's folder, maintaining the file placement structure.

{% hint style="info" %}
After moving the mod resources to the package, the editor will automatically save changes to the mod's resources in its package.
{% endhint %}

{% hint style="info" %}
The "Editor local changes" folder only keeps new resources and original game resources modified by the editor. \
If necessary, transfer resources from the "Editor local changes" package to the mod package, maintaining the file placement structure.
{% endhint %}

At this step, both the new and modified resources are in the mod package. \
The next step is to configure the mod package.

## Configuring the mod package

### Adding a preview image

Place an image of the mod cover at the root folder of the mod package. \
A file must be named preview, saved in jpg format and sized 512x512.

<figure><img src="https://2358506489-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2UV9d5d9aTZPISbocWyo%2Fuploads%2FKEBdcVHrikimoA6HscNW%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202024-05-02%20%D0%B2%2017.15.54.png?alt=media&#x26;token=e0972c78-d1a8-4562-acfd-780170fee109" alt=""><figcaption><p><strong>Example of a mod package folder layout and its root folder contents</strong></p></figcaption></figure>

### Package properties

At the root of the mod folder is an .info file where you need to configure the mod package parameters.

<table><thead><tr><th width="198">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>Unique package identifier, automatically generated when you click "Create" on the "Packages" tab in "Game Settings"</td></tr><tr><td>legacy_id</td><td>After publishing the raw package in the Steam Workshop, the id parameter is replaced by the legacy_id parameter, and the Package changes its type from Raw to Workshop Item</td></tr><tr><td>name</td><td>Package name</td></tr><tr><td>author</td><td>Package author</td></tr><tr><td>order</td><td>Order in the package list. <br>By default, it is 0 and displayed at the top of the package list</td></tr><tr><td>default_disabled</td><td><p>The package is disabled by default until the player applies it in the Game Options. </p><p>It is recommended to set this parameter for all mods.</p></td></tr><tr><td>dependency</td><td>Sets dependencies on already existing packages. <br>For the mod to use the resources and parameters of the original game as a base, you need to specify a dependency on the original game package by stating its id in the dependency block. <br>The block can be used repeatedly to set the sequence of connecting packages for the correct operation of the mod.</td></tr></tbody></table>

## Testing mod

1. Start the game.
2. Open the Options, select the PACKAGES tab and make sure the mod package is enabled.
3. Exit the game Options to the "Main Menu".
4. Create a session on a map from the mod and test the map and mission.
5. Fix any found bugs and errors.

Once your mod is tested and ready, you can publish it to the Steam Workshop

## Steam Workshop

### **Publishing the mod:**

1. Open the game Options and select the Packages tab
2. Select the name of your mod package from the list and click the "Publish" button - the mod will be added to the Workshop in "invisible" mode

{% hint style="info" %}
Keep your mod "invisible" or private until you are ready to make it public, allowing for further testing or private sharing.
{% endhint %}

3. Go to the mod page in Workshop to do this select its name from the package list and click the "Workshop" button.

{% hint style="info" %}
You can find the link to the mod page in the description window that appears under the cursor when hovering over the mod name field in the package list.
{% endhint %}

<figure><img src="https://2358506489-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2UV9d5d9aTZPISbocWyo%2Fuploads%2FzZTS5Dec86f675lAONCL%2FPublishing%20mod%20to%20the%20Workshop.png?alt=media&#x26;token=f699ad6c-dc77-40f1-a08c-4e0ba2bfc504" alt=""><figcaption></figcaption></figure>

3. Configure the appearance of the mod page using the Workshop tools.

### **Updating the mod**

Once you have finished working on the mod update, you need to publish the update in the Workshop.

1. Start the game and go to the Packages tab in the Game Options.
2. Select the name of the package for which you need to publish updates from the list and click the "Update" button - any package updates will be published in the Workshop.

{% hint style="info" %}
You can add new files to the mod at any time, working with the mod folder located in the "Working Packages" folder.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bestway-1.gitbook.io/documentation/mod-development/creating-mod.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
