XML Cities Text Utility

Stardog13

Chieftain
Joined
Nov 13, 2003
Messages
55
After recently modding in the celts I found that the most time consuming part was creating the list of cities so I wrote a command line c++ program really quickly to convert a simple list of cities to xml data that can be copied into the xml files to quickly create a city list. I'm working on creating a user interface for this but wanted to post this first.

To use the program go to the command line (start->run cmd) and browse to the folder the program is in. Type cities2xml.exe input.txt output.xml; where input.txt is the text file that contains the list of cities and output.xml is the file that will be created (it will overwrite any data in that file). The list of cities should contain one city per line. For all of the foreign languages it uses the city name masculine singular (just something to get them in xml quickly).

I've also included the source code (it's not really that difficult or large) for reference. Enjoy, and I hope this makes modding in civs a lot easier. Please leave any comments or suggestions.

Edit: Just realised this has a problem with any city names with spaces in them, for now you can replace the spaces with an underscore '_' and it'll work fine, the names will just have an underscore in them; I'll have a fix up soon.

Edit: Ok, it's fixed now one small thing though, it doesn't like it if you don't have a newline at the end of the file, it'll crash while running through the program and not export the full xml data. I've also included a sample input and output file.

Edit: Ok, one more update... You now need to pass it a third parameter which is the filename for a file that it will create to output just the list of city tags that can be used for the civ info xml.
 

Attachments

Back
Top Bottom