Units.csv edits crashing game

Moderator: Panzer Corps 2 Moderators

Post Reply
charge62
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 102
Joined: Fri Nov 09, 2012 12:05 am

Units.csv edits crashing game

Post by charge62 »

Hi,

I have a new (fresh) install of Win 11. New install of PC2 and running through Steam.

When I edit a unit's traits in Units.csv, the game crashes.

Reverting to the original Units file fixes the problem.

I also tried this using the GC mod and it worked fine, until I made a traits change to its unit file, then a crash.

I haven't been able to figure this out. The only thing that I see as different from my old install, is that in the new install I had PC2 install on a drive different than the the OS. But if that were the problem, then I'd expect the game to crash all the time.

I am missing something obvious. Please, help.

Thanks
Tassadar
Lieutenant Colonel - Elite Panther D
Lieutenant Colonel - Elite Panther D
Posts: 1310
Joined: Mon Mar 11, 2019 1:03 pm

Re: Units.csv edits crashing game

Post by Tassadar »

Can you post a sample of what edits you made? Hard to say for sure without it. Maybe just post a screenshot of a single change to the base file that you checked and confirmed it is crashing the game for you (no other changes, to avoid potentially missing something else)?
charge62
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 102
Joined: Fri Nov 09, 2012 12:05 am

Re: Units.csv edits crashing game

Post by charge62 »

HI Tassadar,

Making changes used to be simple. This baffles me.

I've been trying different traits in different units. For the below error output, GC mod is off and I added the Recon trait to the Panzer IA.

Here is the complete trait list after the change.
(Overrun,MachineGun,Recon)


Here are the top lines of the error output.
VCRUNTIME140
PanzerCorps2_Win64_Shipping!Reflection::Enum<enum UnitClass>::ToValue() [C:\Projects\PanzerCorps2\SVN\trunk\Source\Common\Reflection\RefEnums.h:99]

PanzerCorps2_Win64_Shipping!_Closure_wrapper_d2a3374b_2341::<lambda_invoker_cdecl>() [C:\Projects\PanzerCorps2\SVN\trunk\Source\Common\TxtSerializer.h:44]

PanzerCorps2_Win64_Shipping!LoadCSVTable<UnitType,8>() [C:\Projects\PanzerCorps2\SVN\trunk\Source\Common\CSVTable.h:28]

PanzerCorps2_Win64_Shipping!GameData::Defaults() [C:\Projects\PanzerCorps2\SVN\trunk\Source\GameCore\GameData.cpp:21]

When I go back into to the changed Units.csv and remove the Recon trait from this unit, the game will still crash. The only fix is to restore the backup of Units.csv.

I also tried two different pieces of software to make the edits, Notepad++ and Open Office Spreadsheet (saving in original format for Open Office and not in .ODF format).

It's almost as if there is a change check in force for the Units file. If this were true, others would be reporting the problem.

Thanks for looking at this.
bebro
Slitherine
Slitherine
Posts: 4573
Joined: Sun Nov 19, 2006 12:50 pm

Re: Units.csv edits crashing game

Post by bebro »

I tried it on the most recent unit file from Westwall (v1.16.03) and it seems to be ok, pls. see pic
PzI_recon.jpg
PzI_recon.jpg (319.71 KiB) Viewed 933 times
Trait column has now (Overrun,MachineGun,Recon)
charge62
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 102
Joined: Fri Nov 09, 2012 12:05 am

Re: Units.csv edits crashing game

Post by charge62 »

Hi Bebro,

Thanks for testing. Your result is what I was expecting. Clearly there is a problem with my installation.

The only thing I can think of is to uninstall and reinstall to C:\ instead of G:\. Do you have any other ideas?

I have started work on something I am planning to offer to the GC mod. Once the first part is done, I'll try the uninstall/reinstall. Perhaps later this week.
terminator
Field Marshal - Elefant
Field Marshal - Elefant
Posts: 5995
Joined: Mon Aug 15, 2011 12:48 pm
Location: the land of freedom

Re: Units.csv edits crashing game

Post by terminator »

What software do you use to edit the file csv ?
One must be careful with the options chosen.
The problem often comes from there.
Grondel
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1997
Joined: Mon Aug 04, 2014 10:07 pm

Re: Units.csv edits crashing game

Post by Grondel »

charge62 wrote: Sun Aug 24, 2025 3:46 pm Hi Bebro,

Thanks for testing. Your result is what I was expecting. Clearly there is a problem with my installation.

The only thing I can think of is to uninstall and reinstall to C:\ instead of G:\. Do you have any other ideas?

I have started work on something I am planning to offer to the GC mod. Once the first part is done, I'll try the uninstall/reinstall. Perhaps later this week.
Since u stated that u have a new system i would asume that u are using a diffrent program/diffrent version of a program/diffrent setting of the program to edit the units.csv, which probably is causing the issue.
A Program i can recommend to modify *.csv files is Libre Office Calc, an exel clone, u can get and use for free.

sers,
Thomas
Tassadar
Lieutenant Colonel - Elite Panther D
Lieutenant Colonel - Elite Panther D
Posts: 1310
Joined: Mon Mar 11, 2019 1:03 pm

Re: Units.csv edits crashing game

Post by Tassadar »

charge62 wrote: Sat Aug 23, 2025 3:16 pm I have a new (fresh) install of Win 11. New install of PC2 and running through Steam.
terminator wrote: Sun Aug 24, 2025 4:00 pm What software do you use to edit the file csv ?
One must be careful with the options chosen.
The problem often comes from there.
Grondel wrote: Sun Aug 24, 2025 5:52 pm Since u stated that u have a new system i would asume that u are using a diffrent program/diffrent version of a program/diffrent setting of the program to edit the units.csv, which probably is causing the issue.
A Program i can recommend to modify *.csv files is Libre Office Calc, an exel clone, u can get and use for free.
Might be this. Perhaps the fresh installation has different regional settings within Windows? I had a few cases where incorrect regional settings caused issues on some PCs for users when dealing with Excel, so it would not be out of the realm of possibility. After all, Excel is not a dedicated csv file editor. Libre Office Calc (I happen to use the same) also isn't, but with it I never had problems.
charge62
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 102
Joined: Fri Nov 09, 2012 12:05 am

Re: Units.csv edits crashing game

Post by charge62 »

Thanks for the advice. Problem solved.

For those who find a similar problem, here is what is and is not working for me at this time.

Failed:
Open Office
Notepad++

Success:
Notepad
LibreOffice Calc
Post Reply

Return to “Panzer Corps 2: Tech Support”