User avatar
pgr
General of the Army
Posts: 669
Joined: Fri Jan 24, 2014 9:33 pm
Location: Paris France (by way of Wyoming)

Modding units

Sat Sep 14, 2019 6:40 am

Quick question... When modding the Unit models, the database excels have 2 excel files v9q and v9t. At first look they seem to be the same. Should one be used over the other?

User avatar
Nikel
Posts: 2879
Joined: Sun Apr 20, 2008 8:38 pm

Re: Modding units

Sat Sep 14, 2019 2:08 pm

Probably the differences are minor and difficult to notice.

But I'd use the last version, v9t.

User avatar
pgr
General of the Army
Posts: 669
Joined: Fri Jan 24, 2014 9:33 pm
Location: Paris France (by way of Wyoming)

Re: Modding units

Wed Jan 15, 2020 11:29 pm

Another question. How do I actually concert the database into a mld file with the csv splitter? I made changes to the base excel, saved the sheet as a csv file, but when i use the splitter, there is a long error message ( exception). Am I missing something?

User avatar
Bohémond
Posts: 2799
Joined: Wed May 14, 2008 8:47 pm

Re: Modding units

Thu Jan 16, 2020 12:22 am

Could you post a screenshot of the CSV splitter error message ?

Most common causes are empty cells or Notes columns

Regards

User avatar
pgr
General of the Army
Posts: 669
Joined: Fri Jan 24, 2014 9:33 pm
Location: Paris France (by way of Wyoming)

Re: Modding units

Thu Jan 16, 2020 8:46 am

Hope this clarifies
Error example.jpg
Error example.jpg (151.62 KiB) Viewed 8602 times

User avatar
Bohémond
Posts: 2799
Joined: Wed May 14, 2008 8:47 pm

Re: Modding units

Thu Jan 16, 2020 12:37 pm

In the xls file, remove all the comments columns (the ones with the name starting with a §).
Save the xls with a different name (I usually add _ForExport) at the end of the file name).
And then save it as a CSV file.

The above will fix 80% of the splitter error message.
If the issues comes from the remaining 20%, there is a more cumbersome method.


Let us know.

Regards

User avatar
pgr
General of the Army
Posts: 669
Joined: Fri Jan 24, 2014 9:33 pm
Location: Paris France (by way of Wyoming)

Re: Modding units

Thu Jan 16, 2020 11:32 pm

Bohémond wrote:In the xls file, remove all the comments columns (the ones with the name starting with a §).


So I removed the comments columns, and still had an error. I noticed the splitter did not like null values...so i deleated them out. And still no sucess (although the error message has changed!)

Would anyone be willing to share a properly formatted csv file so that i can compaire mine ? (Right now i have yet to modify anything. I am just trying to split one of the DB excels)

User avatar
Bohémond
Posts: 2799
Joined: Wed May 14, 2008 8:47 pm

Re: Modding units

Thu Jan 16, 2020 11:51 pm

I will provide the formatted csv later tonight.

What is the new error message ?

Regards

User avatar
Bohémond
Posts: 2799
Joined: Wed May 14, 2008 8:47 pm

Re: Modding units

Fri Jan 17, 2020 3:11 am

CW2_DB_Models_v9t.zip
(116.89 KiB) Downloaded 238 times


Try the above and let us know.

Regards

User avatar
pgr
General of the Army
Posts: 669
Joined: Fri Jan 24, 2014 9:33 pm
Location: Paris France (by way of Wyoming)

Re: Modding units

Fri Jan 17, 2020 9:26 am

Thanks for the example file. Yours split properly (there was an error message for a corrupted line, so a mdl file was not created, but it worked.)

I compared your CSV file to mine, and it looks like I'm doing something wrong when creating the CSV file. In yours, all the data is in one column separated by columns, where as mine has kept each data set in its own original cell.

CW2_DB_Models_v9t_test-pgr.zip
(106.9 KiB) Downloaded 211 times

User avatar
Bohémond
Posts: 2799
Joined: Wed May 14, 2008 8:47 pm

Re: Modding units

Fri Jan 17, 2020 2:44 pm

You need to configure the csv export from .xls.
The configuration method depends on the office suite you are using.
For example:
https://www.ablebits.com/office-addins- ... not-parsed


Convert CSV to Excel: problems and solutions
The CSV format has been around for over 30 years, but notwithstanding its long history it has never been officially documented. The name CSV (comma-separated values) implies the use of comma to separate data fields. But this is in theory. De facto, many so-called "CSV" files use other characters to separate data, such as:

Tabs - TSV files (tab-separated values)
Semicolon - SCSV files (semicolon separated values)
Some implementations of CSV files wrap data fields in single or double quotation marks, while others require a Unicode byte order mark (BOM), e.g. UTF-8, for correct Unicode interpretation.

This lack of standard spawns various problems you may be faced with when trying to convert an Excel file to CSV and especially when importing a .csv file to Excel. Let's investigate these issues beginning with the most common one.

CSV file is incorrectly displayed in Excel (all data is displayed in the 1st column)

Symptoms. You are trying to open a .csv file in Excel and all of the data is displayed in the first column.

Cause. The root of the problem is different separators set in your Windows regional and language settings and the csv file. In North America and some other countries, the default List Separator is a comma. While in European countries the comma (,) is reserved as the Decimal Symbol and the List Separator is set to semicolon (;).

Solutions. There are several possible solutions for this problem, you can quickly look through the recommendations below and choose the one most suited for your particular task.

Specify the right separator directly in the CSV file. Open the CSV file with any text editor (even the usual Notepad will do) and add the below text in the first line. Note, it should be a separate line before any data:
To separate with comma: sep=,
To separate with semicolon: sep=;
As you can guess, you can set any other custom separator in the same way, simply type it after the equality sign.

Choose the needed separator in Excel. In Excel 2016, 2013 or 2010, go to the Data tab > Data Tools group > Text To Columns.
Run the Text To Columns wizard in Excel.
The Convert Text to Column wizard, choose the Delimited file type ad click Next. Then select the needed separator in the next step and click Finish.
Select the needed separator for the CSV file.

Change the .csv extension to .txt. Opening a .txt file in Excel will start the Text Import Wizard and you can choose any delimiter as discussed in importing a csv file to Excel.
Open a semicolon delimited CSV file with VBA.
Here is a sample VBA code to open a semicolon delimited CSV file in Excel. Though the code was written a few years ago for older Excel versions (2000 and 2003), if you are pretty comfortable with VBA, you won't have problems with updating it or modifying for comma delimited CSV files.

Note. All of the solutions above change the separator for a given CSV file only. If you'd rather change the default separator once and for all, proceed with solution 5.
Change separators in Region and Language settings.
Click the Start button and open the Control Panel, then click Region and Language > Additional Settings. The customize Format dialog window will open and you choose a dot (.) as the Decimal symbol and a comma (,) as the List separator.

Change separators in Windows Region and Language settings.

Click OK twice to close two dialog windows and you are finished. From now Microsoft Excel will open and display all CSV (comma separated) files correctly.

Note. Setting new decimal and list separators in Control Panel changes the default separator characters for all programs on your computer, not only Microsoft Excel.

User avatar
Pocus
Posts: 25659
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Re: Modding units

Fri Jan 17, 2020 3:32 pm

Thanks Bohemond, you explained the root of the problem quite in details!

User avatar
Bohémond
Posts: 2799
Joined: Wed May 14, 2008 8:47 pm

Re: Modding units

Fri Jan 17, 2020 5:52 pm

Pocus wrote:Thanks Bohemond, you explained the root of the problem quite in details!


You are welcome.

It is nice to see you keep posting on theses forums although you should be fully busy with Empires game.
As it is not too late : Happy New Year :)

User avatar
pgr
General of the Army
Posts: 669
Joined: Fri Jan 24, 2014 9:33 pm
Location: Paris France (by way of Wyoming)

Re: Modding units

Sat Jan 18, 2020 12:37 am

Happy New Year to you both! Thank you for the quick CSV tutorial!

In the end though, fixing the display issue was a dead end. Your csv file splits just fine, and mine does not.

I'll have to compare the two more closely.

As an aside, does the CSV I hung Split correctly on your end? (At the end of the day, I must be doing something wrong when I create the CSV)

Return to “CW2 Mods”

Who is online

Users browsing this forum: No registered users and 5 guests