units.xml
Data from the units.xml file are used to set up the currency name and its subdivisions, but also weight unit names.
The units.xml file has to be located in the data directory.
Each configuration option in this xml file, is defined using a <unit> tag within the <units> main node, which itself has got an <level> child node, ...
Here is an example:
<?xml version="1.0" encoding="utf-8"?>
<units>
<unit type="currency" base="Kuna" round="0">
<level symbol="Litas" count="1000" round="2"/>
<level symbol="Loti" count="100000" round="4"/>
</unit>
<unit type="weight" base="g" round="0">
<level symbol="kg" count="1000" round="2"/>
</unit>
</units>
Note: This file is used only by the client for customisation purpose.
<unit> node description
The <unit> node is used to define the different values used to bring a specific currency and weight subdivisions within the game.
This node is required by the client.
<?xml version="1.0"?>
<units>
<unit type="currency" base="Kuna" round="0">
...
</unit>
...
</units>
| Parameter name | Type | Mandatory | Default value | Description |
|---|---|---|---|---|
| type | string defined value: 'currency', 'weight' |
Yes | Tells the system whether the unit is for the currency or the weight. | |
| base | string | Yes | Tells the currency/weight name displayed by the client. | |
| round | integer | Yes | Tells the currency round or precision. If equal to 0, every digit is counted. A round of 10 would make the currency display 0 for every digit before the dozen. |
Note: Only one currency and one weight unit should be defined in the units.xml file for consistency.
<level> node description
The <level> node is used to set each currency/weight sublevels.
This node is optional.
<?xml version="1.0" encoding="utf-8"?>
<units>
<unit type="currency" base="Kuna" round="0">
<level symbol="Litas" count="1000" round="2"/>
<level symbol="Loti" count="100000" round="4"/>
...
</unit>
...
</units>
| Parameter name | Type | Mandatory | Default value | Description |
|---|---|---|---|---|
| symbol | string | Yes | Tells the currency/weight name subdivision displayed by the client. | |
| count | integer | Yes | Tells the currency/weight subdivision base count. If equal to 0, it would be equal to the parent currency/weight. Eg: A Byte would have a count of 8 relatively to the Bit. | |
| round | integer | Yes | Tells the currency/weight subdivision round or precision. If equal to 0, every digit is counted. A round of 10 would make the currency display 0 for every digit before the dozen. |