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" />
<target-height value="2" />
 
<burn-height value="2" />
 
 
<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 19:
 
<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 27: Line 25:
 
<levels>
 
<levels>
 
<level name="level_name" kills="3" />
 
<level name="level_name" kills="3" />
 +
<!-- Start GAE Only -->
 +
<level name="level_name" kills="7" default="false">
 +
<static-modifiers>
 +
<max-hp value="0" />
 +
<max-ep value="0" />
 +
<hp-regeneration value="0" />
 +
<ep-regeneration value="0" />
 +
<sight value="0" />
 +
<armor value="0" />
 +
<attack-strength value="0" />
 +
<effect-strength value="0" />
 +
<attack-percent-stolen value="0" />
 +
<attack-range value="0" />
 +
<move-speed value="0" />
 +
<attack-speed value="0" />
 +
<production-speed value="0" />
 +
<repair-speed value="0" />
 +
<harvest-speed value="0" />
 +
</static-modifiers>
 +
<multipliers>
 +
<max-hp value="1" />
 +
<max-ep value="1" />
 +
<hp-regeneration value="1" />
 +
<ep-regeneration value="1" />
 +
<sight value="1" />
 +
<armor value="1" />
 +
<attack-strength value="1" />
 +
<effect-strength value="1" />
 +
<attack-percent-stolen value="1" />
 +
<attack-range value="1" />
 +
<move-speed value="1" />
 +
<attack-speed value="1" />
 +
<production-speed value="1" />
 +
<repair-speed value="1" />
 +
<harvest-speed value="1" />
 +
</multipliers>
 +
</level>
 +
<!-- End GAE Only -->
 
</levels>
 
</levels>
 
<fields>
 
<fields>
Line 33: Line 69:
 
<properties>
 
<properties>
 
<property value="burnable" />
 
<property value="burnable" />
 +
<!-- Start GAE Only -->
 +
<property value="wall" />
 +
<property value="multi-build" />
 +
<property value="multi-select" />
 +
<!-- End GAE Only -->
 +
<!-- 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 90:
 
<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 68: Line 113:
 
<sound path="sound/command_sound.wav" />
 
<sound path="sound/command_sound.wav" />
 
</command-sounds>
 
</command-sounds>
 +
<!-- Start GAE Only -->
 
<tags>
 
<tags>
 
<tag value="tag_name"/>
 
<tag value="tag_name"/>
 
</tags>
 
</tags>
        <resources-death>
+
<emanations>
            <resource name="wood" amount-value="100" loss-value="100" allow-negative="true" />
+
 
            <resource name="gold" amount-faction-percent="10" loss-faction-percent="10" />
+
<!-- See section: emanations -->
            <resource name="food" amount-value="1" />
+
 
        </resources-death>
+
</emanations>
 +
<subfaction-restrictions>
 +
<subfaction name="subfaction_name" />
 +
</subfaction-restrictions>
 +
<!-- End GAE Only -->
 
</parameters>
 
</parameters>
 
<skills>
 
<skills>
Line 84: Line 134:
 
<commands>
 
<commands>
  
<!-- See section: [[XML/Commands|Commands]] -->
+
<!-- See section: commands -->
  
 
</commands>
 
</commands>
Line 96: Line 146:
 
===height===
 
===height===
 
The height of the unit is used for check for collision of projectile attacks, as well as for determining the placement of particles such as flames. Most standard humanoids are 2-3 units tall.
 
The height of the unit is used for check for collision of projectile attacks, as well as for determining the placement of particles such as flames. Most standard humanoids are 2-3 units tall.
 
===target-height===
 
A height which is used to calculate the target height for projectiles shot by attacking units. Per default this value is the same as the height.
 
 
===burn-height===
 
A height which is used to calculate the the position of the fire particle system if the unit is burnable. Per default this value is the same as the height.
 
  
 
===max-hp===
 
===max-hp===
Line 126: Line 170:
  
 
===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 137: Line 178:
  
 
===levels===
 
===levels===
Levels are increases in stats and a name change that occur after the unit reaches a certain number of kills. For [[MegaGlest]], only the name and level can be changed. When the unit reaches that number of kills, the name is prefixed to the unit and they are given a +50% max HP, +50% max EP, +50% armor, and +20% sight boost, which stacks with each level.
+
Levels are increases in stats and a name change that occur after the unit reaches a certain number of kills. For [[Glest]] and [[MegaGlest]], only the name and level can be changed. When the unit reaches that number of kills, the name is prefixed to the unit and they are given a +50% max HP, +50% max EP, +50% armor, and +20% sight boost, which stacks with each level.
 +
 
 +
In [[GAE]], [[GAE/Custom_levels|customizing the levels]] can be done by specifying specific boosts as either static modifiers or multipliers. A static modifier increases stats by an absolute amount, and a multiplier multipliers the stats by a number. GAE also has a <tt>defaults</tt> attribute which, if false, will prevent the default boost from stacking with the specified custom boost.
 +
 
 +
====Table of Level Attributes (GAE Only)====
 +
{| class="wikitable"
 +
!Value
 +
!Description
 +
|-
 +
|&lt;max-hp&gt;
 +
|Modifies the maximum HP.
 +
|-
 +
|&lt;hp-regen&gt;
 +
|Modifies the HP regeneration rate.
 +
|-
 +
|&lt;max-ep&gt;
 +
|Modifies the maximum EP.
 +
|-
 +
|&lt;ep-regen&gt;
 +
|Modifies the EP regeneration rate.
 +
|-
 +
|&lt;sight&gt;
 +
|Modifies the unit's sight.
 +
|-
 +
|&lt;armor&gt;
 +
|Modifies the unit's armor strength.
 +
|-
 +
|&lt;attack-strength&gt;
 +
|Modifies the unit's attack strength.
 +
|-
 +
|&lt;attack-range&gt;
 +
|Modifies the unit's attack ragen.
 +
|-
 +
|&lt;attack-speed&gt;
 +
|Modifies the unit's attack speed.
 +
|-
 +
|&lt;move-speed&gt;
 +
|Modifies the speed the unit moves at.
 +
|-
 +
|&lt;production-speed&gt;
 +
|Modifies the production speed (speed of creating units or morphing).
 +
|-
 +
|&lt;repair-speed&gt;
 +
|Modifies the speed of the repair skill.
 +
|-
 +
|&lt;harvest-speed&gt;
 +
|Modifies the speed of the harvest skill.
 +
|-
 +
|&lt;effect-strength&gt;
 +
|Modifies the strength of effects.
 +
|}
  
 
===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===
 
Properties are additional flags which take no parameters, but can define the unit.
 
Properties are additional flags which take no parameters, but can define the unit.
 
*<tt>burnable</tt> - When the unit drops to under 50% HP (only after being attacked for the first time, to prevent the occurance when building), a flame particle effect starts and persists until the unit's HP is back above 50%.
 
*<tt>burnable</tt> - When the unit drops to under 50% HP (only after being attacked for the first time, to prevent the occurance when building), a flame particle effect starts and persists until the unit's HP is back above 50%.
 +
*<tt>wall</tt> - GAE Only, will eventually tell the [[AI]] to treat the building like a wall, but currently such a function does not exist, so it just tells the AI not to construct the building.
 +
*<tt>multi-build</tt> - GAE Only, tells the engine you can build multiple of this building at once by dragging and dropping the mouse after selecting a build location. Used mainly for walls.
 +
*<tt>multi-select</tt> - GAE Only, an alternative way of telling the engine that this unit can have multi-selected (see multi-selection above).
 
*<tt>rotated-climb</tt> - MG Only, this will make units rotate when moving on sloped surfaces so that they are parallel to the surface. Meant for units such as tanks, which look unnatural if they do not slope with the ground. Units such as humanoids would generally not use this, as they would stand upright even on slopes.
 
*<tt>rotated-climb</tt> - MG Only, this will make units rotate when moving on sloped surfaces so that they are parallel to the surface. Meant for units such as tanks, which look unnatural if they do not slope with the ground. Units such as humanoids would generally not use this, as they would stand upright even on slopes.
  
 
===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 278:
 
===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===
Path to the unit's icon, which will be displayed on the HUD. In MegaGlest they can be BMP, TGA, JPG, or PNG.
+
Path to the unit's icon, which will be displayed on the HUD. In Glest, images can be either BMP or TGA. In MegaGlest and GAE, they can be BMP, TGA, JPG, or PNG.
  
 
===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 210: Line 295:
  
 
===tags===
 
===tags===
Tags are a implementation which allows units to be assigned to a "group". You could then use those to perform affects only to units with that specific tag. For example, it's possible to have an [[XML/Upgrades|upgrade]] affect only units with that specific tag.
+
Tags are a GAE only implementation which allows units to be assigned to a "group". You could then use those to perform affects only to units with that specific tag. For example, it's possible to have an [[GAE/Upgrades|upgrade]] affect only units with that specific tag. As well, [[GAE/Effects|effects]] and [[GAE/Emanations|emanations]] can be set to apply only to specific tagged units.
  
 
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.
+
===emanations===
 +
{{See|GAE/Emanations}}
 +
Emanations are special effects that "emit" from the unit, such as a healing aura which may heal nearby allied units, or an intimidation emanation, which might reduce the stats of nearby enemies.
 +
 
 +
===subfaction-restrictions===
 +
{{See|GAE/Subfactions}}
 +
Limits the unit to the listed [[GAE/Subfactions|subfactions]], which must have been declared in the [[Faction XML]], with the exception of <tt>base</tt>, which refers to the faction when there is no subfactions.
  
 
===skills===
 
===skills===
Line 226: Line 317:
 
==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: