Difference between revisions of "XML/Techtree"

From MegaGlest
Jump to navigation Jump to search
 
 
(18 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<?xml version="1.0" standalone="no"?>
+
([[XML|Back to XML Overview ]])
+
 
<tech-tree>
+
The [[techtree]] [[XML]] is placed in the root folder of a [[techtree]], and stores all the attack and armor types, as well as the damage multipliers that result from them. The techtree XML is the same among all [[Engines|forks]] of Glest.
    <description value="experimental tech tree"/>
+
 
    <attack-types>          <font color="green">&lt;!--naming types of attacks --&gt;</font>
+
 
        <attack-type name="sword"/>
+
 
        <attack-type name="arrow"/>
+
==XML==
        <attack-type name="magic"/>
+
<syntaxhighlight lang="xml">
    </attack-types>
+
<?xml version="1.0" standalone="no"?>
    <armor-types>          <font color="green">&lt;!--naming types of armor --&gt;</font>
+
<tech-tree>
        <armor-type name="leather"/>
+
    <description value="my techtree" />
        <armor-type name="plate"/>
+
    <attack-types>
        <armor-type name="stone"/>
+
        <attack-type name="attack1" />
        <armor-type name="wood"/>ti
+
        <attack-type name="attack2" />
        <armor-type name="organic"/>
+
    </attack-types>
    </armor-types>
+
    <armor-types>
    <static-modifiers>    <font color="green">&lt;!--attack vs armor static modifiers (note to Daniel.santos: i noticed you deleted the static modifiers. I'm not sure you are aware that they actually work. I tried them and apparently they work for me. --&gt;</font>
+
        <armor-type name="armor1" />
        <static-modifier attack="arrow" armor="plate" value="-1"/>
+
        <armor-type name="armor2" />
    </static-modifiers>
+
    </armor-types>
    <damage-multipliers>   <font color="green">&lt;!--attack vs armor multipliers --&gt;</font>
+
    <damage-multipliers>
        <damage-multiplier attack="arrow" armor="plate" value="0.5"/>
+
        <damage-multiplier attack="attack1" armor="armor1" value="0.5" />
        <damage-multiplier attack="arrow" armor="leather" value="1.3"/>
+
        <damage-multiplier attack="attack1" armor="armor2" value="1.25" />
        <damage-multiplier attack="arrow" armor="stone" value="0.3"/>
+
    </damage-multipliers>
        <damage-multiplier attack="magic" armor="plate" value="0.8"/>
+
</tech-tree>
        <damage-multiplier attack="magic" armor="stone" value="0.5"/>
+
</syntaxhighlight>
        <damage-multiplier attack="sword" armor="stone" value="0.5"/>
+
 
    </damage-multipliers>
+
==Documentation==
</tech-tree>
+
===description===
 +
Unused, but meant to be a short name for the techtree. Unlikely to ever be used in the future.
 +
 
 +
===attack-types===
 +
A list of attack type names. These are the names you can give attack skills in the [[Unit XML]], and will be used to create damage multipliers.
 +
 
 +
===armor-types===
 +
A list of armor type names. These are the names you can give each unit's armor (each unit must have a type) and will be used to create damage multipliers.
 +
 
 +
===damage-multipliers===
 +
A list of multipliers for the different damage types. If the attack and armor type match, the damage will be multiplied by that amount. For example, if one attack type is "arrow", it might not be very effective against units who have the armor type "stone". Thus, we might give it a multiplier of 0.5, which halves our damage. However, if this arrow is very effective against leather armor, we might increase the damage it can do against leather by giving it a multiplier of 1.25, doing 25% (one quarter) more damage.
 +
 
 +
You can have as many damage multipliers, attack types, and armor types as you want. However, attack and armor types referenced in the damage multipliers tag, as well as in the unit XML must exist here.
 +
===loading-screen===
 +
MG does look for a loading screen which must be called <tt>loading_screen.*</tt> in the techtree folder.
 +
 
 +
==See Also==
 +
*[[XMLs]]
 +
*[[Techtrees]]
 +
[[Category:XMLs]]

Latest revision as of 02:55, 10 October 2019

(Back to XML Overview )

The techtree XML is placed in the root folder of a techtree, and stores all the attack and armor types, as well as the damage multipliers that result from them. The techtree XML is the same among all forks of Glest.


XML[edit]

<?xml version="1.0" standalone="no"?>
<tech-tree>
    <description value="my techtree" />
    <attack-types>
        <attack-type name="attack1" />
        <attack-type name="attack2" />	
    </attack-types>
    <armor-types>
        <armor-type name="armor1" />
        <armor-type name="armor2" />
    </armor-types>
    <damage-multipliers>
        <damage-multiplier attack="attack1" armor="armor1" value="0.5" />
        <damage-multiplier attack="attack1" armor="armor2" value="1.25" />
    </damage-multipliers>
</tech-tree>

Documentation[edit]

description[edit]

Unused, but meant to be a short name for the techtree. Unlikely to ever be used in the future.

attack-types[edit]

A list of attack type names. These are the names you can give attack skills in the Unit XML, and will be used to create damage multipliers.

armor-types[edit]

A list of armor type names. These are the names you can give each unit's armor (each unit must have a type) and will be used to create damage multipliers.

damage-multipliers[edit]

A list of multipliers for the different damage types. If the attack and armor type match, the damage will be multiplied by that amount. For example, if one attack type is "arrow", it might not be very effective against units who have the armor type "stone". Thus, we might give it a multiplier of 0.5, which halves our damage. However, if this arrow is very effective against leather armor, we might increase the damage it can do against leather by giving it a multiplier of 1.25, doing 25% (one quarter) more damage.

You can have as many damage multipliers, attack types, and armor types as you want. However, attack and armor types referenced in the damage multipliers tag, as well as in the unit XML must exist here.

loading-screen[edit]

MG does look for a loading screen which must be called loading_screen.* in the techtree folder.

See Also[edit]