Home | Webstore
Latest News: OOTP 25 Available - FHM 10 Available - OOTP Go! Available

Out of the Park Baseball 25 Buy Now!

  

Go Back   OOTP Developments Forums > Out of the Park Baseball 25 > OOTP Mods > OOTP Mods - Names and Nations

Reply
 
Thread Tools
Old 05-12-2021, 11:28 AM   #21
joefromchicago
Hall Of Famer
 
joefromchicago's Avatar
 
Join Date: Jun 2011
Posts: 3,630
scottbullett: Please start a new thread in this sub-forum for all of your questions. This thread is intended for queries regarding the nameset lists themselves.

Thanks
joefromchicago is offline   Reply With Quote
Old 03-21-2024, 11:23 PM   #22
LukeToussaint
Bat Boy
 
Join Date: Nov 2022
Location: Glenview, IL
Posts: 7
Quote:
Originally Posted by joefromchicago View Post
MODDING THE NAMES.XML FILE
PART I: ADDING NAMES


Starting with OOTP version 23, names are included in an xml file rather than the previous csv (comma separated values) files. As a result, any mod in the old csv format will need to be converted into the new xml format in order for it to work with any version of the game after version 22. This tutorial, therefore, will go through the process of changing csv namesets into the xml format.

A few things to note about the names.xml file, which can be found in the database folder, located inside the game's data folder):
  • All names are now located in a single file. That means there are no longer separate files for first names, last names, and nicknames;
  • Each name now has a unique ID number;
  • Each name is now translated into Spanish, Korean, Chinese, and Japanese.
Some elaboration is needed for that last item: the translations are not necessary in order for the names to work. They are only necessary if you want your game to have names written in Spanish, Korean, Chinese, or Japanese (I believe the main difference between the English and Spanish names is the addition of diacritical marks to the latter). This tutorial, in contrast, will assume that the vast majority of users will want to add English-language namesets to the game. As such, I will omit instructions for the foreign-language versions of the names. Anyone who wants to add them should be able to follow the steps in this tutorial and make the appropriate changes as needed.

CREATING A SPREADSHEET

You'll want to open up the names.xml file, preferably with an xml editor such as Notepad++. Working directly in the xml file, however, can be daunting. A much easier method involves transferring the data from the names file into a spreadsheet program, editing the data in that program, and then converting back into xml format. To do that, of course, you will need to create a spreadsheet.

I will be using OpenOffice, as it is a widely used program available for free on the internet. It is very similar, but not exactly the same, as Microsoft Excel, so many of the commands, for instance, will be identical. I will note any differences that I'm aware of. Likewise, these instructions are intended primarily for Windows users, although Macintosh spreadsheet programs tend to use the same commands.

Attached here is a template to use when taking a csv nameset and converting the names to xml format. The top line looks like this:

Attachment 868220

There are four blank columns, into which you will enter the following information:

Column B: name ID
Column D: name
Column F: language ID (aka ethnicity)
Column H: distribution (aka frequency)

The other columns are already filled in. You won't be changing any of that information. Instead, you will want to select cells A1 to J1 and "fill down" as many rows as you will need in order to fit the data from your csv nameset (you'll know how many rows you need when you enter your nameset data, which is covered in the next section). To "fill down:"
  1. Select cells A1 through J1;
  2. Go to the last row of your spreadsheet and shift-click on cell J of that row (e.g. if you will be pasting 200 names from a csv nameset, you will want to go to cell J200 and shift-click on it);
  3. Go to the edit dropdown menu and select "Fill Down" (I believe in Excel the keyboard shortcut is ctrl-D - in OpenOffice you would need to create a shortcut for this action).
If you have done everything correctly, all of the information found in row 1 will now appear in every row that you've selected.

ADDING NAMES FROM A CSV NAMESET

In order to transfer the information into the template, you will need to copy and paste the nameset data into a spreadsheet. You don't, however, want to paste that information into the template, as you will be using that to convert your csv data into the new xml format. You will, therefore, want to create a new spreadsheet for this part of the process. You can do that easily by simply going to Sheet2 in the spreadsheet (look for a small tab in the lower left of the screen) and following the steps found here . To recap:
  1. In the csv nameset file, choose "select all" (ctrl-A);
  2. Choose "copy" (ctrl-C);
  3. In the spreadsheet (Sheet2), select cell A1 (top left) and then choose "paste" (ctrl-V);
  4. A dialogue box will appear asking how you want to import the data. Check the box marked "Comma" and press "enter."
Your data should now appear in three columns:

Column A: names
Column B: distribution (frequency)
Column C: language ID (ethnicity)

From here, transferring the data into the template (Sheet1) will be easy:
  1. In your recently created spreadsheet (Sheet2), select cell A1 and then go to the final cell in the column with a name in it. Shift-click to select that cell. That should select all of the cells with names in that column;
  2. Choose "copy" (ctrl-C);
  3. Go to Sheet1 (you can select a sheet by clicking the tabs in the lower left of the screen);
  4. Select cell D1 and choose "paste" (ctrl-V).
All of the names copied from column A of Sheet2 should now appear in column D of Sheet1.

Repeat the above process for the distribution/frequency data found in column B of Sheet2, copying those and pasting them into column H of Sheet1. For the language ID/ethnicity information, you can either copy that information in the same way that you copied the names and distribution data, or else you can enter the language ID in cell F1 and then "fill down" that number to the bottom of your spreadsheet.

CREATING UNIQUE NAME IDs

At this point you should have all of the information from the csv nameset entered into the template. From this point forward, all of your work will be in Sheet1.

You will now need to assign unique name IDs to each of your names. Currently, the highest name ID in the default names.xml file is 309382. You can, therefore, start at 309383 or you can choose some other number that is greater than 309382. If you are adding multiple namesets, you will want to note the range of name IDs for each of those sets, as you will want to avoid inadvertently duplicating name IDs.

An easy way to assign name IDs is as follows:
  1. In cell B1, enter the number that you want as the first ID number for that nameset;
  2. In cell B2, enter the following formula: =sum(B1+1)
  3. Select cell B2 and then go to the end of column B where you want to enter the final name from your nameset (so, e.g., if your nameset has 200 names, you will go to cell B200);
  4. Shift-click on that final cell. All the cells from B2 to the end will now be selected;
  5. In the edit dropdown menu, select "Fill Down" (or ctrl-D in Excel). All of the selected cells will now be filled with numbers in sequence.

CONVERTING THE INFORMATION TO XML FORMAT

If you click on cell J1, you will see a formula in the text box that looks like this:

=A1&B1&C1&D1&E1&F1&G1&H1&I1

In the spreadsheet, however, it will look something like this:

<N nid="400000"><EN>Aaron</EN><NL><L lid="0" dist="100"/></NL></N>

This is the name information from your csv nameset converted to xml format. You will now need to copy the information in column J into the names.xml file. To do that, follow these steps:
  1. In the spreadsheet (Sheet1), select cell J1;
  2. Go to the final cell in column J and shift-click on it. The entire column will now be selected;
  3. Choose "copy" (ctrl-C);
  4. In the names.xml file, go to the appropriate section, either FIRST NAMES, LAST NAMES, or NICKNAMES (your names must be pasted in the appropriate section, as there is no data field in the individual name entry to identify it as a first or last name or a nickname). Create a new line for entering your data by placing the cursor at the end of any existing line and pressing "enter;"
  5. Choose "paste" (ctrl-V).
All of the information from column J in your spreadsheet should now appear in your names.xml file. It will look different because you won't have the translations, but that shouldn't affect how the game treats the information as long as you have selected English as your game's language. Furthermore, it does not matter if your names are not in numerical or alphabetical order. As long as they are in the correct section of the names.xml file, they should work.

Attachment 868223
My XML leads to internet explorer. I need help.
LukeToussaint is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:03 PM.

 

Major League and Minor League Baseball trademarks and copyrights are used with permission of Major League Baseball. Visit MLB.com and MiLB.com.

Officially Licensed Product – MLB Players, Inc.

Out of the Park Baseball is a registered trademark of Out of the Park Developments GmbH & Co. KG

Google Play is a trademark of Google Inc.

Apple, iPhone, iPod touch and iPad are trademarks of Apple Inc., registered in the U.S. and other countries.

COPYRIGHT © 2023 OUT OF THE PARK DEVELOPMENTS. ALL RIGHTS RESERVED.

 

Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright © 2020 Out of the Park Developments