Editing XML/Scenario

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}}
 +
[[Scenarios]] are special types of battles where the creator can modify the game from its regular style, and even add [[Lua]] scripting.
 +
 
 +
{{TOC limit|2}}
  
[[Scenarios]] are special types of battles where the creator can modify the game from its regular style, and even add [[Lua]] scripting.
+
==Folders==
 +
The scenario XMLs differ slightly based on the engine used. In [[Glest]] and [[MegaGlest]], the scenario XML is located in <tt>scenarios/'''[scenario]'''</tt> (where <tt>[scenario]</tt> is the name of your scenario). In GAE, it is placed in <tt>gae/scenarios/'''[category]'''/'''[scenario]'''</tt> (where <tt>[category]</tt> is a folder of any name to categorize scenarios and <tt>[scenario]</tt> is the name of the scenario). In both engines, the scenario folder must have the same name as the XML.
  
 
==XML==
 
==XML==
 +
{{XML_definition_header}}
 
<syntaxhighlight lang="xml">
 
<syntaxhighlight lang="xml">
 
<?xml version="1.0" standalone="yes" ?>
 
<?xml version="1.0" standalone="yes" ?>
Line 10: Line 15:
 
<players>
 
<players>
 
<player control="human" faction="faction_name" team="1"/>
 
<player control="human" faction="faction_name" team="1"/>
 +
<!-- Start MG Only -->
 
<player control="network" faction="faction_name" team="2"/>
 
<player control="network" faction="faction_name" team="2"/>
 
<player control="cpu" faction="faction_name" resource_multiplier="1.0" team="2"/>
 
<player control="cpu" faction="faction_name" resource_multiplier="1.0" team="2"/>
 +
<!-- End MG Only -->
 
</players>
 
</players>
 
<map value="map_name"/>
 
<map value="map_name"/>
 
<tileset value="tileset_name"/>
 
<tileset value="tileset_name"/>
 
<tech-tree value="techtree_name"/>
 
<tech-tree value="techtree_name"/>
 +
<!-- Start GAE+MG Only -->
 
<fog-of-war value="true"/>
 
<fog-of-war value="true"/>
 +
<!-- End GAE+MG Only -->
 
<default-resources value="true"/>
 
<default-resources value="true"/>
 
<default-units value="true"/>
 
<default-units value="true"/>
 
<default-victory-conditions value="true"/>
 
<default-victory-conditions value="true"/>
<scripts>
+
<!-- Start GAE Only -->
 +
<loading-screen>
 +
<background-image path="loading-screen.png" />
 +
</loading-screen>
 +
<!-- End GAE Only -->
 +
<scripts><!-- Start MG Only -->
 
<global>
 
<global>
 
 
Line 62: Line 76:
 
 
 
</unitDied>
 
</unitDied>
 +
<!-- Start GAE Only -->
 +
<timer name="name">
 +
 +
<!-- Lua Code -->
 +
 +
</timer>
 +
<!-- End GAE Only -->
 
</scripts>
 
</scripts>
 
</scenario>
 
</scenario>
Line 77: Line 98:
  
 
===players===
 
===players===
This is a list of the players in this game, where each player gets their own <tt>&lt;player /&gt;</tt> tag. Attributes are control, which is either <tt>human</tt>, <tt>cpu</tt>, or <tt>cpu-ultra</tt> <tt>cpu-easy</tt> and <tt>cpu-mega</tt>. If it is <tt>closed</tt> the slot is closed and not used no matter which other settings follow. [[MegaGlest]] also adds the option of a <tt>network</tt> player. This asserts who controls that player, and one must be human and one must be some brand of cpu.
+
This is a list of the players in this game, where each player gets their own <tt>&lt;player /&gt;</tt> tag. Attributes are control, which is either <tt>human</tt>, <tt>cpu</tt>, or <tt>cpu-ultra</tt>, though [[GAE]] and [[MegaGlest]] add <tt>cpu-easy</tt> and <tt>cpu-mega</tt> as well. [[MegaGlest]] also adds the option of a <tt>network</tt> player. This asserts who controls that player, and one must be human and one must be some brand of cpu.
In [[MegaGlest]] you can also edit the <tt>resource_multiplier</tt> for the cpu.
+
In [[MegaGlest]] you can also edit the resource multiplier for the cpu.
  
 
The faction is the name of the faction (must all be in the same techtree), and the team is the team number for the purpose of placing players on the same or different teams (players with the same number are allies, while different numbers are enemies).
 
The faction is the name of the faction (must all be in the same techtree), and the team is the team number for the purpose of placing players on the same or different teams (players with the same number are allies, while different numbers are enemies).
  
 
===map===
 
===map===
The name of the map to use. It should exist in the player's maps folder or you can also have the map inside the scenario's folder itself, to allow the map to be used for the scenario only, without appearing in the regular game menu.
+
The name of the map to use. It should exist in the player's maps folder. GAE can also have the map inside the scenario's folder itself, to allow the map to be used for the scenario only, without appearing in the regular game menu.
  
 
===tileset===
 
===tileset===
Line 103: Line 124:
 
If true, the game is won or lost by defeating all the opponents (or more specifically, all the opponent's units which have a be-built [[skill]]). If false, the game only ends when the Lua script tells it to. Generally on for non-scripted scenarios.
 
If true, the game is won or lost by defeating all the opponents (or more specifically, all the opponent's units which have a be-built [[skill]]). If false, the game only ends when the Lua script tells it to. Generally on for non-scripted scenarios.
  
 +
===loading-screen===
 +
A GAE only function to allow an image to be used as the loading screen background. If not loading screen image is used, exclude the tag completely. Currently in GAE 0.4, only the first specified image will work, but in the future, it may be possible to use multiple images, with one chosen on random.
  
 
===scripts===
 
===scripts===
Line 135: Line 158:
 
|&lt;unitDied&gt;
 
|&lt;unitDied&gt;
 
|Everything in this tag will be executed every time a unit from any player dies.
 
|Everything in this tag will be executed every time a unit from any player dies.
 +
|-
 +
|&lt;timer&nbsp;name="name"&gt;
 +
|GAE only; executes when a [[GAE/Lua|Lua timer]] of the specified name goes off.
 
|}
 
|}
  

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: