|
|
Line 1: |
Line 1: |
| | {{XML Home}} |
| {{update}} | | {{update}} |
| ==XML modding with the 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 testing your mod package, and globalizes more of Oni's data so it can be used in any level.
| |
|
| |
|
| ;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 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?
| |
| :XML modding is the process of using [[OniSplit]] to export "binary data" -- raw Oni resource data -- into human-readable XML, which allows much easier modding, then importing that data back into Oni. Media resource types with XML support may extract as a standard format file (e.g. PNG) with an XML file alongside it. The list of file types with XML support can be seen [[XML:File_types|HERE]]. Below are instructions for doing this manually on the command line as well as an illustrated guide on how to do this more easily with a GUI.
| |
|
| |
| ;Is XML modding 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]] to learn about patch mods.
| |
|
| |
| ;So I just export some data to XML and start editing, right?
| |
| :Not so fast! A lot of the data is too complex to be self-explanatory in the XML format. You need to read the [[XML:File_types|XML File Types]] page to learn how the game data is interrelated and what it all does.
| |
|
| |
| ;What tools do I need?
| |
| :[[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.
| |
|
| |
| :Note that 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?
| |
| :We can now make completely new levels. If you need some ideas, a few can be found on the [[Modding_brainstorms|Modding Brainstorms]] page.
| |
|
| |
| ;I want to modify the files in Chapter ''X''. What level file is that?
| |
| :See the [[GameDataFolder]] page.
| |
|
| |
| ==XML beginner tutorial==
| |
| {| class="wikitable" width="100%" | | {| class="wikitable" width="100%" |
| !colspan=2|Mac: | | !colspan=2|Mac: |
Line 120: |
Line 95: |
| |[http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/XML_tutorial_img6.png http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/XML_tutorial_img6_TN.png] | | |[http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/XML_tutorial_img6.png http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/XML_tutorial_img6_TN.png] |
| |} | | |} |
|
| |
| ==Important tips for working with XML files==
| |
| * '''Capitalization matters''': OniSplit is case-sensitive when it processes the XML.
| |
| * '''Text indentation''': most tags have some indentation (tabs). It is not needed by OniSplit but it helps one get an understanding of the hierarchy. Example:
| |
| good:
| |
| <Instance id="4" type="IGSA">
| |
| <Strings>
| |
| <Link>#7</Link>
| |
| </Strings>
| |
| </Instance>
| |
| bad:
| |
| <Instance id="4" type="IGSA"><Strings><Link>#7</Link></Strings></Instance>
| |
|
| |
| * '''Code folding''': A simple text editor (and good use of the search function) is actually enough to work with Oni's XML. But big files might be easier to handle with what programmers call "code folding". Code folding is found in [[wikipedia:IDE|IDEs]] like [http://www.microsoft.com/express/download/ Microsoft Visual Studio] (Windows) and [http://developer.apple.com/technology/Xcode.html Xcode] (Mac). Both are free.
| |
| : This allows you to fold whole instances and parent tags. Folded code can be previewed in Microsoft Visual Studio applications. Xcode provides an extra scroll popup.
| |
|
| |
| {|
| |
| |[http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/collapse_code.png http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/collapse_code_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)
| |
| |}
| |
|
| |
| ==Extracting XMLs from the Mac command line (the Terminal)==
| |
| Put the '''[[OniSplit|newest OniSplit.exe]]''' into the "Oni/GameDataFolder" folder.
| |
|
| |
| Open the Terminal program then "change directory" to the GameDataFolder (Type "cd " then drag the GameDataFolder into the Terminal window, now press the RETURN key)
| |
|
| |
| At this point you can enter the OniSplit commands, such as:
| |
|
| |
| mono onisplit.exe -extract:xml xml_dir level0_Final/ONCCkonoko*.oni
| |
|
| |
| ("ONCCkonoko_generic" will be extracted in new folder "GameDataFolder/xml_dir".)
| |
|
| |
|
| [[Category:Modding tutorials]] | | [[Category:Modding tutorials]] |