XML:Basic tutorial: Difference between revisions

m
wording
m (this feels incomplete without an expert tutorial ^_^)
m (wording)
Line 1: Line 1:
{{update}}
{{update}}
==XML tutorial for Anniversary Edition==
==XML tutorial for Anniversary Edition==
First off, we'll assume that you understand the material in the [[Modding Oni]] article. This tutorial is written with the [[Anniversary Edition]] in mind, because the AE installs the modding tools you need, gives you the framework for making a mod package, and globalizes more data. Global data can be used in any level.
First off, we'll assume that you understand the material in the [[Modding Oni]] article. This tutorial is written with the [[Anniversary Edition]] in mind, because the AE installs the modding tools you need, gives you the framework for testing your mod package, and globalizes more of Oni's data. Global data can be used in any level.


===What is XML, first of all?===
===What is XML, first of all?===
:[[wikipedia:XML|E'''X'''tensible '''M'''arkup '''L'''anguage]] is a plain-text file format designed to be both human-readable and machine-readable. It stores data in between tags, e.g. <tt><Data>Some data here.</Data></tt>, and these tags can be arranged in a hierarchy to keep things organized. The only difference between a normal text file and an XML file is that the file ends in .xml instead of .txt and that it typically begins with the string <tt><?xml version="1.0" encoding="UTF-8" ?></tt>. While you thus could easily make an XML file by hand in any text editor, there are programs listed below which are better suited for easy XML editing.
:[[wikipedia:XML|E'''X'''tensible '''M'''arkup '''L'''anguage]] is a plain-text file format designed to be both human-readable and machine-readable. It stores data in between tags, e.g. <tt><Data>Some data here.</Data></tt>, and these tags can be arranged in a hierarchy to keep things organized. The only technical difference between a normal text file and an XML file is that the file ends in .xml instead of .txt and that it typically begins with the string <tt><?xml version="1.0" encoding="UTF-8" ?></tt>. While you thus could easily make an XML file by hand in any text editor, there are programs listed below which are better suited for easy XML editing.


===Okay, so what is XML ''modding''?===
===Okay, so what is XML ''modding''?===
:In the old days, most of Oni's resources had to be edited by [[wikipedia:Hex editor|hex editor]]. Then [[User:Neo|Neo]], writer of OniSplit, introduced XML exporting. This turns "binary data" -- raw Oni resource data -- into human-readable XML which allows much easier modding. You can then import your edited XML file back into Oni's resource format with a simple command. The list of file types with XML support can be seen [[XML:File_types|HERE]]. The instructions for doing this manually on the command line are found at the bottom of the page, but before that, see the illustrated guide below to see how to do this more easily with a GUI.
:In the old days, most of Oni's resources had to be edited by [[wikipedia:Hex editor|hex editor]]. Then [[User:Neo|Neo]], writer of OniSplit, introduced XML exporting. This turns "binary data" -- raw Oni resource data -- into human-readable XML which allows much easier modding. You can then import your edited XML file back into Oni's resource format with a simple command. The list of file types with XML support can be seen [[XML:File_types|HERE]]. The instructions for doing this manually on the command line are found at the bottom of the page, but the illustrated guide below shows how to do this more easily with a GUI.


===Is that the same thing as this XML ''patch'' modding?===
===Is that the same thing as this XML ''patch'' modding?===
Line 16: Line 16:


===What tools do I need?===
===What tools do I need?===
:[[OniSplit]] will be your main tool. [[XmlTools]] is also needed for making XML patch mods. Installing the [[AE]] is the recommended way to get these tools and a helpful framework installed.
:[[OniSplit]] will be your main tool. [[XmlTools]] is also needed for making XML patch mods. Installing the [[AE]] will automatically install these tools, and will update a tool whenever the AE Installer runs and detects a new version of one.


===I've got the AE installed. What now?===
===I've got the AE installed. What now?===
:OniSplit cannot be opened by simply double-clicking it; it's a command-line tool. But you are lucky -- we now have a [[wikipedia:GUI|GUI]] for it: [[Vago (tool)|Vago]]. It's best to install Vago through the [[AEI#Tools|AEI]].
:OniSplit cannot be opened by simply double-clicking it; it's a command-line tool. But you are lucky -- we now have a [[wikipedia:GUI|GUI]] for it: [[Vago (tool)|Vago]]. It's best to install Vago through the [[AEI#Tools|AEI Tools menu]].


===What kinds of mods can I make?===
===What kinds of mods can I make?===
Line 28: Line 28:
:Check out [[GDF|this overview]] of Oni's game files.
:Check out [[GDF|this overview]] of Oni's game files.


===Is there an easy exercise to get me started?===
===Is there an easy exercise to get started?===
:Just see at the following table. Read left side if you use a Macintosh PC, read right side if you use a Windows PC.
:We're glad you asked:


{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
Line 145: Line 145:
[http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/hover_an_instance.png http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/hover_an_instance_preview.png]<br>Windows
[http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/hover_an_instance.png http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/hover_an_instance_preview.png]<br>Windows
|
|
[http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/code_folding.png http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/code_folding_preview.png]<br>Macintosh (xcode)
[http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/code_folding.png http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/code_folding_preview.png]<br>Macintosh (Xcode)
|}
|}


Line 161: Line 161:


==XML advanced tutorial==
==XML advanced tutorial==
The XML basic tutorial deals with xml <=> oni conversion and how to get the data into the game.
The XML basic tutorial deals with XML <=> .oni conversion and how to get the data into the game.


The XML advanced tutorial shows that resource can depend on each other and that they work together with BSL.
The XML advanced tutorial shows that resource can depend on each other and that they work together with BSL.