Adding countries

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

Moderators: Slitherine Core, Panzer Corps Moderators, Panzer Corps Design

Post Reply
BiteNibbleChomp
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3231
Joined: Mon Jul 01, 2013 6:35 am

Adding countries

Post by BiteNibbleChomp »

How do you add a country in Panzer Corps?
I am attempting to add Czechoslovakia for the purpose of a 1938 campaign.

Also, how do get the "Genric Mod Enabler" thing and what does it do?

- BNC
Ryan O'Shea - Developer - Strategic Command American Civil War
Cataphract88
Master Sergeant - U-boat
Master Sergeant - U-boat
Posts: 521
Joined: Wed Apr 22, 2009 8:56 pm
Location: London

Re: Adding countries

Post by Cataphract88 »

Hi BNC,

I wouldn't know where to start with the country thing, but I can tell you that in the 'Stickies' section of the Panzer Corps forum their is an entry called 'How to install Generic Mod Enabler'. This includes a link for downloading the GME, and detailed information.

Hope this helps. :)
Richard
bebro
Slitherine
Slitherine
Posts: 4341
Joined: Sun Nov 19, 2006 12:50 pm

Re: Adding countries

Post by bebro »

BiteNibbleChomp wrote:How do you add a country in Panzer Corps?
I am attempting to add Czechoslovakia for the purpose of a 1938 campaign.
Do you need it additionally to the existing countries at all costs? Otherwise it would be much easier to modify an existing country to Cze.

For this, pick a country from the game you don't need, then edit its name to "Czechoslovakia" in the strings.pzdat file in Data/

Then you need to change the various gfx showing the flag to have a Czech flag:

- one in the "flags" file under Graphics/Overlays/
- one in UI/Flags
- one in UI/Purchase/Flags

Then give your Czech units the number code of the country you changed for this in the equipment.pzdat

IIRC that would be all in this way (tho it has been a while so maybe I forgot something). Backups for everything you change are highly recommended of course.

There's a second way to really add a completely new country without modifying an older one, but it's way more work and more error-prone, and could need rework with new patches. However, if the above isn't enough for you I can see to post more on this.
BiteNibbleChomp
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3231
Joined: Mon Jul 01, 2013 6:35 am

Re: Adding countries

Post by BiteNibbleChomp »

I was interested in adding them without removing any other countries, and giving them a new country code etc.
Ryan O'Shea - Developer - Strategic Command American Civil War
bebro
Slitherine
Slitherine
Posts: 4341
Joined: Sun Nov 19, 2006 12:50 pm

Re: Adding countries

Post by bebro »

I was afraid you'd say that ;)

So here we go - as per usual, make backups of game files you change. Rezaf explained me this once, and I use it in my mods without trouble, but it requires that you use GME, unless you want to mod all files in the game folder(s), which is hardly on option if you want to distribute the mod. For use with GME put all files you changed into your mod's folder, and use subfolders replicating the main game's folder structure if needed. So all files orginally in data/ go into Your_mod_folder/data/ and so on.


1. Data files

IIRC right now there are 32 countries (starting by 0). Assuming there is no hardcoded limit here (dunno) you should be able to add more.

The last entry in the data/strings.pzdat is for Vichy France using no. 31 (since it starts with 0). Look how those entries are formatted (tabs), and edit in there:

Code: Select all

IDS_NATION32 	Czechoslovakia
Then open data/nations.pzdat an add Czechoslovakia at the end as well plus a number determining the whether you want Cze to be axis or allies by default (unless changed in the editor). Should be self-explaining when you look at the other entries.

When you edit units nto the equipment.pzdat, use 32 as country code for Czech units of course.

2. GFX files (flags)

As explained above, you need all the gfx for those flags in the correct folders. When you open the "flags" file under Graphics/Overlays/ you'll see all country flags in some kind of roster - add one for Cze after the Vichy flag in the same fashion.

The gfx in UI/Flags and in UI/Purchase/Flags are showing only one flag each, using the country code as file name. So you need those files showing a Cze flag, named both "32" in the correct folders.

3. Editor files

You need to edit several editor filesin the UI folder to make sure you can use your new country in the game's editor, otherwise you cannot add VHs, airfields or units for it.

The files in question are:
editor_condmap
editor_scnparams
editor_unitfilter
editor_unitparams

These are HTML files, so you can edit them using a text editor, just make sure you don't mess up any tags. Basically search for the entries there that refer to countries, than add a similar one for Cze. Example:

editor_condmap.html seems to be used in the editor to set trigger and victory conditions. If you scroll down a bit you'll see a list of all countries under

Code: Select all

<select id="UnitFlag">
You need to add another line below Vichy there:

Code: Select all

<option value="32">Czechoslovakia</option>
editor_scnparams has entries for changing the side a country belongs to per scenario, here for Ger:

Code: Select all

<input name="Germany" type="radio" id="GermanyUnused" style="margin:auto" style="margin:auto" />
<input name="Germany" type="radio" id="GermanyAxis" style="margin:auto" style="margin:auto" />
<input name="Germany" type="radio" id="GermanyAllied" style="margin:auto" style="margin:auto" />
Add a similar one for Cze.

editor_unitfilter.html has a country list which refers to labels from the strings file, for Cze add:

Code: Select all

<option value="32">IDS_NATION32</option>
editor_unitparams.html has a country list like editor_condmap, add a similar entry here.

Finally, if we ever get a patch or XP with even more countries you probably need to rework this accordingly.


I hope that helps and I didn't forget something, wrote it kinda fast. Feel free to ask if there's a prob :)
BiteNibbleChomp
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3231
Joined: Mon Jul 01, 2013 6:35 am

Re: Adding countries

Post by BiteNibbleChomp »

I've managed to get as far as adding the flag in ...\Overlays.

In the UI\Flags folder, 32 was already taken by something that looks like Canada or India?
Would this be likely to affect anything -> should Cze be labeled as 33?
(Germany began at 1, not 0 which may be the neutral flag?)

Any ideas for this :? - I attached a screenshot of the folder if this is any help - but 1-6 couldnt be shown beause of my screens low resolution (1024*768)

-BNC
Attachments
flag folder.JPG
flag folder.JPG (94.11 KiB) Viewed 9484 times
Ryan O'Shea - Developer - Strategic Command American Civil War
T2_2112
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 219
Joined: Thu Aug 15, 2013 3:40 am

Re: Adding countries

Post by T2_2112 »

BiteNibbleChomp wrote:I've managed to get as far as adding the flag in ...\Overlays.

In the UI\Flags folder, 32 was already taken by something that looks like Canada or India?
Would this be likely to affect anything -> should Cze be labeled as 33?
(Germany began at 1, not 0 which may be the neutral flag?)

Any ideas for this :? - I attached a screenshot of the folder if this is any help - but 1-6 couldnt be shown beause of my screens low resolution (1024*768)

-BNC
That is Vichy France.

For ID in text file from 0-31
For FILES from 1-32 :mrgreen:
bebro
Slitherine
Slitherine
Posts: 4341
Joined: Sun Nov 19, 2006 12:50 pm

Re: Adding countries

Post by bebro »

Yeah, T2 is right. That was a mistake on my part :shock:

If you add Cze as IDS_NATION32 it will use 32 in the equipment file, but the little flag files in the UI folders need to be named 33 then. I guess it's because of the neutral (white) flag they have as the first.
T2_2112
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 219
Joined: Thu Aug 15, 2013 3:40 am

Re: Adding countries

Post by T2_2112 »

bebro wrote:Yeah, T2 is right. That was a mistake on my part :shock:

If you add Cze as IDS_NATION32 it will use 32 in the equipment file, but the little flag files in the UI folders need to be named 33 then. I guess it's because of the neutral (white) flag they have as the first.
No, u dont have any mistake but game dev have. They make us confuse with the ID :mrgreen:
BiteNibbleChomp
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3231
Joined: Mon Jul 01, 2013 6:35 am

Re: Adding countries

Post by BiteNibbleChomp »

Ok, all of the stuff you put up earlier has been done (inlcuding files called 33) and now when the mod is enabled. When I try to launch the editor it comes up with the message: "Failed to load global game parameters"

What am I supposed to do here -

Cze has no units made for it yet - would this be affecting it.

-BNC :(
Ryan O'Shea - Developer - Strategic Command American Civil War
bebro
Slitherine
Slitherine
Posts: 4341
Joined: Sun Nov 19, 2006 12:50 pm

Re: Adding countries

Post by bebro »

Never had this prob, but I guess this points to an error in the file editor_scnparams.html

I take it you checked everything for typos or messed up html tags?

The relevant part in the original file looks like this for me:
<tr>
<td style="text-align:right">IDS_NATION31:</td>
<td colspan=3>
<input name="Vichy France" type="radio" id="VichyFranceUnused" style="margin:auto" />
<input name="Vichy France" type="radio" id="VichyFranceAxis" style="margin:auto" />
<input name="Vichy France" type="radio" id="VichyFranceAllied" style="margin:auto" />
</td>
</tr>
</table>

Before the closing </table> you need to add:

<tr>
<td style="text-align:right">IDS_NATION32:</td>
<td colspan=3>
<input name="Yourcountry_name" type="radio" id="Yourcountry_nameUnused" style="margin:auto" />
<input name="Yourcountry_name" type="radio" id="Yourcountry_nameAxis" style="margin:auto" />
<input name="Yourcountry_name" type="radio" id="Yourcountry_nameAllied" style="margin:auto" />
</td>
</tr>
That's all IIRC, as said, has been a while since I did this. I also never added countries beyond # 30, since earlier PzC did not have as much. So if there's a hidden limit of 32 or something I dunno, only the devs could tell.
BiteNibbleChomp
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3231
Joined: Mon Jul 01, 2013 6:35 am

Re: Adding countries

Post by BiteNibbleChomp »

Bother, I was hoping 32 wasn't the limit. :(

Anyway, I managed to think up a new campaign called Small Europe - which takes the mainstream Wehrmacht campaign, and halves the number of units, turns etc. so you play a scenario very quickly (the first can be beaten in 10mins) - ideal for people who haven't long to play games.

Bebro, would you be interested in beta-testing this in a couple of weeks?

We will discuss this more on my new thread called "small europe campaign 39-45"

- BNC
Ryan O'Shea - Developer - Strategic Command American Civil War
parmenio
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 105
Joined: Sun Jan 10, 2010 5:41 pm

Re: Adding countries

Post by parmenio »

BiteNibbleChomp wrote:Ok, all of the stuff you put up earlier has been done (inlcuding files called 33) and now when the mod is enabled. When I try to launch the editor it comes up with the message: "Failed to load global game parameters"
I just had this happen to me. I use Excel for editing (and I like doing so) and it had managed to put quotes round large sections of entries in strings.pzdat.
Is it possible to stop it doing this?

I've got quite casual about using this tool to edit files in the Data folder. Luckily I'd kept a backup of my install folder but I'd prefer not to be double-checking every edit in Notepad++.
terminator
Field Marshal - Elefant
Field Marshal - Elefant
Posts: 5862
Joined: Mon Aug 15, 2011 12:48 pm
Location: the land of freedom

Re: Adding countries

Post by terminator »

Here you can see an example with WaffenSS and Kriegsmarine as new nations :
http://www.slitherine.com/forum/viewtop ... 47&t=74939
parmenio
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 105
Joined: Sun Jan 10, 2010 5:41 pm

Re: Adding countries

Post by parmenio »

I've not had a problem getting the additional nations to work (I've added about nine new ones so far)... it's just that with the last one Excel screwed up my strings.pzdat file.
Yrfin
1st Lieutenant - 15 cm sFH 18
1st Lieutenant - 15 cm sFH 18
Posts: 818
Joined: Sun Dec 04, 2016 6:47 am
Location: Behind your backs

Re: Adding countries

Post by Yrfin »

With Excel problem Im using next algorithm:

Make copy *.pzdat file before !

1.Open *.pzdat in Excel
2.Select All, Clear All
3.Change format all cells to Text
4.Open *.pzdat in Notes
5.Select All, Copy.
6.Switch to Excel, Paste.
7.Edit
8.Save as Unicode format
9.When Close Excel don't save *.pzdat again !
10. Next time just open *.pzdat in Excel and Edit/Save
When im died - I must be a killed.
parmenio
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 105
Joined: Sun Jan 10, 2010 5:41 pm

Re: Adding countries

Post by parmenio »

Yrfin wrote:With Excel problem Im using next algorithm:

Make copy *.pzdat file before !

.......
9.When Close Excel don't save *.pzdat again !
I'm wondering whether I accidentally did save it again as I haven't had the problem before or since.
Post Reply

Return to “Panzer Corps : Scenario Design”