User Tools

Site Tools


designer_tutorials:xml:xml

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
designer_tutorials:xml:xml [2018/05/15 15:07]
Kjeld Adding info on borders
designer_tutorials:xml:xml [2018/05/16 09:44] (current)
Kjeld
Line 3: Line 3:
 The designer allows you to download and upload XML versions of your boards. This feature can be very helpful when designing boards with complex game mechanics that require hundreds (or thousands) of continents, borders, or border modifiers, as you can use scripts to automate much of the process. The designer allows you to download and upload XML versions of your boards. This feature can be very helpful when designing boards with complex game mechanics that require hundreds (or thousands) of continents, borders, or border modifiers, as you can use scripts to automate much of the process.
  
-Even if you are not automating via script, it can still be quicker to make edits directly in an XML than in the board designer. An example is if you decide that you want to adjust all your continent bonuses by +1 -- if you just have a a few dozen continents, you can make this change far more quickly by manually editing the XML file than you can in the designer.+Even if you are not automating via script, it can still be quicker to make edits directly in an XML (using a text editor) rather than in the board designer (using the GUI)To give an example, it is far quicker to adjust all your continent bonuses by +1 in the XML.
  
-==== What is an XML file and how to view XML ====+==== What is an XML file====
  
-You can look it up XML on Wikipedia, but the [[https://en.wikipedia.org/wiki/XML|entry]] is not necessarily that helpful, apart from the section on Key Terminology. Basically, an XML file is a textual representation of all the board mechanics that you add and edit through the graphical user interface on the board designer. In other words, the XML represents what's going on in the background as you create and modify your board design in the designer. The only things the XML doesn't capture are the image files: board, fill, and fog images.+You can look up XML on Wikipedia, but the [[https://en.wikipedia.org/wiki/XML|entry]] is not necessarily that helpful, apart from the section on Key Terminology. For our purposes as WarGear board designers, an XML file is a textual representation of all the board mechanics that you add and edit through the graphical user interface on the board designer. In other words, the XML represents what's going on in the background as you create and modify your board design in the designer. The only things the XML doesn't capture are the image files: board, fill, and fog images.
  
-For WarGear purposes, what you most need to know is how territories, continents, and borders are represented in XML format. The easiest way to do this is to export the XML file for an existing boardand simply browse through it. Most browsers will display an XML file, but to edit an XML you will generally want to use a specialized application.+What you most need to know is how territories, continents, and borders are represented in XML format. The easiest way to do this is to export the XML file for an existing board and simply browse through it.
  
-One good free option is [[https://notepad-plus-plus.org/|Notepad++]]. It is recommended that you also install the [[https://sourceforge.net/projects/npp-plugins/files/XML%20Tools/|XML Tools]] plugin, which gives you access to some helpful bells and whistles such as Pretty print (XML only - with line breaks). WarGear exports the XML files in a difficult-to-read format, and using the pretty print tool will quickly separate the code associated with each individual territory, continent, and border into separate lines.+==== How to view and edit an XML file ==== 
 + 
 +Most browsers will display an XML file, but to edit an XML you will generally want to use a specialized application. One good free option is [[https://notepad-plus-plus.org/|Notepad++]]. 
 + 
 +It is recommended that you also install the [[https://sourceforge.net/projects/npp-plugins/files/XML%20Tools/|XML Tools]] plugin, which gives you access to some helpful bells and whistles such as Pretty print (XML only - with line breaks). WarGear exports the XML files in a difficult-to-read format, and using the pretty print tool will quickly separate the code associated with each individual territory, continent, and border into separate lines.
  
 ==== Territories, Continents, and Borders in XML Format ==== ==== Territories, Continents, and Borders in XML Format ====
Line 19: Line 23:
 === Territory === === Territory ===
  
-An individual territory will have the following format:+An individual territory element will have the following format:
  
 <territory id="1234567" tid="0" boardid="1234" name="Territory A" xpos="1" ypos="1" max_units="0" scenario_type="Neutral" scenario_seat="0" scenario_units="2" unit_placement="Enabled" /> <territory id="1234567" tid="0" boardid="1234" name="Territory A" xpos="1" ypos="1" max_units="0" scenario_type="Neutral" scenario_seat="0" scenario_units="2" unit_placement="Enabled" />
Line 25: Line 29:
 You can see that a territory element comprises a list of attributes: You can see that a territory element comprises a list of attributes:
  
-  - id: WarGear's internal identification number. You don't need to worry about editing this -- WarGear creates them automatically when you upload an XML. +  - **id**: WarGear's internal identification number. You don't need to worry about editing this -- WarGear creates them automatically when you upload an XML. 
-  - tid: Start with 0 and goes up to the number of total territories minus one. Have to be unique. Again, WarGear will create these automatically. +  - **tid**: Start with 0 and goes up to the number of total territories minus one. Have to be unique. Again, WarGear will create these automatically. 
-  - boardid: The same for every territory, this is the id number of the board. WarGear will create this automatically if you don't include it. +  - **boardid**: The same for every territory, this is the id number of the board. WarGear will create this automatically if you don't include it. 
-  - name: Territory namespaces and special characters are generally OK, though many special characters won't display properly in the game engine. +  - **name**: Territory namespaces and special characters are generally OK, though many special characters won't display properly in the game engine. 
-  - max_units: What it says. Note that entering "0" means that the territory can hold unlimited units. +  - **max_units**: What it says. Note that entering "0" means that the territory can hold unlimited units. 
-  - scenario_type: If your board uses a scenario to start the game, this indicates whether the territory starts open ("0"), "Neutral", non-capital "Allocated", "Neutral Capital", or as an allocated "Capital City"+  - **scenario_type**: If your board uses a scenario to start the game, this indicates whether the territory starts open ("0"), "Neutral", non-capital "Allocated", "Neutral Capital", or as an allocated "Capital City"
-  - scenario_seat: If allocated to a player, this is the player's seat number. Otherwise is "0"+  - **scenario_seat**: If allocated to a player, this is the player's seat number. Otherwise is "0"
-  - scenario_units: Number of units the territory starts with. If scenario_type is set to "0", this should also be set to "0"+  - **scenario_units**: Number of units the territory starts with. If scenario_type is set to "0", this should also be set to "0"
-  - unit_placement: Whether unit placement is "Enabled" or "Disabled".+  - **unit_placement**: Whether unit placement is "Enabled" or "Disabled".
  
 === Continent === === Continent ===
  
-An individual continent will have the following format:+An individual continent element will have the following format:
  
 <continent continentid="12345678" boardid="1234" name="Continent A" bonus="1" members="0,1,2" factory="-1" factory_type="Standard" factory_cap="0" /> <continent continentid="12345678" boardid="1234" name="Continent A" bonus="1" members="0,1,2" factory="-1" factory_type="Standard" factory_cap="0" />
Line 43: Line 47:
 You can see that a continent element also comprises a list of attributes: You can see that a continent element also comprises a list of attributes:
  
-  - continentid: Don't worry about these. WarGear will create these automatically when you upload the XML. +  - **continentid**: Don't worry about these. WarGear will create these automatically when you upload the XML. 
-  - boardid: The same for every territory. WarGear will create this automatically if you don't include it. +  - **boardid**: The same for every territory. WarGear will create this automatically if you don't include it. 
-  - name: Continent namespaces and special characters are generally OK, though many special characters won't display properly in the game engine. +  - **name**: Continent namespaces and special characters are generally OK, though many special characters won't display properly in the game engine. 
-  - bonus: The continent bonus value. +  - **bonus**: The continent bonus value. 
-  - members: Comma separated list of the tid values of the member territories (i.e. the territories that comprise the continent). +  - **members**: Comma separated list of the tid values of the member territories (i.e. the territories that comprise the continent). 
-  - factory: The tid value of the territory to which the bonus will be added. Should be set to "-1" if the continent is not a factory. +  - **factory**: The tid value of the territory to which the bonus will be added. Should be set to "-1" if the continent is not a factory. 
-  - factory_type: Indicates whether the continent is a factory, and if so what kind. Default is "Standard", even if it's not actually a factory (in this case, factory will be set to "-1"). Other options are "AutoCapture", "AutoNeutral", "AutoNeutralReset", "Universal", "Universal-N", "Univeral+N". For descriptions of these options, see the WarGear Wiki entry on [[designer_tutorials:tutorials:factories:factories|factories]]. +  - **factory_type**: Indicates whether the continent is a factory, and if so what kind. Default is "Standard", even if it's not actually a factory (in this case, factory will be set to "-1"). Other options are "AutoCapture", "AutoNeutral", "AutoNeutralReset", "Universal", "Universal-N", "Univeral+N". For descriptions of these options, see the WarGear Wiki entry on [[designer_tutorials:tutorials:factories:factories|factories]]. 
-  - factory_cap: Maximum number of units to which the factory continent will fill the territory. Example: a +10 factory bonus with a cap of 20 will only add units to the factory target territory up to 20. So if it started turn with 15, the factory will only generate 5 units. Note that default is "0", which means the cap is unlimited.+  - **factory_cap**: Maximum number of units to which the factory continent will fill the territory. Example: a +10 factory bonus with a cap of 20 will only add units to the factory target territory up to 20. So if it started turn with 15, the factory will only generate 5 units. Note that default is "0", which means the cap is unlimited.
  
 === Border === === Border ===
  
-An individual border will have the following format:+An individual border element will have the following format:
  
 <border borderid="12345678" boardid="1234" fromid="1" toid="2" direction="Two-way" type="Default" ftattackmod="0" ftdefendmod="0" tfattackmod="0" tfdefendmod="0" /> <border borderid="12345678" boardid="1234" fromid="1" toid="2" direction="Two-way" type="Default" ftattackmod="0" ftdefendmod="0" tfattackmod="0" tfdefendmod="0" />
Line 60: Line 64:
 You can see that a border element also comprises a list of attributes: You can see that a border element also comprises a list of attributes:
  
-  - borderid: continentid: Don't worry about these. WarGear will create these automatically when you upload the XML. +  - **borderid**: Don't worry about these. WarGear will create these automatically when you upload the XML. 
-  - boardid: The same for every territory. WarGear will create this automatically if you don't include it. +  - **boardid**: The same for every territory. WarGear will create this automatically if you don't include it. 
-  - fromid: The tid value of the territory the border starts from +  - **fromid**: The tid value of the territory the border starts from 
-  - toid: The tid value of the territory the border connects to +  - **toid**: The tid value of the territory the border connects to 
-  - direction: Can be "Two-way" or "One-way" +  - **direction**: Can be "Two-way" or "One-way" 
-  - type: Can be "Default", "Artillery", "Attack Only", "Fortify Only", or "View Only" +  - **type**: Can be "Default", "Artillery", "Attack Only", "Fortify Only", or "View Only" 
-  - ftattackmod: Number of sides added to or subtracted from the attack dice in the direction of the start (from) territory to the end (to) territory. Note that for SimulGear this is the percent added to or subtracted from the attacker's chance to kill. +  - **ftattackmod**: Number of sides added to or subtracted from the attack dice in the direction of the start (from) territory to the end (to) territory. Note that for SimulGear this is the percent added to or subtracted from the attacker's chance to kill. 
-  - ftdefendmod: Number of sides added to or subtracted from the defend dice in the direction of the start (from) territory to the end (to) territory. Note that for SimulGear this is the percent added to or subtracted from the defender's chance to kill. +  - **ftdefendmod**: Number of sides added to or subtracted from the defend dice in the direction of the start (from) territory to the end (to) territory. Note that for SimulGear this is the percent added to or subtracted from the defender's chance to kill. 
-  - tfattackmod: Number of sides added to or subtracted from the attack dice in the direction of the end (to) territory to the start (from) territory. Note that for SimulGear this is the percent added to or subtracted from the attacker's chance to kill. +  - **tfattackmod**: Number of sides added to or subtracted from the attack dice in the direction of the end (to) territory to the start (from) territory. Note that for SimulGear this is the percent added to or subtracted from the attacker's chance to kill. 
-  - tfdefendmod: Number of sides added to or subtracted from the defend dice in the direction of the end (to) territory to the start (from) territory. Note that for SimulGear this is the percent added to or subtracted from the defender's chance to kill.+  - **tfdefendmod**: Number of sides added to or subtracted from the defend dice in the direction of the end (to) territory to the start (from) territory. Note that for SimulGear this is the percent added to or subtracted from the defender's chance to kill.
  
designer_tutorials/xml/xml.1526411260.txt.gz · Last modified: 2018/05/15 15:07 by Kjeld