XML/Resource

From MegaGlest
Revision as of 14:31, 26 March 2011 by Hofmic (talk) (Removed MG Category)
Jump to: navigation, search

Game resources are specified under the resources directory of the tech tree. Each resource will have it's own subdirectory and a resource specification file with the same name as the resource, but ending in .xml.

Note that there are 4 types of resources and that only one of the below can be specified for a single resource.

<?xml version="1.0" standalone="no"?>

<resource>
    <image path="images/image.bmp"/>    <!-- This icon will be displayed on the hud to show how
                                             many resources are available -->

    <type value="static"/>              <!-- Static Resources are "Checked in" when created and
                                             "Checked out" when used. -->

            <-- or -->

    <type value="consumable">           <!-- Consumable resources are created and used whenever the
                                             timer indicates an interval has passed. -->
        <interval value="30"/>
    </type>

            <-- or -->

    <type value="tech">                 <!-- Tech Resources are maps to a Custom Map Object and can
                                             be harvested -->
        <model path="models/gold.g3d"/> <!-- Path to the .g3d model used to display the resouce as
                                             it's being carried by a harvester unit in game. -->
        <default-amount value="1500"/>  <!-- How much can be harvested before the object is removed
                                             from the Map -->
        <resource-number value="1"/>    <!-- Maps the resource to the custom Resource used by the
                                             Map Editor -->
    </type>

            <-- or -->

    <type value="tileset">              <!-- Tileset Resources are mapped to a default Map object,
                                             and can be harvested -->
        <default-amount value="300"/> 
        <tileset-object value="1"/>     <!-- Maps the resource to the tileset object used by the
                                             Map Editor -->
    </type>

</resource>


Back to XML_Definitions