Adding custom units to a purchase list

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

Moderator: Panzer Corps 2 Moderators

Post Reply
FunPolice749
Administrative Corporal - SdKfz 251/1
Administrative Corporal - SdKfz  251/1
Posts: 125
Joined: Thu Apr 30, 2020 11:52 pm

Adding custom units to a purchase list

Post by FunPolice749 »

Hello everyone, I come here with a quick question as I've been trying to create some custom scenarios and have run into a snag. I am looking to create custom units and have them be purchasable in a custom purchase list. I have the units already created but when trying to create a new purchase list in TypeLists.csv with a custom unit it ends up crashing every-time. I tried looking at other content made by people but couldn't find any examples of what I'm looking to do so I want to reach out here and see if anyone knows what needs to be done or what is causing issues.
To be clear I already have the custom units made, I have the base Units.csv containing the custom units, and I am trying to get them to load when making a new TypeLists.csv
Thanks in advance
dalfrede
Colonel - Fallschirmjäger
Colonel - Fallschirmjäger
Posts: 1490
Joined: Wed Mar 15, 2017 7:48 pm

Re: Adding custom units to a purchase list

Post by dalfrede »

Do you need a 'TypeLists' file?
Your mod can have it's own units.csv file.
TypeLists.csv is to allow the developers to limit units used without requiring the user to turn on a mod.
There comes a time on every project when it is time to shoot the engineer and ship the damn thing.
Grondel
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1918
Joined: Mon Aug 04, 2014 10:07 pm

Re: Adding custom units to a purchase list

Post by Grondel »

FunPolice749 wrote: Tue Jun 10, 2025 12:58 am Hello everyone, I come here with a quick question as I've been trying to create some custom scenarios and have run into a snag. I am looking to create custom units and have them be purchasable in a custom purchase list. I have the units already created but when trying to create a new purchase list in TypeLists.csv with a custom unit it ends up crashing every-time. I tried looking at other content made by people but couldn't find any examples of what I'm looking to do so I want to reach out here and see if anyone knows what needs to be done or what is causing issues.
To be clear I already have the custom units made, I have the base Units.csv containing the custom units, and I am trying to get them to load when making a new TypeLists.csv
Thanks in advance
for typelist use u can look at any of the AO SCW scenarios that has italiens in it.

If u have any blank lines in the units.csv this will cause a insta crash on start of the game.

if u have more questions, please add more details to ur issue.

sers,
Thomas
FunPolice749
Administrative Corporal - SdKfz 251/1
Administrative Corporal - SdKfz  251/1
Posts: 125
Joined: Thu Apr 30, 2020 11:52 pm

Re: Adding custom units to a purchase list

Post by FunPolice749 »

dalfrede wrote: Tue Jun 10, 2025 1:48 am Do you need a 'TypeLists' file?
Your mod can have it's own units.csv file.
TypeLists.csv is to allow the developers to limit units used without requiring the user to turn on a mod.
My intent is that I am creating a couple scenarios that wants to make use of custom units I have created already. However, I need to restrict people to only purchasing a handful of units (some vanilla and some custom ones). My problem is that I am encountering crashes when using a typelist that involves custom units. I already have the Units.csv and custom units working so they are not the issue.
I do have workarounds but was just seeing if anyone knew how to make this work because those workarounds are gonna involve a lot more work to get what I want compared to just have a typelist restrict things.
Grondel wrote: Tue Jun 10, 2025 8:55 am
for typelist use u can look at any of the AO SCW scenarios that has italiens in it.

If u have any blank lines in the units.csv this will cause a insta crash on start of the game.

if u have more questions, please add more details to ur issue.

sers,
Thomas
I have gotten the typelists working but when loading a custom unit into a typelist and opening a purchase screen is when I crash. The custom units are fully functional in the game already and I only have issues specifically trying to have a custom unit loaded through a typelist to be purchased.
My main example is I have a custom Panther F tank that works in game no problem. But when I make a typelist containing my PantherF and try to open it in game the thing crashes. It's not related to the unit itself as I can load scenarios and play with it just fine. The issue is specifically related to TypeLists and custom units it seems (both work independently but when trying to use a typelist for custom units I crash consistently). I'm unsure as to why that could be the case though.
Grondel
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1918
Joined: Mon Aug 04, 2014 10:07 pm

Re: Adding custom units to a purchase list

Post by Grondel »

FunPolice749 wrote: Tue Jun 10, 2025 12:51 pm I have gotten the typelists working but when loading a custom unit into a typelist and opening a purchase screen is when I crash. The custom units are fully functional in the game already and I only have issues specifically trying to have a custom unit loaded through a typelist to be purchased.
My main example is I have a custom Panther F tank that works in game no problem. But when I make a typelist containing my PantherF and try to open it in game the thing crashes. It's not related to the unit itself as I can load scenarios and play with it just fine. The issue is specifically related to TypeLists and custom units it seems (both work independently but when trying to use a typelist for custom units I crash consistently). I'm unsure as to why that could be the case though.
I have a hunch that involve a lazy programmer. u can do the following to test if i am right.

Add ur modded units.csv to the games units.csv in the data folder of the game.
Add ur modded unit to the typelist and add the typelist to the scenario(since u got this working with none custom units u know how to do it.)

If it does not crash, u now know why and what is causing it.

If it still crashes, feel free to add me on discord(handle is grondel)and send me the files so i can have a closer look.

sers,
Thomas
FunPolice749
Administrative Corporal - SdKfz 251/1
Administrative Corporal - SdKfz  251/1
Posts: 125
Joined: Thu Apr 30, 2020 11:52 pm

Re: Adding custom units to a purchase list

Post by FunPolice749 »

Grondel wrote: Tue Jun 10, 2025 2:08 pm
FunPolice749 wrote: Tue Jun 10, 2025 12:51 pm I have gotten the typelists working but when loading a custom unit into a typelist and opening a purchase screen is when I crash. The custom units are fully functional in the game already and I only have issues specifically trying to have a custom unit loaded through a typelist to be purchased.
My main example is I have a custom Panther F tank that works in game no problem. But when I make a typelist containing my PantherF and try to open it in game the thing crashes. It's not related to the unit itself as I can load scenarios and play with it just fine. The issue is specifically related to TypeLists and custom units it seems (both work independently but when trying to use a typelist for custom units I crash consistently). I'm unsure as to why that could be the case though.
I have a hunch that involve a lazy programmer. u can do the following to test if i am right.

Add ur modded units.csv to the games units.csv in the data folder of the game.
Add ur modded unit to the typelist and add the typelist to the scenario(since u got this working with none custom units u know how to do it.)

If it does not crash, u now know why and what is causing it.

If it still crashes, feel free to add me on discord(handle is grondel)and send me the files so i can have a closer look.

sers,
Thomas
Well good news is that it's now working all of a sudden. I went into my modded Units.csv and fixed a unit that had a space in it's name (a mortar unit for Germany) and after such a change it's working like a charm. So I'm guessing that is what was causing the issue all along? I find it weird I was able to actively play and use this unit both in the editor and the actual game with no issue but then caused all custom units to break in regards to typelists. It's always some little thing lol
Thank you and other responders for the help :D
Grondel
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1918
Joined: Mon Aug 04, 2014 10:07 pm

Re: Adding custom units to a purchase list

Post by Grondel »

FunPolice749 wrote: Wed Jun 11, 2025 1:53 am Well good news is that it's now working all of a sudden. I went into my modded Units.csv and fixed a unit that had a space in it's name (a mortar unit for Germany) and after such a change it's working like a charm. So I'm guessing that is what was causing the issue all along? I find it weird I was able to actively play and use this unit both in the editor and the actual game with no issue but then caused all custom units to break in regards to typelists. It's always some little thing lol
Thank you and other responders for the help :D
spaces in unit names as well as empty rows don´t go well in *.csv files :)

good u caught that one, finding those can be a pain.

sers,
Thomas
Post Reply

Return to “Panzer Corps 2 Scenario Design”