Setting up your campaign
To create a campaign in your newly created addon, we need to create a campaigns.kv3 file that holds all information about your campaign and references to the chapters, maps and additional metadata. Create a file named campaigns.kv3 in the scripts folder of your addon.
Copy the following code into the file:
An example of a functioning campaign script is available here .
Explaination
The campaigns file defines four nested levels of information. Addon, Campaign, Chapter and Map. Each level has its own properties that can be set and an additional "meta" block holding information for the P2:CE interface. While some meta keys are related to a specific level, most can be defined on each level and will be overriden by deeper levels (eg: An addon can define a background image and each chapter can define their own background image that will be used when the player is in that chapter). It makes sense to define keys on the highest level possible (eg: title/logo on the addon level) to prevent duplication or unwanted display. For more information, please refer to the campaign.kv3 reference page .
Each chapter is a list of maps and unlocks with the last map of the previous chapter played. The unlock_all property determines if all maps in the chapter are unlocked at the start of the chapter or if they are unlocked as the player completes the previous map.
This campaigns.kv3 file is a minimal example. There are lots of other properties that can be set and change how your campaign will be displayed in the game's campaigns menu. For more information, please refer to the campaign.kv3 reference page .
.assets folder
Inside your addons folder, you should create a folder named .assets. This folder enables you to store assets for the interface such as a logo, campaign icons or backgrounds. In our example, we've placed this placeholder logo in the .assets folder and referenced it in the campaigns.kv3 file with the full_logo property.
Testing
Now that we have defined a campaign in our addon, we should test if it shows up in the game's campaign menu. Open P2:CE and head to the Campaigns section. You should now see your newly created campaign and be able to start it. It should look something like this:
Next steps
We've successfully created a campaign in our addon. Next up, we need to setup Hammer for an easier development experience.
Head over to the Hammer setup page to continue.

