Editing XML/Resource

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}}
 
 
 
Game resources are specified under the <tt>resources</tt> 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 <tt>.xml</tt>.
 
Game resources are specified under the <tt>resources</tt> 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 <tt>.xml</tt>.
  
 
Note that there are 4 types of resources and that only one of the below can be specified for a single resource.
 
Note that there are 4 types of resources and that only one of the below can be specified for a single resource.
 +
 +
{{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 12: Line 13:
 
<image path="images/image.bmp"/>
 
<image path="images/image.bmp"/>
 
<type value="static">
 
<type value="static">
 +
<!-- Start GAE+MG Only -->
 
<recoup-cost value="true" />
 
<recoup-cost value="true" />
 +
<!-- End GAE+MG Only -->
 
</type>
 
</type>
 
<type value="consumable">
 
<type value="consumable">
 
<interval value="30"/>
 
<interval value="30"/>
 +
<!-- Start GAE Only -->
 +
<damage absolute="x" percent="y" />
 +
<!-- End GAE Only -->
 
</type>
 
</type>
 
<type value="tech">
 
<type value="tech">
 
<model path="models/gold.g3d">
 
<model path="models/gold.g3d">
 +
<!-- Start MG Only -->
 
<particles value="true">
 
<particles value="true">
 
<particle-file path="models/tree_particles.xml"/>
 
<particle-file path="models/tree_particles.xml"/>
 
</particles>
 
</particles>
 +
<!-- End MG Only -->
 
</model>
 
</model>
 
<default-amount value="1500"/>
 
<default-amount value="1500"/>
Line 30: Line 38:
 
<tileset-object value="1"/>
 
<tileset-object value="1"/>
 
</type>
 
</type>
 +
<!-- Start GAE+MG Only -->
 
<display value="true"/>
 
<display value="true"/>
 +
<!-- End GAE+MG Only -->
 +
<!-- Start GAE Only -->
 +
<infinite-store value="false" />
 +
<!-- End GAE Only -->
 
</resource>
 
</resource>
 
</syntaxhighlight>
 
</syntaxhighlight>
Line 42: Line 55:
  
 
====static====
 
====static====
If static is chosen, there are no needed attributes. Static resources aren't actually consumed, and if a unit requiring them dies, they can be reused. There is an optional recoup-cost tag which controls whether or not you get the resource back when the unit that used it dies. Defaulting to true, you'd get the static resources back after the death of a unit using said resource, but if false, you will not (it will be lost in the same way as a tech or tileset resource).
+
If static is chosen, there are no needed attributes. Static resources aren't actually consumed, and if a unit requiring them dies, they can be reused. In MegaGlest and GAE, there is an optional recoup-cost tag which controls whether or not you get the resource back when the unit that used it dies. Defaulting to true, you'd get the static resources back after the death of a unit using said resource, but if false, you will not (it will be lost in the same way as a tech or tileset resource).
  
 
====consumable====
 
====consumable====
 
Consumables only have a single attribute, the interval, which is how often (in seconds) that the resources from producers (such as [[Tech]]'s cow) place their resource in the store and how often consumers (like Tech's swordman) consume those resources. If there isn't enough, the unit will lose one third of it's HP every interval. The number in parenthesis is the surplus if positive, and the shortage if negative.
 
Consumables only have a single attribute, the interval, which is how often (in seconds) that the resources from producers (such as [[Tech]]'s cow) place their resource in the store and how often consumers (like Tech's swordman) consume those resources. If there isn't enough, the unit will lose one third of it's HP every interval. The number in parenthesis is the surplus if positive, and the shortage if negative.
  
 +
GAE mods can optionally specify the amount of damage dealt by insufficient resources (versus the default one third of their health). This can be done as either an absolute number (eg, 200 would reduce the unit's health by 200 each interval unit, which would allow stronger units to survive longer) or a percentage (eg, 0.2 would reduce the unit's health by 20% each interval).
  
 
====tech====
 
====tech====
Line 55: Line 69:
  
 
===display===
 
===display===
A feature that toggles whether or not the resource appears in the HUD. Generally, you'd want most resources to be there, but it can be useful to have a hidden resource, such as one that may be used to limit you to a single "hero" unit, etc.
+
A GAE and MegaGlest only feature that toggles whether or not the resource appears in the HUD. Generally, you'd want most resources to be there, but it can be useful to have a hidden resource, such as one that may be used to limit you to a single "hero" unit, etc.
  
 +
===infinite-store===
 +
If this GAE only value is set to true, the upper storage limit of the resource will be removed (ie, instead of having a maximum of a tech or tileset resource defined by the building's storage, the maximum will be removed). False behaves as normal, and the tag can be omitted.
  
 
==See also==
 
==See also==
 
*[[XML Definitions]]
 
*[[XML Definitions]]
 
[[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)