How to write country definition files

Last updated: 12/15/2008

Howtos:

How to create a country file

IMPORTANT: If you create a European country for which there is already a short definition, e.g. you make the French leagues and there is already league_france1_short.xml (in the short_leagues subdirectory of the support_files directory), you have to edit the European cup files (cup_europe_champ_league.xml, cup_europe_uefa.xml and cup_europe__cwc.xml) and change all entries league_france1_short to league_france1 (the sid of the first league of your new country). Otherwise you'll get an error when loading the cup teams.

Countries consist only of leagues, cups and some strings. Let's start with an example (you probably won't need more than that, anyway): the file country_england.xml looks like this:

  <country>
   <name>England</name>
  
    # This is the name of the country.
  
    <symbol>flag_en.png</symbol>
  
    # The symbol, some image file (jpg etc. would
    # work, too).  The file should be somewhere in
    # the support directories.
  
    <sid>england</sid>
  
    # The unique string id of the country. This
    # should be the same as the part of the file
    # name between 'country_' and '.xml'.
  
    <leagues>
  
    # The array of leagues of the country.
  
    # The leagues are given with their string ids,
    # ie.  the corresponding league definition
    # files are called 'league_england1.xml' etc.
  
      <league>england1</league>
      <league>england2</league>
      <league>england3</league>
      <league>england4</league>
      <league>england5</league>
   </leagues>
  
    <cups>
  
    # The array of cups.
  
      <cup>england_fa</cup>
  
      # The cups are also given with their string
      # ids, so one of the cup definition files that
      # gets loaded would be 'cup_england_fa.xml'
  
      <cup>england_league</cup>
      <cup>europe_uefa</cup>
      <cup>europe_cwc</cup>
      <cup>europe_champ_league</cup>
      <cup>supercup_league_vs_cup</cup>
      <cup>supercup_europe_uefa</cup>
      <cup>england_prom_games2</cup>
      <cup>england_prom_games3</cup>
      <cup>england_prom_games4</cup>
      </cups>
  
  </country>

Some notes:

That's it for country files.