Global XML Mappers Instructions

Trouble getting the game to run? Ask here!
Post Reply
snoopy55
Posts: 1962
Joined: Mon Nov 06, 2006 5:13 am
Location: Centralia, Ill, USA

Global XML Mappers Instructions

Post by snoopy55 » Mon Feb 19, 2007 12:58 am

The main reason that Global XMLs were started was when Railroads! loads files, it looks for the latest file loaded. For instance, if you load Super Bowl Express you also load a RRT_Goods.xml. Playing this map at that time, the game uses that file to referance all Goods. Now if I write a map and in it I also place a RRT_Goods.xml and you download it and play it, it also will run fine. The problem comes when you go back and attempt to play Super Bowl Express. It WILL crash. The reason is that it will search for the newest file called RRT_Goods.xml and it will load mine, which will be missing needed information. Bummer.....

The answer is to give it only one set of files to access, which is just what Firaxis did when they created the game. What we are trying to do is give it a newer set of XML files to get all its information from, and keep it updated with each new thing created by mappers.

Go ahead and create your map and get it working the way you want it to.

We'll call the ones we use for examples Hometown.

Now we'll set it up so it can make use of the Global files.

The best thing to do at this time is use a program like XML Notepad 2007 to open, translate and save each of the XML files. This will give them the indent structure that helps to edit them

If you used the editor to make your map, then it will already be ready to use. Zip it and upload it.

If you want to make changes such as you want to have a Dairy Farm take in Grain to put out Milk, then you only need to make the simple changes in your XML. Your RRT_Goods_Hometown.xml file will contain the following:

<RRTIndustry>
<szName>Dairy Farm</szName>
</RRTIndusrty>

You simply add to it so it looks like this:

<RRTIndustry>
<szName>Dairy Farm</szName>
<Production>
<!--1 Grain Produces 1 Milk-->
<Resource>
<Input>Grain</Input>
<Output>Milk</Output>
<InputOutputRatio>1.0</InputOutputRatio>
</Resource>
</Production>
</RRTIndustry>

The 4th line is only for referance and is un-needed. The 8th line is also un-needed if you're only doing 1 in 1 out.

Others have changed things such as lowest/highest prices.let's say you think the price of 'Grain' is to high. The original looks like this:

<MinPrice>8000</MinPrice>
<MaxPrice>16000</MaxPrice>


Now if you change it in the Global Goods, all 'Grain' on your maps will be this price. To make it only on this map, you simply add lines to the Editers XML so it looks like this:

<Good>
<szName>Grain</szName>
<MinPrice>4000</MinPrice>
<MaxPrice>10000</MaxPrice>
</Good>

Now on this map and only this map, those prices will be seen for 'Grain'.

Now we're going to create a new industry and call it Yogart Plant. It will use Milk and look like the Refinery. It will ship out in Food Cars.

First thing to do is open the global RRT_Industries.xml file and search for the Refinery. Highlight and copy everything from <RRTIndustry> to </RRTIndustry>

<RRTIndustry>
<szName>Refinery</szName>
<szModel>refinery.kfm</szModel>
<szGrowKFM>refinery_build_up.kfm</szGrowKFM>
<szTerrainmap />
<fScale>1</fScale>
<bIsCoastal>0</bIsCoastal>
<bIsMountainous>0</bIsMountainous>
<bInCity>1</bInCity>
<iCost>500000</iCost>
<Production>
<!--x oil produces y manufactured goods-->
<Resource>
<Input>Oil</Input>
<Output>Manufactured Goods</Output>
<InputOutputRatio>1.0</InputOutputRatio>
</Resource>
</Production>
<szAuctionImage>Industry_Refinery.dds</szAuctionImage>
<szReportImage>Report_Industry_Refinery.dds</szReportImage>
<szIcon>
<szFile>icon_refinery_32.tga</szFile>
</szIcon>
</RRTIndustry>

Paste it just below the one you just copied it from.

Now we'll give it it's name. Change 'Refinery' in the 2nd line to 'Yorgart Plant'. Leave the rest of referances to 'Refinery' as they are for now.

Skip down to the 12th line, which is an information line, and change it to <!--x milk produces y food-->

Of course we don't want to take in 'Oil', so change that to 'Milk' and change 'Manufactured Goods' to 'Food'.

In line 22, change 'icon_refinery_32.tga' to 'icon_fromagerie_32.tga'.

Finished! Of course, some will say you could have done it easier starting with the Fromagerie, but the idea is to show how to change things. You could copy the image files used for either factory and make some changes and a new icon to show Milk to a container of Yogart and make a new Train Cars for it, and calling it Yorgart instead of Food.

Here's what the new Industry XML will look like:

<RRTIndustry>
<szName>Yogart Plant</szName>
<szModel>refinery.kfm</szModel>
<szGrowKFM>refinery_build_up.kfm</szGrowKFM>
<szTerrainmap />
<fScale>1</fScale>
<bIsCoastal>0</bIsCoastal>
<bIsMountainous>0</bIsMountainous>
<bInCity>1</bInCity>
<iCost>500000</iCost>
<Production>
<!--x milk produces y food-->
<Resource>
<Input>Milk</Input>
<Output>Food</Output>
<InputOutputRatio>1.0</InputOutputRatio>
</Resource>
</Production>
<szAuctionImage>Industry_Refinery.dds</szAuctionImage>
<szReportImage>Report_Industry_Refinery.dds</szReportImage>
<szIcon>
<szFile>icon_fromagerie_32.tga</szFile>
</szIcon>
</RRTIndustry>

Well, you've made a change in the global file, and you also want these in your map, so open RRT_Industries_Hometown.xml and go to the last industry listed. Highlight from <RRTIndustry> to </RRTIndustry> of the last industry and copy it. Place your curser to the left edge of </Industries>, right click and left click on 'paste'. If </Industries. is to the right of what you pasted in, hit 'Enter'. The last few lines should look like this:

</RRTIndustry>
<RRTIndustry>
<szName>(whatever)</szName>
</RRTIndustry>
</Industries>
</RRTIndustries>

Now go to the name (whatever) and change it to 'Yogart Plant', minus the 's. Save the XML file. The last thing you need to do is the New Release.txt. Unzip the attached NewReleaseTemplate.zip file. You can remove the word 'Template' and leave it like that or replace the word 'Template' with the name of oyur map. Open it and edit the first 6 items. If there are no Mod Dependencies, enter 'None'. Since all we added was a new industry, you need to delete everything from the 'New Trains' line down to just above the 'New Industries' section. Remove the note after 'New Industries', enter your map name in the 2 places specified and delete the last line.

Now remove everything from <RRTIndustry> to </RRTIndustry>. Open your Global Industry XML file and highlight the full Industry you just created. Copy it and paste in the TXT file where you just deleted the RRTIndustry from. That section should look like this:


New Industries
---------
This map adds one or more new indusrties that are not included
with the core game installation.
The following XML code defines the new industries
and must be copied to your global CustomAssets\XML\RRT_Industries.xml
if not already there.

<!-- Start of new industries for Hometown -->

<RRTIndustry>
<szName>Yogart Plant</szName>
<szModel>refinery.kfm</szModel>
<szGrowKFM>refinery_build_up.kfm</szGrowKFM>
<szTerrainmap />
<fScale>1</fScale>
<bIsCoastal>0</bIsCoastal>
<bIsMountainous>0</bIsMountainous>
<bInCity>1</bInCity>
<iCost>500000</iCost>
<Production>
<!--x milk produces y food-->
<Resource>
<Input>Milk</Input>
<Output>Food</Output>
<InputOutputRatio>1.0</InputOutputRatio>
</Resource>
</Production>
<szAuctionImage>Industry_Refinery.dds</szAuctionImage>
<szReportImage>Report_Industry_Refinery.dds</szReportImage>
<szIcon>
<szFile>icon_fromagerie_32.tga</szFile>
</szIcon>
</RRTIndustry>

<!-- End of new industries for Hometown -->

At this point if you're unsure of yourself you can delete the Industry you just created and then copy it from your TXT file, then paste it into your Global Industry XML and test your map. I personally tested the above on my Wisconsin map and found 3 Fromageries and 4 Yogart Plants.

Make sure you have no XML files that do not contain the name of your map in some way. Even if there is no Global XML of its type at this time, One added later may effect your map, or your XML file may effect others.

Place your NewRelease(map name).txt file in your map folder, zip it and upload it.

If there are any questions about anything you don't understand in this or related to this, ask.

These instructions have also been included in the ZIP.
Attachments
Mappers.zip
(4.97 KiB) Downloaded 442 times
I'm correct 97% of the time..... who cares about the other 4%....

snoopy55
Posts: 1962
Joined: Mon Nov 06, 2006 5:13 am
Location: Centralia, Ill, USA

Post by snoopy55 » Mon Feb 26, 2007 11:58 pm

I see alot have viewed this, but none have commented on it. Does it make any sense? Does it help in any way? Did I confuse everyone? Is this 2007 A.D.? :shock:
I'm correct 97% of the time..... who cares about the other 4%....

gforce
Posts: 234
Joined: Thu Nov 09, 2006 3:24 am
Location: Belgium, Brussels

Post by gforce » Tue Feb 27, 2007 1:45 am

I really changed the way i am working right now.
I will and i don't want anymore those global xml files in my custom assets dir.
I'm testing alot, i constantly changing industries, their names, goods, and changing settings for all of this.
I do store rrt_goods.xml and others in my map-folder, if i want to work on another test-map, i simply move test-map1 with all the normal xml-files included in the map-folder to the xusermap, and put my other test-map-folder with all the files in the usermaps...
believe me, there's no simplier way to play.
The only problem i can get this way is that when i want to play a map made by someone using 'the global xml-files' and so don't have everything nice and easy in 1 folder, then it's really a problem, otherwise i had just to move it from xusermaps to usermaps, and now i have to take care of the global files aswell...
didn't you noticed yet, that people are having problems with those global xml-files, they have never seen a xml-file, or it's so easy to do a stupid fault while doing copy-past etc... it's not badly explained, it's just easy to get it wrong by a stupid fault (i bet that ezveryone can move a folder much easier and this all without reading posts and posts and xml-code)
at the end, who wants to play another scenario, if they think they will again have to edit all those xml-files... you're making a simple thing too difficult
plz, take 1 minute to think about it, instead of helping and explaining a self-made-complex thing...
really, no offence! :oops: i do respect your efforts and will to help everyone with their problems they have now with this procedure... :(

Post Reply