GAE/Common XML

From MegaGlest
Revision as of 05:59, 24 March 2011 by Hofmic (talk) (Added internal links, all headers moved one down (please do not use level 1 headers inside the content area))
Jump to: navigation, search

This page goes over recurring elements in XMLs in the Glest Advanced Engine.

Displayable Type XML Elements

The displayable type is a super class to all game entities that can be displayed in the GUI. Units, Upgrades, Resources & Commands are all displayable.

image

All displayable types must provide an image, used as icon for this type in various parts of the GUI.

<image path="images/my_image.png" />

name

All displayable types have a name, although not all need to provide it in the XML, in general if the 'type' has an XML file from which it is loaded, the name will be set to the name of the directory (which will be the same as the basename of the xml file), types that are embedded in the XML of other types must provide a name in XML. ie. Units and Upgrades are loaded from specific directories, and aquire their names from the directory, Commands are embedded in Unit XML, and so they must provide a name node.

<name value="my_named_thing"/>

Requirable Type XML Elements

Requirable types are those game entities that a faction may not use until certain Unit & Upgrade requirements are met, or are restricted to (a) certain sub-faction(s). All requirable types are also displayable types.

upgrade-requirements

Contains a list of units that must be researched before this entity can be produced / used. If these upgrades are not already researched the command (or command that produces this) will be 'greyed out' in the display.

<upgrade-requirements>
   <upgrade name="my_upgrade">
   <!-- ... -->
</upgrade-requirements>

unit-requirements

Contains a list of units that must be present before this entity can be produced / used. Commands that do not have the requisite units will be greyed out.

<unit-requirements>
   <unit name="my_unit">
   <!-- ... -->
</unit-requirements>

subfaction-restrictions

Containes a list of sub-factions that this entity is restricted to. If the player's current sub-faction is not in this list, then this entity will not be available, and the command (or the command that produces this) will not be displayed.

<subfaction-restrictions>
   <subfaction name="my_subfaction">
   <!-- ... -->
</subfaction-restrictions>

Producible Type XML Elements

Producible types are those entities that are produced by other units, generally at the cost of certain resources and taking a certain amount of time to produce. Producible types are requirable (and hence also Displayable).

time

The time parameter controls how long the producible takes to be produced (except for units which are 'built') and is the number of skill cycles of the produce / generate / upgrade command used to create the entity. [see produce command for more information].

<time value="100" />

image-cancel

This image is displayed on the display panel for the cancel production icon.

<image-cancel path="images/cancel.png" />

resource-requirements

Resources required to produce an entity of this type, positive values indicate a cost, and all costs must be met before production commences, negeative values indicate resource this entity produces (only applied once production is complete).

<resource-requirements>
   <resource name="gold" value="250">
   <!-- ... -->
</resource-requirements>

advances-to-subfaction

If producing an entity of this type should cause advancement to a sub-faction. If 'is-immediate' is true the advancement will happen immediately upon production commencing, else it will occur after production is complete.

<advances-to-subfaction name="my_subfaction" is-immediate="false" />

See Also