XML/Tileset

From MegaGlest
Revision as of 18:37, 12 February 2011 by Hofmic (talk)
Jump to: navigation, search

The tileset XML defines how the tileset is to be used.

<?xml version="1.0"?> <!-- Declare XML header -->
<tileset>
  <surfaces>
    <!--
       Define our surfaces. There are 5 surfaces (6 in MegaGlest,
       for cliffs). There can be multiple textures, and the probability
       is the chance of that one type being used, which must add up
       to zero.
    -->
    <surface>
      <texture path="textures/surface1a.bmp" prob="0.5" />
      <texture path="textures/surface1b.bmp" prob="0.5" />
    </surface>
    <surface>
      <texture path="textures/surface2.bmp" prob="1.0" />
    </surface>
    <surface>
      <texture path="textures/surface3.bmp" prob="1.0" />
    </surface>
    <surface>
      <texture path="textures/surface4.bmp" prob="1.0" />
    </surface>
    <surface>
      <texture path="textures/surface5.bmp" prob="1.0" />
    </surface>
  </surfaces>
  <objects>
    <!--
       Objects are similar, there are 10 objects, the last
       being an invisible, unwalkable "none" object meant for
       use as an invisible barrier that should not be changed.
       Multiple models can be used, and are randomly placed.
       Objects should generally be the same type as they were
       based on (ie: object 1 should be a type of tree), and it's
       very important that you maintain standards in walkability,
       which defines whether or not you can walk through the object.
    -->
    <!-- Object 1 - Tree -->
    <object walkable="false">
      <model path="models/tree_1.g3d" />
      <model path="models/tree_2.g3d" />
    </object>
    <!-- Object 2 - Dead Tree -->
    <object walkable="false">
      <model path="models/dead_tree.g3d" />
    </object>
    <!-- Object 3 - Stone -->
    <object walkable="false">
      <model path="models/stone.g3d" />
    </object>
    <!-- Object 4 - Bush -->
    <object walkable="true">
      <model path="models/bush.g3d" />
    </object>
    <!-- Object 5 - Riverside Object -->
    <object walkable="true">
      <model path="models/riverside_object.g3d" />
    </object>
    <!-- Object 6 - Grass -->
    <object walkable="true">
      <model path="models/grass.g3d" />
    </object>
    <!-- Object 7 - Hanged/Impaled -->
    <object walkable="false">
      <model path="models/hanged.g3d" />
    </object>
    <!-- Object 8 - Statues -->
    <object walkable="false">
      <model path="models/statue.g3d" />
    </object>
    <!-- Object 9 - Big Stone -->
    <object walkable="false">
      <model path="models/big_stone.g3d" />
    </object>
    <!-- Object 10 - Non-Walkable None -->
    <object walkable="false">
      <model path="models/none.g3d" />
    </object>
  </objects>
  <ambient-sounds>
    <day-sound enabled="true" path="sounds/day.ogg" play-always="false" /> <!-- Sound to play when day -->
    <night-sound enabled="true" path="sounds/night.ogg" play-always="false" /> <!-- Sound to play when night -->
    <rain-sound enabled="true" path="sounds/rain.ogg" /> <!-- Sound to play if the weather is raining -->
    <snow-sound enabled="false" /> <!-- Sound to play if the weather is snowing -->
    <day-start-sound enabled="true" path="sounds/chicken.wav" /> <!-- Sound to play when day starts -->
    <night-start-sound enabled="true" path="sounds/wolf.wav" /> <!-- Sound to play when night starts -->
  </ambient-sounds>
  <parameters>
    <!--
       Water textures are looped to make an "animation" for the
       water. You can use as many as you want, and 8 or more is
       recommended.
    -->
    <water effects="true">
      <texture path="textures/water_1.tga" />
      <texture path="textures/water_2.tga" />
    </water>
    <!--
       Fog adds a small fog to the map. The mod is the type of OpenGL
       fog to use, the density is the thickness of the fog, and the
       three color attributes are the RGB value of the fog's color.
    -->
    <fog enabled="true" mode="2" density="0.010" color-red="0.0" color-green="0.3" color-blue="1" /> 
    <sun-light red="1" green="1" blue="1" /> <!-- RGB color of day light -->
    <moon-light red="0.2" green="0.2" blue="0.3" /> <!-- RGB color of night light -->
    <day-night value="0.6" /> <!-- Ratio of the day to night length -->
    <!--
       Weather has 3 possibilities, sun, rain, and snow, and will stay
       the same weather type the duration of the game. The values are
       percentages out of a total of 1 which define the chances of having
       that weather. They must add up to 1.
    -->
    <weather sun="0.6" rain="0.4" snow="0" />
  </parameters>
</tileset>

See Also