Difference between revisions of "XML/Techtree"

From MegaGlest
Jump to navigation Jump to search
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
<?xml version="1.0" standalone="no"?>
+
{{XMLs}}
+
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.
<tech-tree>
+
 
    <description value="experimental tech tree"/>
+
{{TOC limit|2}}
    <attack-types>          <font color="green">&lt;!--naming types of attacks --&gt;</font>
+
 
        <attack-type name="sword"/>
+
==XML==
        <attack-type name="arrow"/>
+
{{XML_definition_header}}
        <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"/>
+
        <attack-type name="attack2"/>
        <armor-type name="organic"/>
+
    </attack-types>
    </armor-types>
+
    <armor-types>
    <damage-multipliers>    <font color="green">&lt;!--attack vs armor multipliers --&gt;</font>
+
        <armor-type name="armor1"/>
        <damage-multiplier attack="arrow" armor="plate" value="0.5"/>
+
        <armor-type name="armor2"/>
        <damage-multiplier attack="arrow" armor="leather" value="1.3"/>
+
    </armor-types>
        <damage-multiplier attack="arrow" armor="stone" value="0.3"/>
+
    <damage-multipliers>
        <damage-multiplier attack="magic" armor="plate" value="0.8"/>
+
        <damage-multiplier attack="attack1" armor="armor1" value="0.5"/>
        <damage-multiplier attack="magic" armor="stone" value="0.5"/>
+
        <damage-multiplier attack="attack1" armor="armor2" value="1.25"/>
        <damage-multiplier attack="sword" armor="stone" value="0.5"/>
+
    </damage-multipliers>
    </damage-multipliers>
+
<!-- Start GAE Only -->
</tech-tree>
+
<loading-screen>
 +
<background-image path="loading_screen.png" />
 +
</loading-screen>
 +
<!-- End GAE Only -->
 +
</tech-tree>
 +
</syntaxhighlight>
 +
 
 +
==Documentation==
 +
===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. A more complex techtree might have as many as 10 different attack and armor types, with multipliers for each one, such as that of the [[Military/Attack_Types|Military mod]].
 +
 
 +
===loading-screen===
 +
A GAE only option which specifies a path to a loading screen. As of 0.4, it can only support a single image, but will later support shuffling through random images. If a [[XML/Faction|faction]] or [[scenario]] loading screen image is chosen, they will take priority over this one.
 +
 
 +
MG does not need this tag, as it always looks for a loading screen which must be called "loading_screen.*".
 +
 
 +
==See Also==
 +
*[[XMLs]]
 +
*[[Techtrees]]
 +
[[Category:XMLs]]

Revision as of 13:10, 2 July 2011

Engines icons.png This article documents Glest, GAE, and MegaGlest

This is noted in the colored backgrounds, which denote lines as being engine specific. See the key below.[Editing help]

Template:Clear

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.

Template:TOC limit

XML

Template:XML definition header

<?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>
	<!-- Start GAE Only -->
	<loading-screen>
		<background-image path="loading_screen.png" />
	</loading-screen>
	<!-- End GAE Only -->
</tech-tree>

Documentation

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. A more complex techtree might have as many as 10 different attack and armor types, with multipliers for each one, such as that of the Military mod.

loading-screen

A GAE only option which specifies a path to a loading screen. As of 0.4, it can only support a single image, but will later support shuffling through random images. If a faction or scenario loading screen image is chosen, they will take priority over this one.

MG does not need this tag, as it always looks for a loading screen which must be called "loading_screen.*".

See Also