Page 1 of 1

Campaign creation guide

Posted: Wed Sep 25, 2024 1:59 pm
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?

Re: Campaign creation guide

Posted: Wed Sep 25, 2024 3:33 pm
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 :)

Re: Campaign creation guide

Posted: Wed Sep 25, 2024 4:02 pm
by El_Condoro
Thanks for that. You can be sure there will be a lot more questions from me! :) Cheers

Re: Campaign creation guide

Posted: Thu Sep 26, 2024 12:57 am
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

Re: Campaign creation guide

Posted: Thu Sep 26, 2024 4:38 am
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?

Re: Campaign creation guide

Posted: Thu Sep 26, 2024 5:16 am
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.

Re: Campaign creation guide

Posted: Thu Sep 26, 2024 12:23 pm
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!