Adding new units - what am I doing wrong?

Moderators: Order of Battle Moderators, The Artistocrats

Post Reply
Darthrafael
Private First Class - Wehrmacht Inf
Private First Class - Wehrmacht Inf
Posts: 9
Joined: Fri Jun 05, 2015 5:21 pm

Adding new units - what am I doing wrong?

Post by Darthrafael »

Second Topic in a short period of time, but I've run into a peculiar issue. I'm doing something wrong when editing the units.csv file in my mod, I just don't know what exactly.

If I copy the default units.csv and run my mod, all works as normal.
If I then open the units.csv, click the save button without making any changes and start the game again I am greeted with a rather weird screen when I open the scenario editor - see the image below.
Keep in mind this is without making any changes to the file. All I did was hit the save button, so I know I'm doing something incorrectly somewhere, I just have no idea where I'm making mistakes. It's probably going to be something obvious, but I'm at a loss for now. Any help would be appreciated.

Thanks in advance!

Image
bru888
Order of Battle Moderator
Order of Battle Moderator
Posts: 6214
Joined: Sun Jan 10, 2016 5:39 pm
Location: United States

Re: Adding new units - what am I doing wrong?

Post by bru888 »

Here's what I have found about editing units.csv; perhaps it will be helpful to you.

First, it's best to copy units.csv someplace, like the Desktop, and edit it there. Copy it back over the original file when finished. Windows is tricky about not allowing files to be edited in programs folders; it appears that you are but you really are not.

Second, not all programs save units.csv in the proper format, even though you select comma-separated value (the format is named CSV but it's actually semicolon in this case). Again, it appears to be saving properly, but there is something wrong and the game will not start properly after that.

There are only two programs that I have used successfully: CSVed and my current favorite, LibreOffice Calc. I respectfully disagree with some of my colleagues who say that Microsoft Excel also works; it never did for me. It would appear to do so, as I mentioned above, but the file was actually corrupted and crashed the game.

By the way, I should mention the need to back up the original units.csv file for just this very reason.
- Bru
GabeKnight
Lieutenant-General - Karl-Gerat 040
Lieutenant-General - Karl-Gerat 040
Posts: 3710
Joined: Mon Nov 27, 2017 10:24 pm

Re: Adding new units - what am I doing wrong?

Post by GabeKnight »

Yeah, best to use some text editor for simple changes. Windows opens CSV files with Excel by default (with Office installed).
Modifying the Units File

bru888 wrote: Tue Oct 29, 2019 9:50 pm I respectfully disagree with some of my colleagues who say that Microsoft Excel also works; it never did for me.
Sure it does. Works for Horst and me, for example. You just have to follow a certain procedure when importing/saving the units file.
I could give you some "how-to" tutorial, if you'd like, but as far as I know, you don't mod the units file that much anyway.
Darthrafael
Private First Class - Wehrmacht Inf
Private First Class - Wehrmacht Inf
Posts: 9
Joined: Fri Jun 05, 2015 5:21 pm

Re: Adding new units - what am I doing wrong?

Post by Darthrafael »

Okay, so I've switched to using LibreOffice, which works without error, but now I'm running into a different problem; I can't seem to actually get most of my units to show up.

I'm probably doing something wrong (again), but I have two units, both copies of existing soviet units. One of them works and shows up (though without an icon, but I might know how to fix that), while the other doesn't.
The one that works is a copy of the conscripts unit, with it's 'name' (name colum) changed to legion_conscripts with an id of 6000.
The one that doesn't work is a copy of the Soviet Infantry '37, with it's name changed to legion_infantry_33 with an id of 6001.

Is there a step I'm missing when it comes to adding new units, or is something else going wrong? I'd post the entire rows for both units, but I haven't edited anything beyond name and id, and I don't know what would be a good way to post them.
GabeKnight
Lieutenant-General - Karl-Gerat 040
Lieutenant-General - Karl-Gerat 040
Posts: 3710
Joined: Mon Nov 27, 2017 10:24 pm

Re: Adding new units - what am I doing wrong?

Post by GabeKnight »

Darthrafael wrote: Wed Oct 30, 2019 9:55 am I don't know what would be a good way to post them.
ZIP the faulty units file and post it here
Darthrafael
Private First Class - Wehrmacht Inf
Private First Class - Wehrmacht Inf
Posts: 9
Joined: Fri Jun 05, 2015 5:21 pm

Re: Adding new units - what am I doing wrong?

Post by Darthrafael »

Nevermind, somehow recopying and rediting seemed to fix it, so idk what it was I did wrong, but I've managed to add custom units now. LibreOffice definitely works better for me than Excel did, so it has my vote of approval.
bru888
Order of Battle Moderator
Order of Battle Moderator
Posts: 6214
Joined: Sun Jan 10, 2016 5:39 pm
Location: United States

Re: Adding new units - what am I doing wrong?

Post by bru888 »

Darthrafael wrote: Wed Oct 30, 2019 8:02 pm LibreOffice definitely works better for me than Excel did, so it has my vote of approval.
I dimly remember language and regional settings in Microsoft Office programs. Under regional settings, there was "Locale" which, according to this source, "Controls how locale-specific information, such as numbers, dates, time, and calendar settings are displayed on the site. The default values for all of the other regional settings are based on the locale that you choose."

[Yes, I know they are talking about SharePoint which is "a web-based collaborative platform that integrates with Microsoft Office" so I assume it's talking about the same settings as a standalone installation.]

I would imagine that Excel with U.S. set as locale may function differently from Excel set for a European location, in certain respects. That is the only thing that I can think of which might explain why Excel would work for some of us and not others in editing units.csv. Luckily for me, and you perhaps, LibreOffice Calc works for this purpose "right out of the box." I never have tinkered with any such settings in LibreOffice.
- Bru
Post Reply

Return to “Order of Battle : World War II - Scenario Design”