Campaign creation guide

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

Moderator: Panzer Corps 2 Moderators

Post Reply
El_Condoro
Panzer Corps Moderator
Panzer Corps Moderator
Posts: 2119
Joined: Tue Jun 03, 2008 9:32 am

Campaign creation guide

Post by El_Condoro »

Has anyone written a guide for campaign creation?

I made a few campaigns for PzC1 but there are a lot of changes in PzC2. I have downloaded some user-made campaigns and am trying to reverse-engineer them but have struck a few issues that have stumped me.

I understand (I think!) what campaigns.csv does and can understand what the path_selection_#.json files do. My questions (to date) are:
  1. How does the main campaign 'know' to trigger path_selection_1.json at the beginning of the Poland campaign?
  2. What is used to trigger a campaign choice between scenarios?
  3. How does the game determine the order of scenarios in a campaign after campaigns.csv kicks things off?
bebro
Slitherine
Slitherine
Posts: 4556
Joined: Sun Nov 19, 2006 12:50 pm

Re: Campaign creation guide

Post by bebro »

Your main cam flow is defined in the campaign's script.lua

There you have stuff like:
PlayScenario("01_US_Wahlerscheid/01_Wahlerscheid")

if (SelectPath("US44_path_selection_1") == 1) then
PlayScenario("02A_US_Elsenborn/02_Elsenborn")
else
PlayScenario("02B_US_Losheim/02_Losheim")
end
This is the first part from Bulge.

For a fully linear cam, just list more lines like

PlayScenario("01_US_Wahlerscheid/01_Wahlerscheid")

The if-then-else part afterwards is for a choice. It refers to US44_path_selection_1, a separate file in the cam folder.

That's how the cam 'knows' when it has to do a selection.

So:

1. Make a script.lua for your general cam
2. Make ...selection files separately, and refer to them in the script
3. Put all of those into your main cam folder

Just look into one of the path selection files of any DLC to see what they contain. Or ask if something is unclear :)
El_Condoro
Panzer Corps Moderator
Panzer Corps Moderator
Posts: 2119
Joined: Tue Jun 03, 2008 9:32 am

Re: Campaign creation guide

Post by El_Condoro »

Thanks for that. You can be sure there will be a lot more questions from me! :) Cheers
Grondel
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1956
Joined: Mon Aug 04, 2014 10:07 pm

Re: Campaign creation guide

Post by Grondel »

El_Condoro wrote: Wed Sep 25, 2024 4:02 pm Thanks for that. You can be sure there will be a lot more questions from me! :) Cheers
Feel free to add me in discord of u happen to have that. my handle is: grondel

sers,
Thomas
El_Condoro
Panzer Corps Moderator
Panzer Corps Moderator
Posts: 2119
Joined: Tue Jun 03, 2008 9:32 am

Re: Campaign creation guide

Post by El_Condoro »

My first question (since the last lot) is why I can't get the background image to show when clicking on a custom campaign. The text and other details are all correct but only the official campaigns change their background. I have checked paths and (custom) folder structures in the \Data\Campaigns.csv file so that they match those of the official game in Steam but no success. Any idea what I am missing?
Panzer Mods
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 35
Joined: Sun Sep 12, 2021 5:58 pm

Re: Campaign creation guide

Post by Panzer Mods »

You need to define the .jpg's path, but for that you need to create a custom mod, not just a campaign.
After creating a mod, you need a "Campaigns.csv", copy one from the regular game and customize it to only include your campaign (keep the first row, since its important, I think), the second row should include your campaign, in there you can specify the campaign's background image.
El_Condoro
Panzer Corps Moderator
Panzer Corps Moderator
Posts: 2119
Joined: Tue Jun 03, 2008 9:32 am

Re: Campaign creation guide

Post by El_Condoro »

Thanks for your response. Grondel helped me with the needed advice that you gave - I needed to set up the campaign in the Mods folder and not the Campaigns folder. Mucking around with the structure and the necessary csv and lua files has meant it is all up and running. Now, climbing the Lua coding mountain will be a bit harder!
Post Reply

Return to “Panzer Corps 2 Scenario Design”