Jump to content

XML:Basic tutorial: Difference between revisions

→‎XML tutorial for Anniversary Edition: touch-up, removing links to AE pages that are going the way of the dodo
m (tweaks)
(→‎XML tutorial for Anniversary Edition: touch-up, removing links to AE pages that are going the way of the dodo)
Line 6: Line 6:
:[[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 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. Note: "XML modding" is not "XML patch modding". Once you understand everything on this page, read [[Making a patch mod|THIS]] page to learn how (and why) you can make a patch mod.
: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.


===So I just export some data to XML and start editing?===
===Is that the same thing as this XML ''patch'' modding?===
:Not quite; XML patching is based on XML modding, though. Once you understand everything on this page, read [[Making a patch mod|THIS]] page to learn how (and why) you can make a patch mod.
 
===So I just export some data to XML and start editing, right?===
:Not so fast! A lot of the data is not that self-explanatory even as XML; it simply can't be, when the game engine is so complex. That's what the XML namespace on this wiki is for: documenting the game data tag by tag according to what you'll be seeing in the XML files, but just as importantly, explaining ''what all that data does''. That's important, because the wiki's original game data documentation in the [[OBD]] namespace was written for hackers and is lacking in plain-English explanations.
:Not so fast! A lot of the data is not that self-explanatory even as XML; it simply can't be, when the game engine is so complex. That's what the XML namespace on this wiki is for: documenting the game data tag by tag according to what you'll be seeing in the XML files, but just as importantly, explaining ''what all that data does''. That's important, because the wiki's original game data documentation in the [[OBD]] namespace was written for hackers and is lacking in plain-English explanations.


===Okay, what do I need to get started?===
===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]] is the recommended way to get these tools and a helpful framework installed.


===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]].


===What kinds of mods can I make?===
===What kinds of mods can I make?===
: See [[XML:File_types|HERE]] again. It's an overview of the kinds of resources that allow XML editing. But note that some types can be more difficult to mod than other.
:See [[XML:File_types|HERE]] again. It's an overview of the kinds of resources that allow XML editing. But note that some types can be more difficult to mod than others.
: If you need some ideas look at this page: '''[[Modding_brainstorms|modding brainstorms]]'''.
:If you need some ideas look at this page: '''[[Modding_brainstorms|modding brainstorms]]'''.
: If you want to contribute AE: [[AE:Bug-fix_and_feature_requests|bug-fixes and feature requests]].
:: Check also the [[Anniversary_Edition/To-do|AE's current To-Do page]] and maybe there are fields that need a modder.


===Hmm, I want to modify the files in Chapter ''X''. But what level file is that?===
===Hmm, I want to modify the files in Chapter ''X''. But what level file is that?===
Line 28: Line 29:


===Is there an easy exercise to get me started?===
===Is there an easy exercise to get me 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.
:Just see at the following table. Read left side if you use a Macintosh PC, read right side if you use a Windows PC.


{| class="wikitable" width="100%"
{| class="wikitable" width="100%"