Panzer Corps 2 Modding Guides

A forum to discuss custom scenarios, campaigns and modding in general.

Moderator: Panzer Corps 2 Moderators

Locked
Rudankort
FlashBack Games
FlashBack Games
Posts: 3836
Joined: Sat Aug 21, 2010 2:23 pm
Contact:

Panzer Corps 2 Modding Guides

Post by Rudankort »

Creating a simple mod

Panzer Corps 2 is developed with Unreal Engine and widely uses Unreal Engine assets (files with .uasset extension). However, there are many files which are not in uasset format: csv data tables, json files, lua scripts, Panzer Corps 2 scenario files etc. Such files can be modified without installing Unreal Editor. You can create a mod which changes such files by simple copying them (including the full directory tree under PanzerCorps2/Content dir) to an empty folder. This folder now contains your mod. Feel free to modify the files inside in any way, add more files etc.

You’ll need an additional file inside the mod folder with .uplugin extension. The name of this file should uniquely identify your mod. If two or more mods have .uplugin files with identical names, this will cause problems. .uplugin file must contain the name of the mod, its description and author name in json format:

Code: Select all

{
	"FriendlyName": "My humble mod",
	"Description": "My humble description",
	"CreatedBy": "Me"
}
To install such a mod, you need to place its folder under [Documents]/My Games/Panzer Corps 2/Mods/ (create this folder if it does not exist yet), then run the game and enable the mod in the mod manager (available via Main Menu -> Mods -> Mod Manager).

If two mods change the same file, then the last mod in the chain takes priority. That's why the order of mods is important. In Mod Manager, you can change the order of your mods by using "Move Up" and "Move Down" buttons.

Don't forget to press APPLY after you make all required changes in Mod Manager.


A note on tables

There are many data tables in Panzer Corps 2 which use plain-text comma-separated values (.csv) format. For example, the table containing stats of all units in the game is in this format (Content/Data/Units.csv). If such a table is found in a mod, it will be merged into the corresponding default game table instead of completely replacing it. This allows you to mod a single unit inside the unit table, without touching any other ones. You can also add more units to the table, without removing existing ones.

Table merging works on a cell by cell basis. If two mods change the same row (e. g. unit) but different columns in it, both changes will be applied on top of the default values. Only in case two mods change exactly the same cell (e. g. the same parameter of the same unit) there will be a conflict and only one change will be applied.


Uploading the mod to Steam Workshop

In addition to manually installing the mods in the Mods folder, you can make your mod available for all Steam users by publishing it on Panzer Corps 2 Steam Workshop. In order to do this:

1. Download Steam Console Client of SteamCMD. The download link is available on this page: https://developer.valvesoftware.com/wiki/SteamCMD

2. Create a plain text file named “metadata.vdf” with the following content:

Code: Select all

"workshopitem"
{
"appid"			"1072040"
"publishedfileid"	"0"
"contentfolder"		"D:\FullPath\ModFolder"
"previewfile"		"D:\FullPath\ModFolder\preview.jpg"
"visibility"		"0"
"title"			"Mod title on the Workshop page"
"description"		"Mod description on the Workshop page"
"changenote"		"Initial release"
}
The publishedfileid field must be 0 for the initial upload.
The contentfolder and previewfile must containt full path to the mod folder and preview image. Relative paths are no allowed.
The visibility field: 0 – public, 1 – friends only, 2 – private visibility

3. Create a file named publish.bat with the following content:
SteamCMD.exe +login %user_name% %password% +workshop_build_item %full_path%\metadata.vdf +quit

4. Open Windows Command Prompt and run the file. It will create a new workshop item and assign a new ID to it. This ID will also be placed in your vdf file (publishedfileid field). Use the same bat and vdf files for future uploads, and Steam will update the content of your mod instead of creating a new one.

---

Modding the game’s Unreal Engine assets (unit models, terrain graphics, UI etc.) is also possible, but the process if more difficult. We’ll describe it in the next guide. Stay tuned!
Locked

Return to “Panzer Corps 2 Scenario Design”