Sorter for civilizations and leaderheads

Terkhen

King
Joined
Aug 1, 2011
Messages
917
Location
Valencia
This console application allows to sort civilizations and leaderheads in your XML. It takes the path to your Assets folder as parameter, takes the required XML files and sorts both civilizations and leaderheads depending on their <Type> tag. To use it, just open a console, navigate to the path were you saved civxmlsorter.jar and write:

Code:
java -jar civxmlsorter.jar Absolute_path_to_Assets_folder

You can find civxmlsorter.jar (and its source code) in the attached rar file. If it complains about missing java you will need to install java.

A few notes:
* civxmlsort is quite simple, but it has only been tested with my own XML files and currently it creates NO backups before modifying the existing XML files. I strongly suggest to create a backup of your Assets folder before trying civxmlsort.

* civxmlsort is a console application, which means that it comes with no visible interface. I don't plan to add an interface to this application.

* Currently the application sorts by the Type tag, not by the actual text referenced by the tag. If your civilization names don't match their tags this will lead to funny results. In the future I plan to use the text instead of the tag, but keep in mind that this sorting would be language dependent.

* Fixing the sorting for the Custom Game / Multiplayer game windows will mess up the current sorting for the Play Now window. This means that leaders of a given civilization will not appear in the same order anymore when you select any civilization.

* The sorting of some tags is hardcoded. "Barbarian" and "Random" tags from Fall from Heaven II will always appear at the top (with random alignments sorted correctly). This should not give any problem if those tags are missing from your project. If anyone is interested on always putting certain tags at the top or at the bottom I could add support for customizing sorting for some tags.

* Sorting your XML files will make merging modcomps that don't have them sorted too far more complicated. It's easier to keep a backup from before sorting, merge against that and then sort again.

I'll like to hear your feedback, and feel free to drop me a line at this thread if you have any trouble with this app. Just remember, since it is a small experiment, create a backup before using it :)
 

Attachments

  • example.jpg
    example.jpg
    134.5 KB · Views: 437
  • civxmlsort.rar
    civxmlsort.rar
    6.7 KB · Views: 188
Of course, you can always sort your leaders and civilizations in any way you want by just editing your XML and placing each leader/civilization where you want manually. This application is meant for sorting the XML files quickly with just running it once. Projects with already sorted leaderheads/civilization files don't need to use this.
 
Back
Top Bottom