The Glest Wiki
(Will double tagging work?)
No edit summary
 
(14 intermediate revisions by 3 users not shown)
Line 1: Line 1:
  +
{{XMLs}}
 
The [[faction]] [[XML]] is the base definition for each faction in a tech tree mod and defines the starting [[units]], starting resources and music. The actual name of the file will be the faction's name (which must match the [[folder]]).
 
The [[faction]] [[XML]] is the base definition for each faction in a tech tree mod and defines the starting [[units]], starting resources and music. The actual name of the file will be the faction's name (which must match the [[folder]]).
   
Line 4: Line 5:
   
 
==XML==
 
==XML==
  +
{{XML_definition_header}}
 
<syntaxhighlight lang="xml">
 
<syntaxhighlight lang="xml">
 
<?xml version="1.0" standalone="no"?>
 
<?xml version="1.0" standalone="no"?>
 
<faction>
 
<faction>
<starting-resources>
+
<starting-resources>
<resource name="resource_name" amount="#"/>
+
<resource name="resource_name" amount="100" />
</starting-resources>
+
</starting-resources>
<starting-units>
+
<starting-units>
<unit name="unit_name" amount="#"/>
+
<unit name="unit_name" amount="1" />
</starting-units>
+
</starting-units>
<music value="true" path="music_tech.ogg"/>
+
<music value="true" path="music_tech.ogg" />
<!-- Start GAE Only -->
+
<!-- Start GAE Only -->
<logo value="true">
+
<logo value="true">
<team-colour path="logo_team.png" />
+
<team-colour path="logo_team.png" />
<rgba-colour path="logo_rgba.png" />
+
<rgba-colour path="logo_rgba.png" />
</logo>
+
</logo>
<attack-notice enabled="true" min-delay="15">
+
<attack-notice enabled="true" min-delay="15">
<sound-file path="sound/attacked.ogg" />
+
<sound-file path="sound/attacked.ogg" />
</attack-notice>
+
</attack-notice>
  +
<subfactions>
<!-- End GAE Only -->
 
  +
<subfaction name="subfaction_name"/>
  +
</subfactions>
  +
<loading-screen>
  +
<background-image path="loading_screen.png" />
  +
</loading-screen>
 
<!-- End GAE Only -->
  +
<!-- Start MG Only -->
  +
<link>
  +
<techtree name="techtree_name" />
  +
</link>
  +
<ai-behavior>
  +
<worker-units>
  +
<unit name="unit_name" minimum="1" />
  +
</worker-units>
  +
<warrior-units>
  +
<unit name="unit_name" minimum="1" />
  +
</warrior-units>
  +
<resource-producer-units>
  +
<unit name="unit_name" minimum="1" />
  +
</resource-producer-units>
  +
<building-units>
  +
<unit name="unit_name" minimum="1" />
  +
</building-units>
  +
<upgrades>
  +
<upgrade name="upgrade_name" />
  +
</upgrades>
  +
</ai-behavior>
  +
<!-- End MG Only -->
 
</faction>
 
</faction>
 
</syntaxhighlight>
 
</syntaxhighlight>
Line 37: Line 67:
   
 
<syntaxhighlight lang="xml">
 
<syntaxhighlight lang="xml">
<!-- Start GAE Only -->
+
<!-- Start GAE Only -->
<music value="true" play-list="true" shuffle="true">
+
<music value="true" play-list="true" shuffle="true">
<music-file path="music/track1.ogg" />
+
<music-file path="music/track1.ogg" />
<music-file path="music/track2.ogg" />
+
<music-file path="music/track2.ogg" />
</music>
+
</music>
<!-- End GAE Only -->
+
<!-- End GAE Only -->
 
</syntaxhighlight>
 
</syntaxhighlight>
   
Line 51: Line 81:
 
===attack-notice===
 
===attack-notice===
 
If enabled, a sound file will be played whenever your units are attacked offscreen. This will not trigger if you are attacked inside your viewing area, and will not sound more often than the min-delay, in seconds. Multiple sound files can be linked to by using multiple sound-file tags.
 
If enabled, a sound file will be played whenever your units are attacked offscreen. This will not trigger if you are attacked inside your viewing area, and will not sound more often than the min-delay, in seconds. Multiple sound files can be linked to by using multiple sound-file tags.
  +
  +
MegaGlest has an attack notice feature, but does not yet have an option to configure the sound file used for it.
  +
  +
===subfactions===
  +
{{See|GAE/Subfactions}}
  +
If not a closed tag, a list of subfactions available must be registered here.
  +
  +
===loading-screen===
  +
GAE specific tag that let you specify a loading screen image to use. As of 0.4, it only allows a single image, but will later allow multiple images to be used for loading screens (chosen at random). If a scenario loading screen is also specified, it will take priority over this one.
  +
  +
MG does not need this tag, as it always looks for a loading screen which must be called <tt>loading_screen.*</tt> in the faction folder.
  +
  +
===link===
  +
This feature is available in the latest SVN. A MegaGlest only command which makes the faction a reference to another, existing faction, in a different techtree. The only attribute is the [[techtree]] the faction should be found in. The faction loaded will be the same name as this faction's XML name (so if creating a link to the [[Indian]] faction in the [[MegaPack]], the faction XML would be called <tt>indian.xml</tt>, with the same folder structure as any other faction. When the link element is used, all other elements except the top level faction element and XML declaration should be removed.
  +
  +
===ai-behavior===
  +
{{Main|MG/AI control}}
  +
MegaGlest only, this tag will be present in the <tt>&lt;faction&gt;</tt> tag of the faction XML, and will contain all the other elements to define the AI's behavior.
  +
  +
===worker-units===
  +
MegaGlest only, units specified here are treated as workers and make up the bulk of production and expansion. A minimum number is specified to tell the AI how many of this unit it should try and maintain at all times.
  +
  +
===warrior-units===
  +
MegaGlest only, units specified here are treated as warriors, meaning they will be used as the primary attack force. A minimum number is specified to tell the AI how many of this unit it should try and maintain at all times.
  +
  +
===resource-producer-units===
  +
MegaGlest only, units here are considered to be necessary for producing different resources, such as food. A minimum number is specified to tell the AI how many of this unit it should try and maintain at all times.
  +
  +
===building-units===
  +
MegaGlest only, units here are considered to be other important buildings that the AI should attempt to build early. A minimum number is specified to tell the AI how many of this unit it should try and maintain at all times.
  +
  +
===upgrades===
  +
MegaGlest only, upgrades here are considered to be important upgrades that are priority for the AI to develop.
   
 
==See also==
 
==See also==
 
*[[XMLs]]
 
*[[XMLs]]
  +
[[Category:XMLs]]
 
[[Category:XMLs]]
 
[[Category:XMLs]]

Latest revision as of 16:29, 25 January 2012

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]

v  d  e


The faction XML is the base definition for each faction in a tech tree mod and defines the starting units, starting resources and music. The actual name of the file will be the faction's name (which must match the folder).

XML[]

GAE Only
GAE and MegaGlest Only
<?xml version="1.0" standalone="no"?>
<faction>
	<starting-resources>
		<resource name="resource_name" amount="100" />
	</starting-resources>
	<starting-units>
		<unit name="unit_name" amount="1" />
	</starting-units> 
	<music value="true" path="music_tech.ogg" />
	<!-- Start GAE Only -->
	<logo value="true">
		<team-colour path="logo_team.png" />
		<rgba-colour path="logo_rgba.png" />
	</logo>
	<attack-notice enabled="true" min-delay="15">
		<sound-file path="sound/attacked.ogg" />
	</attack-notice>
	<subfactions>
		<subfaction name="subfaction_name"/>
	</subfactions>
	<loading-screen>
		<background-image path="loading_screen.png" />
	</loading-screen>
	<!-- End GAE Only -->
	<!-- Start MG Only -->
	<link>
		<techtree name="techtree_name" />
	</link>
	<ai-behavior>
		<worker-units>
			<unit name="unit_name" minimum="1" />
		</worker-units>
		<warrior-units>
			<unit name="unit_name" minimum="1" />
		</warrior-units>
		<resource-producer-units>
			<unit name="unit_name" minimum="1" />
		</resource-producer-units>
		<building-units>
			<unit name="unit_name" minimum="1" />
		</building-units>
		<upgrades>
			<upgrade name="upgrade_name" />
		</upgrades>
	</ai-behavior>
	<!-- End MG Only -->
</faction>

Documentation[]

resource[]

Starting resources the faction start with. Name is the name of the resource, and amount is how much to begin with.

unit[]

Starting units. The name is the exact name of the unit, and the amount is how many to start with.

music[]

If true, the specified music will be played in a loop while using the specified faction. In GAE Only, you can specify multiple music tracks and can choose whether to shuffle them (play randomly) or in order. In order to use multiple tracks, play-list must be true, such as in the below example:

<!-- Start GAE Only -->
<music value="true" play-list="true" shuffle="true">
	<music-file path="music/track1.ogg" />
	<music-file path="music/track2.ogg" />
</music>
<!-- End GAE Only -->

[]

Main article: GAE/Faction logos

If enabled, a faction logo will be placed in the unit info box when no units or resources are selected. This image is made of two parts, a team color part which uses greyscale to define how dark or how light team color is, and a true color image that will be rendered on top of the team color image. GAE only.

attack-notice[]

If enabled, a sound file will be played whenever your units are attacked offscreen. This will not trigger if you are attacked inside your viewing area, and will not sound more often than the min-delay, in seconds. Multiple sound files can be linked to by using multiple sound-file tags.

MegaGlest has an attack notice feature, but does not yet have an option to configure the sound file used for it.

subfactions[]

If not a closed tag, a list of subfactions available must be registered here.

loading-screen[]

GAE specific tag that let you specify a loading screen image to use. As of 0.4, it only allows a single image, but will later allow multiple images to be used for loading screens (chosen at random). If a scenario loading screen is also specified, it 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.* in the faction folder.

link[]

This feature is available in the latest SVN. A MegaGlest only command which makes the faction a reference to another, existing faction, in a different techtree. The only attribute is the techtree the faction should be found in. The faction loaded will be the same name as this faction's XML name (so if creating a link to the Indian faction in the MegaPack, the faction XML would be called indian.xml, with the same folder structure as any other faction. When the link element is used, all other elements except the top level faction element and XML declaration should be removed.

ai-behavior[]

Main article: MG/AI control

MegaGlest only, this tag will be present in the <faction> tag of the faction XML, and will contain all the other elements to define the AI's behavior.

worker-units[]

MegaGlest only, units specified here are treated as workers and make up the bulk of production and expansion. A minimum number is specified to tell the AI how many of this unit it should try and maintain at all times.

warrior-units[]

MegaGlest only, units specified here are treated as warriors, meaning they will be used as the primary attack force. A minimum number is specified to tell the AI how many of this unit it should try and maintain at all times.

resource-producer-units[]

MegaGlest only, units here are considered to be necessary for producing different resources, such as food. A minimum number is specified to tell the AI how many of this unit it should try and maintain at all times.

building-units[]

MegaGlest only, units here are considered to be other important buildings that the AI should attempt to build early. A minimum number is specified to tell the AI how many of this unit it should try and maintain at all times.

upgrades[]

MegaGlest only, upgrades here are considered to be important upgrades that are priority for the AI to develop.

See also[]