XML/Faction

From MegaGlest
(Redirected from Faction)
Jump to: navigation, search

(Back to XML Overview )

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[edit]

<?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" />
	<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>
    <flat-particle-positions value="true"/>
</faction>

Documentation[edit]

resource[edit]

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

unit[edit]

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

music[edit]

If true, the specified music will be played in a loop while using the specified faction.

loading-screen[edit]

MegaGlest looks for a loading screen which must be called loading_screen.* in the faction folder.

link[edit]

A 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[edit]

Main article: MG/AI control

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[edit]

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[edit]

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[edit]

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[edit]

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[edit]

Upgrades here are considered to be important upgrades that are priority for the AI to develop.

flat-particle-positions[edit]

If this is set to true the positions that are given for the particle systems are based on the ground. This means the positioning is no more unit height dependend which makes changes much more easy. This field is not mandatory and the default is set to false.

See also[edit]