View Single Post
Old 08-30-2012, 12:38 PM   #4
Dreifort
Major Leagues
 
Dreifort's Avatar
 
Join Date: Dec 2003
Posts: 307
Added info about creating new Regions to my original post above:


REGIONS:

There is also a new feature added in the world_default.xml file called "Regions".
Regions allow you to specify territories you want your baseball league to cover. Meaning... if I create a new region with ONLY Germany and France referenced, when I create a new league with that new region specified - all the players generated will be born from either Germany or France. Now of course if you set your Foreigner limit (0-100%) more than 0%, you will also have players from outside those two countries as well. Also, any automated teams generated for your new league will use Germany and France for city choices, not just use your designated Nation of origin for your league.

For my new nation of Legend, I want to create a new region that will cover Legend and it's surrounding countries: Canada, USA, Greenland, Iceland, Scotland, Wales, and England. But I don't want players from California (since Legend is on the east coast of USA). The world_default.xml will also let you specify states in your region!

Specifying states is great especially if you wanted to create a West Coast (USA) only baseball league... like the PCL. Works with other nations (keep in mind that some nations in OOTP don't really use states, instead they assign states to individual cities or assign a state to represent the entire country). Using Excel to view the world_default.xml file really comes in handy here. You can open the .xml file in Excel and it will sort all the parameters into columns - sweet! So ALL cities will be in 1 column, as with states, nations, etc. Each in their own respective column. Makes it easy to find state, nation, city ID #s. Continents, Nations, States, Cities, etc. are well labeled. However, the ID #s are not well labeled - they are labeled id1, id2, id3, id4, etc. You will just have to use a little thinking to figure out the id's that match to nation, state & cities. Not to hard as they are usually right next to each other. For example, id13 = State ID #. Anyway, Excel makes it much easier to view and sort the world_default.xml data. Just don't try to edit and then save the data in Excel - it won't work (and even if you make it save, OOTP will not recognize the new file properly). Excel should be for viewing only on the .xml file.

Ok, how to create a new Region the .xml file. Scroll down to the very end of the .xml file and see this code:

PHP Code:
    </REGION>
    </
REGIONS>
</
WORLD
We are going to add the new Region after the last </REGION> but before the </REGIONS>. The plural /REGIONS closes all Region coding, we want our new Region to be inside that bracket, but the last Region added (so make it easier to find to edit later).

Here is my new region to include Legend and it's surrounding nations, but ONLY certain states within the USA:

PHP Code:
    <REGION id="143" sort_order="113" name="Legendary Region">
        <
REGION_NATIONS>
        <
REGION_NATION id="253" />
        <
REGION_NATION id="36" />
        <
REGION_NATION id="250" />
        <
REGION_NATION id="212" />
        <
REGION_NATION id="212" />
        <
REGION_NATION id="153" />
        <
REGION_NATION id="61" />
        <
REGION_NATION id="89" />
        <
REGION_NATION id="164" />
        </
REGION_NATIONS>
        <
REGION_STATES>
        <
REGION_STATE id="167" />
        <
REGION_STATE id="168" />
        <
REGION_STATE id="165" />
        <
REGION_STATE id="164" />
        <
REGION_STATE id="161" />
        <
REGION_STATE id="160" />
        <
REGION_STATE id="159" />
        <
REGION_STATE id="156" />
        <
REGION_STATE id="150" />
        <
REGION_STATE id="148" />
        <
REGION_STATE id="146" />
        <
REGION_STATE id="143" />
        <
REGION_STATE id="141" />
        <
REGION_STATE id="132" />
        <
REGION_STATE id="131" />
        <
REGION_STATE id="130" />
        <
REGION_STATE id="129" />
        <
REGION_STATE id="128" />
        <
REGION_STATE id="127" />
        <
REGION_STATE id="126" />
        <
REGION_STATE id="124" />
        <
REGION_STATE id="122" />
        <
REGION_STATE id="120" />
        <
REGION_STATE id="118" />
        <
REGION_STATE id="135" />
        </
REGION_STATES>
    </
REGION

Region:

You have to open a new Region with the code <REGION> as such:

PHP Code:
    <REGION id="143" sort_order="113" name="Legendary Region"
ID - The Region ID# must be unique to all other Regions created. The default OOTP Regions end at # 142. To add a new region, start with "143". Do not duplicate region ID #s.
SORT_ORDER - This # represents the order in which your region will be listed in the drop down Region selection box within the OOTP game. "1" you will be first listed, "9532" prob means it will be listed last. I do not think duplicate #s will do any harm here. I am going to give my new region a value of "113" hoping to be near the top of the list, but not first 5-10. The default order values vary and are NOT consecutive. Don't know why. Don't worry about it. Just pick a numbner .
NAME - Full name to describe your region. This text is what will be displayed in the drop down Region selection box within the OOTP game.


Now that the <REGION> code is opened for a new region, lets add territories. You can add nations and states.

To add a Nation, open the code with <REGION_NATIONS>, then add 1 or more of the following type line:

PHP Code:
        <REGION_NATION id="61" /> 
ID -Enter the nation ID # you want to add. Example, "61" is England. Ad as many of these lines as you want.

When finished adding nations to your Region, close the nations coding with </REGION_NATIONS>.

Now, let's add some US States and open the States region coding with <REGION_STATES>, then add 1 or more of the following type line:
* NOTE, the nation whose states I am adding, I did not add as a nation in the <REGION_NATION> coding (since I only want certain states of that nation).

PHP Code:
        <REGION_STATE id="165" /> 
ID - Enter the state ID # you want to add to your region. This can be any state, from any nation. Remember each state has their own unique ID #. In my Legend example, "165" is Maine, USA. Ad as many of these as you want.

When finished adding states to your Region, close the states coding with </REGION_STATES>. Then close your new Region coding with </REGION>.
__________________
________________________________________________
Coming soon! Legendary Baseball League.... stay tuned!

Last edited by Dreifort; 08-30-2012 at 12:48 PM.
Dreifort is offline   Reply With Quote