Guide: How to add new units.

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

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

captainjack
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1908
Joined: Thu Sep 13, 2012 7:42 am

Re: Guide: How to add new units.

Post by captainjack »

It looks like your image is a jpg with a white background.
You need to use png files with a clear background and to ensure that the overall image has the same size as standard ones.
All of the images posted on this site are in suitable format and size, so will appear correctly.

You've already worked out how to get the images displayed so you've got past the first hurdle so keep at it. There are helpful people on the forum and if you spend a bit of time searching in the early posts in this forum you will find some very basic guides that should help too.
Comrade_Andrzej
Private First Class - Opel Blitz
Private First Class - Opel Blitz
Posts: 2
Joined: Mon May 27, 2019 5:27 pm

Re: Guide: How to add new units.

Post by Comrade_Andrzej »

Thanks, it will be very nice advices.
tdev
Lance Corporal - Panzer IA
Lance Corporal - Panzer IA
Posts: 15
Joined: Tue Dec 28, 2021 10:49 am

Re: Guide: How to add new units.

Post by tdev »

This does not work, unit will not show up in game, the editor, or the purchase screen.
terminator
Field Marshal - Elefant
Field Marshal - Elefant
Posts: 5881
Joined: Mon Aug 15, 2011 12:48 pm
Location: the land of freedom

Re: Guide: How to add new units.

Post by terminator »

tdev wrote: Wed Jan 12, 2022 4:41 pm This does not work, unit will not show up in game, the editor, or the purchase screen.
Try again...
faos333
Colonel - Fallschirmjäger
Colonel - Fallschirmjäger
Posts: 1465
Joined: Sat Feb 16, 2019 9:04 pm

Re: Guide: How to add new units.

Post by faos333 »

Discovered this topic only recently, when I decided to experiment with some basic modding. Thanks Nico, very informative answers.

One thing I would like to add if not already mentioned:
is when adding a new unit, one more .png 256 x 128 pixel with the same name image should be added, or created. Specifically, the units details image, other wise it will be empty.

To avoid this, the image has to go into the UI folder, into the subfolder "bigunits"
,
new equipment missing icon stug.JPG
new equipment missing icon stug.JPG (67.24 KiB) Viewed 708 times
Battlefield Europe get the most from Panzer Corps 8)
Download the new 2.4 Mod here http://www.slitherine.com/forum/viewtopic.php?f=147&t=47985
rubyjuno
Sergeant First Class - Panzer IIIL
Sergeant First Class - Panzer IIIL
Posts: 397
Joined: Mon Sep 21, 2015 1:18 pm
Location: Northumberland

Re: Guide: How to add new units.

Post by rubyjuno »

faos333 wrote: Mon Nov 21, 2022 4:29 pm One thing I would like to add if not already mentioned:
is when adding a new unit, one more .png 256 x 128 pixel with the same name image should be added, or created. Specifically, the units details image, other wise it will be empty.

To avoid this, the image has to go into the UI folder, into the subfolder "bigunits"
Thanks for sharing :D
Der_Kuenstler
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 90
Joined: Wed Jan 22, 2014 11:40 am

Re: Guide: How to add new units.

Post by Der_Kuenstler »

The Battlefield Europe mod has a Spanish Blue division in it, but the icon is just the same wehrmacht_inf png as the rest of the German army. I decided to make a special Spanish Blue Division png. I replaced the wehrmacht_inf.png with my Spanish_Blue_Div.png on the Spanish Blue Division line in my pzeqp file with notepad. I thought this would just change the picture and everything else would be the same. Easy. But when I load my save the picture just stays the way it was - no change. Does anyone know where I'm going wrong??
cw58
Master Sergeant - Bf 109E
Master Sergeant - Bf 109E
Posts: 459
Joined: Thu Sep 24, 2015 9:44 pm

Re: Guide: How to add new units.

Post by cw58 »

Did you add your Spanish_Blue_Div.png to the efx file? And added the new icon to the Units folder?
Der_Kuenstler
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 90
Joined: Wed Jan 22, 2014 11:40 am

Re: Guide: How to add new units.

Post by Der_Kuenstler »

cw58 wrote: Wed May 22, 2024 1:24 am Did you add your Spanish_Blue_Div.png to the efx file? And added the new icon to the Units folder?
The new icon is in the Units folder but I wanted to leave the sound effect as it already was on the Spanish blue line- I only changed the png. Do I need to change the efx file too if I only want to change the picture?
cw58
Master Sergeant - Bf 109E
Master Sergeant - Bf 109E
Posts: 459
Joined: Thu Sep 24, 2015 9:44 pm

Re: Guide: How to add new units.

Post by cw58 »

Der_Kuenstler wrote: Wed May 22, 2024 2:09 am
cw58 wrote: Wed May 22, 2024 1:24 am Did you add your Spanish_Blue_Div.png to the efx file? And added the new icon to the Units folder?
The new icon is in the Units folder but I wanted to leave the sound effect as it already was on the Spanish blue line- I only changed the png. Do I need to change the efx file too if I only want to change the picture?
In the efx file, you can just copy & paste the Wehrmacht Inf line but then change the name of the new line to Spanish_Blue_Div.png (or whatever name you're using in the equipment file).

So to summarize, the .png icon in the equipment file tells the game to look in the efx file for a line with the same name. The efx file then tells the game which icon to load & what animations and sound effects to use.
Der_Kuenstler
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 90
Joined: Wed Jan 22, 2014 11:40 am

Re: Guide: How to add new units.

Post by Der_Kuenstler »

OK I made the Spanish Blue Division line in pzeqp look like this, only replacing the Wehrmacht_inf.png with Spanish_Blue_Div.png.
EQP.jpg
EQP.jpg (69.3 KiB) Viewed 379 times
Then I copied and pasted the Wehrmacht_inf line in efx.pzdat at the bottom and replaced Wehrmacht_inf.png with Spanish_Blue_Div.png., like this:
ESV.jpg
ESV.jpg (69.59 KiB) Viewed 379 times
My new icon I made is in my units folder with the other units, like this:
units.jpg
units.jpg (48.87 KiB) Viewed 379 times
But when I open my game save, there is no change. I don't get what I'm doing wrong. Do I have to restart the campaign for it to work?
Locarnus
Master Sergeant - Bf 109E
Master Sergeant - Bf 109E
Posts: 495
Joined: Tue Jul 19, 2011 8:14 pm

Re: Guide: How to add new units.

Post by Locarnus »

Der_Kuenstler wrote: Wed May 22, 2024 4:02 pm [...]

But when I open my game save, there is no change. I don't get what I'm doing wrong. Do I have to restart the campaign for it to work?
1. Graphics and icons (with existing names) are loaded every time you restart the game exe.
Eg if you would simply replace the existing Wehrmacht.png icon while keeping the file name, the change would be visible after a game restart.

2. Some referencing files, like the equipment and the efx files, are updated every time you transition to (or start) a scenario.
But new entries (eg adding a new unit) are added at the end of an existing campaign savegame unit ID roster (no functional difference, the new unit will just be added at the end of the purchase and upgrade screens, instead of the position indicated in the equipment file).
So while those information are updated for a scenario transition, they are only truly reloaded when a new campaign is started (where the order of the units in the equipment file for purchase and upgrade screens will be respected).

3. Some other files, iirc the movement file, are only loaded (and updated, as far as I know) at a new campaign start. Each grand campaign "year" (like GC 40) is treated like starting such a new campaign.


=> Your change involved the equipment file. So in order for those edits to make a difference, you need to start a new scenario, or transition to the next scenario within the campaign (see 2. above).
longer, alternative "PG" like Campaign new version 0.34 from 2011.08.02 (another bugfix & now in zip format)
Der_Kuenstler
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 90
Joined: Wed Jan 22, 2014 11:40 am

Re: Guide: How to add new units.

Post by Der_Kuenstler »

I see - so from your response it appears this unit won't show up in game unless I restart the last massive scenario of Mcguba's Battlefield Europe campaign and play it until turn six when it is scheduled to appear. I'd don't know if I want to see it that bad. Thanks for the help, though! I learned some more about modding.
Locarnus
Master Sergeant - Bf 109E
Master Sergeant - Bf 109E
Posts: 495
Joined: Tue Jul 19, 2011 8:14 pm

Re: Guide: How to add new units.

Post by Locarnus »

Der_Kuenstler wrote: Wed May 22, 2024 5:37 pm I see - so from your response it appears this unit won't show up in game unless I restart the last massive scenario of Mcguba's Battlefield Europe campaign and play it until turn six when it is scheduled to appear. I'd don't know if I want to see it that bad. Thanks for the help, though! I learned some more about modding.
That is correct, an unfortunate game engine limitation...

You are welcome.

PS: If you do restart, make sure to test your changes before playing the first 6 turns "for real" again. Not always preventable, but still frustrating to only find an issue when playing "for real" and then being unable to correct it for the rest of the scenario. Unfortunately I speak from a bit too much experience in this regard. :wink:
longer, alternative "PG" like Campaign new version 0.34 from 2011.08.02 (another bugfix & now in zip format)
Der_Kuenstler
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 90
Joined: Wed Jan 22, 2014 11:40 am

Re: Guide: How to add new units.

Post by Der_Kuenstler »

Locarnus wrote: Wed May 22, 2024 5:53 pm PS: If you do restart, make sure to test your changes before playing the first 6 turns "for real" again.
For sure! How do I test the changes - in the editor?
Locarnus
Master Sergeant - Bf 109E
Master Sergeant - Bf 109E
Posts: 495
Joined: Tue Jul 19, 2011 8:14 pm

Re: Guide: How to add new units.

Post by Locarnus »

Der_Kuenstler wrote: Wed May 22, 2024 6:15 pm
Locarnus wrote: Wed May 22, 2024 5:53 pm PS: If you do restart, make sure to test your changes before playing the first 6 turns "for real" again.
For sure! How do I test the changes - in the editor?
If you want to do more modding, I would make a test scenario in the editor.
Then make this test scenario available from the scenario selection screen in game (to test eg that the sound and fire animations are working, which you can't test in the editor).

But setting this up is probably too much work, if you just want to make this one change and only use it yourself.
In that specific case, I would just start the BE scenario from the scenario menu (so without heroes), but from there you can select "Hotseat" mode (so you play a turn for Axis and then Allies, then Axis again). Then just press end turn until you get the Blue Division and test it against an enemy unit (for sound and fire animation).
longer, alternative "PG" like Campaign new version 0.34 from 2011.08.02 (another bugfix & now in zip format)
Der_Kuenstler
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 90
Joined: Wed Jan 22, 2014 11:40 am

Re: Guide: How to add new units.

Post by Der_Kuenstler »

Ah - great ideas - Thank you!
McGuba
Colonel - Ju 88A
Colonel - Ju 88A
Posts: 1513
Joined: Thu Mar 15, 2012 7:34 pm

Re: Guide: How to add new units.

Post by McGuba »

Der_Kuenstler wrote: Wed May 22, 2024 12:28 am The Battlefield Europe mod has a Spanish Blue division in it, but the icon is just the same wehrmacht_inf png as the rest of the German army.
The reason for that was they used the standard German Heer uniform, the only difference was they had a shield on the upper right sleeve which bore the Spanish National colors with the word “España”. And it looks like there was also a small Spanish flag on the righ side of the helmet. These are quite small and hard to notice changes, especially if the game is played on high screen resolution, but I agree that it may be a nice idea to have such a unique icon for this unit for those eagle eyed players. :)

Something like this, perhaps?
Blue_Div_Inf.png
Blue_Div_Inf.png (32.83 KiB) Viewed 278 times

and the corresponding bigunit icon could be like:
Blue_Div_Inf.png
Blue_Div_Inf.png (97.45 KiB) Viewed 278 times
ImageImage
slitherine.com/forum/viewtopic.php?f=147&t=47985
slitherine.com/forum/viewtopic.php?f=147&t=36969
Der_Kuenstler
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 90
Joined: Wed Jan 22, 2014 11:40 am

Re: Guide: How to add new units.

Post by Der_Kuenstler »

I really like contrasting visuals for different units. It improved the immersion for me. I modded all my regular Wehrmacht to look like below, so that's why the Spanish icon I made would match my game better. I made the symbols at 55% opacity so they don't overwhelm the icons.
Wehrmacht_Inf.png
Wehrmacht_Inf.png (41.48 KiB) Viewed 256 times
In-game look...
SE PzGrenadier.jpg
SE PzGrenadier.jpg (18.74 KiB) Viewed 256 times
sysadmin873893
Private First Class - Opel Blitz
Private First Class - Opel Blitz
Posts: 2
Joined: Sun May 26, 2024 9:29 am

Re: Guide: How to add new units.

Post by sysadmin873893 »

Thanks a lot for your guide, but I have a problem
For my scenario I want to make the Danish infantry, and, accordingly, Denmark itself, as a playable nation

There is such a thing in the game as reservists (with a blue swastika on the flag)
They act as your enemies in the training scenario
Because this is the most useless nation in the game, I would like to replace them with Danish (I already drew the flags)

So, where can I find the reservist configuration, and how can I make them a playable nation? (How can I make them available in the editor?)
Please help me :roll: :roll:
Post Reply

Return to “Panzer Corps : Scenario Design”