The Data directory
Prev
Next

The Data directory

The onu.xml file

This files is a description of the content of the skin. It is used to describe the organization of the world and how to display it. It has the following structure:

        onu 
        (
          (skinSpritesData (intItem | strItem )*)
          (country (flag-point cannons-point cavalry-point infantry-point neighbours (neighbour*) ) )*
          nationality*
          (continent (continent-country))*
        )
      

An onu tag contains a skinSpritesData tag, a number of country tags, a number of nationality tags and lastly a number of continent tags. The skinSpritesData itself contains a number of intItem or strItem tags. The country tag contains some object point tags and a neighbours tag, itself containing a number of neighbour tags.

Tags parameters

Table 5.1. 

Tag nameAttribute nameAttribute type and signification
onuwidthThe width of the skin's map
 heightThe height of the skin's map
 skinpathThe path of the skin relative to the application data path (e.g. skins/default)
 nb-countriesThe number of countries (42 in the default skin). There should be the same number of country tags below
 nb-nationalitiesThe number of nationalities (6 in the default skin). There should be the same number of nationality tags below
 nb-continentsThe number of continents (6 in the default skin). There should be the same number of continent tags below
 mapThe path and name of the map file relative to the skin path (e.g. Images/map.png)
 map-maskThe path and name of the map mask file relative to the skin path (e.g. Images/map-mask.png)
 format-versionThe version of the skin file format (1.2, unsused for the moment)
intItemkeyThe name of the item
 valueThe value of the item interpreted as an integer
strItemkeyThe name of the item
 valueThe value of the item interprted as a string
countryidThe integer unique identification number of the country
 nameThe displayed name of the country, currently not internationalized
<sprite>-point Each type of sprite (flag, infantry, etc.) in the country is displayed a a certain position defined by this tag
 xThe X-coordinate at which the top left point of the object will be displayed on the map (starting at left)
 yThe Y-coordinate at which the top left point of the object will be displayed (starting at top)
neighbouridThe id of a neighbour of the current country
nationalitynameThe name of the nationality (e.g. Japan)
 flagThe name of the country's flag sprite file
continentnameThe name of the continent (e.g. Africa)
 bonusThe number of armies obtained at the end of the turn by the player owning all the countries of the continent
continent-countryidThe id of one of the countries inside the current continent

The skinSpritesData tag

This tag has a special organization: each type of sprite (flag, infantry, cavalry, cannon, firing cannon and exploding cannon) is defined by some intItem and strItem and there is two more intItem giving positioning hints for animations. The table below shows all the elements of the skinSpritesData tag with some explanations. Only some sprites have a width data. These are used for relative positioning during animations: the cannons, firing or explosing should not "move" around the country's flag during fight.

Table 5.2. 

Key valueEntry typeSignificationValue in the default skin
flag-widthintItemThe width of the flag sprites frames20
flag-framesintItemThe number of frames of the flag sprites4
flag-versionsintItemThe number of versions of the flag sprites1
infantry-filestrItemThe filename of the infantry spriteinfantry.png
infantry-framesintItemThe number of frames of the infantry sprites1
infantry-versionsintItemThe number of versions of the infantry sprites3
cavalry-filestrItemThe filename of the cavalry spritecavalry.png
cavalry-framesintItemThe number of frames of the cavalry sprites1
cavalry-versionsintItemThe number of versions of the cavalry sprites3
cannon-filestrItemThe filename of the cannon spritecannon.png
cannon-widthintItemThe width of the cannon sprites frames32
cannon-framesintItemThe number of frames of the cannon sprites2
cannon-versionsintItemThe number of versions of the cannon sprites3
firing-filestrItemThe filename of the firing cannon spritefiring.png
firing-widthintItemThe width of the firing cannon sprites frames64
firing-framesintItemThe number of frames of the firing cannon sprites4
firing-versionsintItemThe number of versions of the firing cannon sprites2
exploding-filestrItemThe filename of the exploding cannon spriteexploding.png
exploding-framesintItemThe number of frames of the exploding cannon sprites4
exploding-versionsintItemThe number of versions of the exploding cannon sprites2
fighters-flag-y-diffintItemThe height difference between flags and cannons sprites-12
width-between-flag-and-fighterintItemThe number of pixels between the left most pixel of the flag and the right most pixel of the simple cannon (when not firing nor exploding)32

Prev
Next
Home