Page 3 of 4

Re: Guide: How to add new units.

Posted: Tue May 28, 2019 7:53 am
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.

Re: Guide: How to add new units.

Posted: Tue May 28, 2019 5:56 pm
by Comrade_Andrzej
Thanks, it will be very nice advices.

Re: Guide: How to add new units.

Posted: Wed Jan 12, 2022 4:41 pm
by tdev
This does not work, unit will not show up in game, the editor, or the purchase screen.

Re: Guide: How to add new units.

Posted: Thu Jan 20, 2022 4:55 am
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...

Re: Guide: How to add new units.

Posted: Mon Nov 21, 2022 4:29 pm
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 1186 times

Re: Guide: How to add new units.

Posted: Tue Nov 22, 2022 8:40 am
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

Re: Guide: How to add new units.

Posted: Wed May 22, 2024 12:28 am
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??

Re: Guide: How to add new units.

Posted: Wed May 22, 2024 1:24 am
by cw58
Did you add your Spanish_Blue_Div.png to the efx file? And added the new icon to the Units folder?

Re: Guide: How to add new units.

Posted: Wed May 22, 2024 2:09 am
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?

Re: Guide: How to add new units.

Posted: Wed May 22, 2024 3:39 am
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.

Re: Guide: How to add new units.

Posted: Wed May 22, 2024 4:02 pm
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 857 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 857 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 857 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?

Re: Guide: How to add new units.

Posted: Wed May 22, 2024 4:44 pm
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).

Re: Guide: How to add new units.

Posted: Wed May 22, 2024 5:37 pm
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.

Re: Guide: How to add new units.

Posted: Wed May 22, 2024 5:53 pm
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:

Re: Guide: How to add new units.

Posted: Wed May 22, 2024 6:15 pm
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?

Re: Guide: How to add new units.

Posted: Wed May 22, 2024 6:37 pm
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).

Re: Guide: How to add new units.

Posted: Thu May 23, 2024 12:31 am
by Der_Kuenstler
Ah - great ideas - Thank you!

Re: Guide: How to add new units.

Posted: Thu May 23, 2024 11:45 am
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 756 times

and the corresponding bigunit icon could be like:
Blue_Div_Inf.png
Blue_Div_Inf.png (97.45 KiB) Viewed 756 times

Re: Guide: How to add new units.

Posted: Thu May 23, 2024 12:51 pm
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 734 times
In-game look...
SE PzGrenadier.jpg
SE PzGrenadier.jpg (18.74 KiB) Viewed 734 times

Re: Guide: How to add new units.

Posted: Sun May 26, 2024 11:41 am
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: