Editing XML/Unit

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
([[XML|Back to XML Overview ]])
+
{{XMLs}}
 
 
 
The [[unit]] [[XML]] is the main body of a mod, defining everything about each unit. Every unit has this XML, which is named the same as their unit folder, and defines their stats and abilities, as well as various other bits of information on the unit.
 
The [[unit]] [[XML]] is the main body of a mod, defining everything about each unit. Every unit has this XML, which is named the same as their unit folder, and defines their stats and abilities, as well as various other bits of information on the unit.
  
 +
{{TOC limit|2}}
  
 
==XML==
 
==XML==
 +
{{XML_definition_header}}
 
<syntaxhighlight lang="xml">
 
<syntaxhighlight lang="xml">
 
<?xml version="1.0" standalone="no" ?>
 
<?xml version="1.0" standalone="no" ?>
Line 11: Line 12:
 
<size value="2" />
 
<size value="2" />
 
<height value="2" />
 
<height value="2" />
 +
<!-- Start MG Only -->
 
<target-height value="2" />
 
<target-height value="2" />
 
<burn-height value="2" />
 
<burn-height value="2" />
 +
<!-- End MG Only -->
 
<max-hp value="800" regeneration="2" />
 
<max-hp value="800" regeneration="2" />
 
<max-ep value="100" regeneration="5" />
 
<max-ep value="100" regeneration="5" />
Line 20: Line 23:
 
<time value="100" />
 
<time value="100" />
 
<multi-selection value="false" />
 
<multi-selection value="false" />
<uniform-selection value="false" />
 
 
<cellmap value="true" allowEmpty="false">
 
<cellmap value="true" allowEmpty="false">
 
<row value="10" />
 
<row value="10" />
Line 33: Line 35:
 
<properties>
 
<properties>
 
<property value="burnable" />
 
<property value="burnable" />
 +
<!-- Start MG Only -->
 
<property value="rotated_climb" />
 
<property value="rotated_climb" />
 +
<!-- End MG Only -->
 
</properties>
 
</properties>
 +
<!-- Start MG Only -->
 
<rotationAllowed value="false" />
 
<rotationAllowed value="false" />
 
<max-unit-count value="10" />
 
<max-unit-count value="10" />
Line 46: Line 51:
 
<count-kill-for-unit-upgrade value="true" />
 
<count-kill-for-unit-upgrade value="true" />
 
<count-in-victory-conditions value="true"/>
 
<count-in-victory-conditions value="true"/>
 +
<!-- End MG Only -->
 
<light enabled="true" red="0.1" green="0.1" blue="0.3" />
 
<light enabled="true" red="0.1" green="0.1" blue="0.3" />
 
<unit-requirements>
 
<unit-requirements>
Line 71: Line 77:
 
<tag value="tag_name"/>
 
<tag value="tag_name"/>
 
</tags>
 
</tags>
        <resources-death>
 
            <resource name="wood" amount-value="100" loss-value="100" allow-negative="true" />
 
            <resource name="gold" amount-faction-percent="10" loss-faction-percent="10" />
 
            <resource name="food" amount-value="1" />
 
        </resources-death>
 
 
</parameters>
 
</parameters>
 
<skills>
 
<skills>
Line 84: Line 85:
 
<commands>
 
<commands>
  
<!-- See section: [[XML/Commands|Commands]] -->
+
<!-- See section: commands -->
  
 
</commands>
 
</commands>
Line 126: Line 127:
  
 
===multi-selection===
 
===multi-selection===
If true this unit can be selected with other units. If false, a selection box ignores that type of unit if selected with other units. This should generally be off for buildings and on for regular units, unless there is any reason you don't want them to be easily mass selected.
+
If true, all units of the same type can be mass selected by double clicking one of them. As well, this must be on for the unit to be selectable by clicking and dragging a selection box (otherwise the selection box ignores that type of unit). This should generally be off for buildings and on for regular units, unless there is any reason you don't want them to be easily mass selected.
 
 
===uniform-selection===
 
If true this unit can only be in a selection with units of the same type. ( new in post 3.12 versions )
 
  
 
===cellmap===
 
===cellmap===
Line 140: Line 138:
  
 
===fields===
 
===fields===
Fields are the area that units can traverse. Currently this is limited to <tt>land</tt> and <tt>air</tt>. Land units can only walk on walkable parts of the land and shallow water, while air units can fly and traverse everywhere.
+
Fields are the area that units can traverse. In Glest and MegaGlest, this is limited to <tt>land</tt> and <tt>air</tt>. Land units can only walk on walkable parts of the land and shallow water, while air units can fly and traverse everywhere. In GAE, the additional fields of <tt>any_water</tt> (deep or shallow water), <tt>deep_water</tt> (only the deep areas that land units cannot enter), or <tt>amphibious</tt> (the unit can traverse both land and water (of any depth) but are still limited by unwalkable terrain).
  
 
===properties===
 
===properties===
Line 148: Line 146:
  
 
===rotationAllowed===
 
===rotationAllowed===
A [[MegaGlest]] only element which toggles whether or not the building can be rotated.
+
A [[MegaGlest]] only element which toggles whether or not the building can be rotated. In GAE, buildings can always be rotated. Unit particle effects will be rotated with the building.
  
 
===max-unit-count===
 
===max-unit-count===
Line 184: Line 182:
 
===resources-stored===
 
===resources-stored===
 
Using the same syntax as resource-requirements above, resources stored is the number of resources that can be stored in this unit. This expands the total maximum storage as shown at the top of the [[HUD]], and also performs the more valuable function of letting units head to it after harvesting that resource.
 
Using the same syntax as resource-requirements above, resources stored is the number of resources that can be stored in this unit. This expands the total maximum storage as shown at the top of the [[HUD]], and also performs the more valuable function of letting units head to it after harvesting that resource.
 
===resources-death ( looting ) ===
 
The resources gained by the player who killed the unit, and/ or the resources lost by the player who owned the unit when the unit is killed.
 
*<tt>amount-value</tt> is the absolute amount to give to the killing player.
 
*<tt>loss-value</tt>  is the absolute amount of resources that is removed from the player who owns the killed unit.
 
*<tt>amount-faction-percent</tt> is the percentage of the resources stored by the player who owns this unit (when the unit is killed), that is then given to the player who kills this unit.
 
*<tt>loss-faction-percent</tt> is the percentage of the resources stored by the player who owns this unit (when the unit is killed), that is then taken from the player who owns this unit.
 
All the variables listed above can have a negative value, which causes an inverse effect (i.e. resources are gained by the player who owns the unit/ resources are taken from the player who kills the unit).
 
*<tt>allow-negative</tt> defines whether the final resource count of the player losing resources can go below 0. If set to true, when this unit is killed, the resources-store of the player losing resources can go into negatives. If set to false, if the resources to be taken is greater than the resources the player has, then the player's resource count becomes 0.
 
  
 
===image===
 
===image===
Line 198: Line 187:
  
 
===image-cancel===
 
===image-cancel===
Path to the cancel icon that will be used by the image, which will be displayed at the bottom of the unit box on the HUD, for canceling their current action (upgrades specify their own cancel icon in the [[Upgrade XML]]). Images can be BMP, TGA, JPG, or PNG.
+
Path to the cancel icon that will be used by the image, which will be displayed at the bottom of the unit box on the HUD, for canceling their current action (upgrades specify their own cancel icon in the [[Upgrade XML]]). In Glest, images can be either BMP or TGA. In MegaGlest and GAE, they can be BMP, TGA, JPG, or PNG.
  
 
===meeting-point===
 
===meeting-point===
If true, a meeting point will be used, which is a selectable location that produced units will be sent to. Generally only given to buildings because otherwise the right click "hotkey" is used for move. The path is the icon that can be used to choose the meeting point location.
+
If true, a meeting point will be used, which is a selectable location that produced units will be sent to. Generally only given to buildings because otherwise the right click "hotkey" is used for move. The path is the icon that can be used to choose the meeting point location. In Glest, images can be either BMP or TGA. In MegaGlest and GAE, they can be BMP, TGA, JPG, or PNG.
  
 
===selection-sounds===
 
===selection-sounds===
Line 214: Line 203:
 
As a result, you could tag all melee units with a tag named "melee", and have an effect that boosts only the attack strength of melee units. Or you could tag a unit as a "building" to have an effect that only affects buildings.
 
As a result, you could tag all melee units with a tag named "melee", and have an effect that boosts only the attack strength of melee units. Or you could tag a unit as a "building" to have an effect that only affects buildings.
  
Tags are defined in a the parameter node of the unit xml. and are used by adding extra tag lines in skills.
+
Tags are defined in a the parameter node of the unit xml. and are used by adding exstra tag lines in skills.
  
 
===skills===
 
===skills===
Line 226: Line 215:
 
==See also==
 
==See also==
 
*[[XMLs]]
 
*[[XMLs]]
*[[XML/Commands|Commands]]
+
<!-- Place links to skills and commands here, once they are created -->
 
[[Category:XMLs]]
 
[[Category:XMLs]]

Please note that all contributions to MegaGlest are considered to be released under the Creative Commons Attribution Share Alike (see MegaGlest:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Template used on this page: