XML:XML Modding Lessons: Difference between revisions

From OniGalore
Jump to navigation Jump to search
(Created page with "right :''If you want an introduction to modding that starts from square one, you should read Modding Oni.'' The '''XML''' namespace is devoted to explai...")
 
m (ignore this)
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
[[Image:XML.png|right]]
[[Image:XML.png|right]]
:''If you want an introduction to modding that starts from square one, you should read [[Modding Oni]].''
:''This article builds on the general introduction to modding found at [[Modding Oni]].''


The '''XML''' namespace is devoted to explaining Oni's data types in plainer English than the technical documentation at [[OBD]], by following the more user-friendly format the data appears in when exported by [[OniSplit]] as [[wikipedia:XML|XML]].
The '''XML''' namespace is devoted to explaining Oni's data types in plainer English than the technical documentation at [[OBD]], and provides tutorials in XML modding.
 
Oni's resources could be separated into one of two categories: media (such as textures and sounds), and non-media (such as character class data). Most of the non-media data can be exported to XML. This allows much easier modding than the hex-editing of the old days (compare the two methods [[Adding_spawnable_characters|here]]). Some media resources can also be edited as "XML", referring to the fact that an XML file will be created alongside the resource's image/sound file when it is exported from the game data, and this XML companion file contains metadata about the media resource that allows [[OniSplit]] to re-import the resource when you are done editing it.
 
To learn what the different resource types do, and to see which types can be edited through XML, see the database link below. Though XML modding can generally be done with nothing more than OniSplit's command line interface and a text editor, the tutorials linked to below are written with the [[Anniversary Edition]] in mind, because the AE provides modding tools (including a GUI for OniSplit), gives you a framework for testing your mod package, and globalizes more of Oni's data so it can be used in any level.
 
{{Divhide|Introduction to XML format}}
==Working with XML files==
[[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>. You can thus edit an XML file in any text editor, such as Notepad in Windows and TextEdit on the Mac.
 
* '''See the tutorials''' below to learn how to extract game data as XML, modify it, and get it back into Oni.
* '''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/visualstudio/express 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.
 
<gallery>
Image:Visual_Studio_collapsed_code.png|Visual Studio 2008
Image:Xcode.png|Xcode
</gallery>
 
{{Divhide|end}}


==Directory==
==Directory==
*[[XML:Introduction|Introduction]]
*[[XML:File types|Database of Oni's resource types]]
*[[XML:Basic tutorial|Basic tutorial]]
*[[XML:Basic tutorial|Basic tutorial]]
*[[XML:Advanced tutorial|Advanced tutorial]]
*[[XML:Advanced tutorial|Advanced tutorial]]
*[[XML:Expert tutorial|Expert tutorial]]
*[[XML:Expert tutorial|Expert tutorial]]
*[[Making a patch mod]]


<!-- setting up alarm consoles should be a good candidate for this
{{XML}}
alternative choices for such tutorial: TRAM usage of characters, ONIE
 
alarm consoles, reading material:
http://wiki.oni2.net/AI#Pursuit_of_enemy_alias_.22I_will_find_you....22
http://wiki.oni2.net/AI#Alarm_behavior_-_.22She.27s_everywhere.21.22
-->
 
{{OBD}}

Revision as of 10:16, 28 December 2017

XML.png
This article builds on the general introduction to modding found at Modding Oni.

The XML namespace is devoted to explaining Oni's data types in plainer English than the technical documentation at OBD, and provides tutorials in XML modding.

Oni's resources could be separated into one of two categories: media (such as textures and sounds), and non-media (such as character class data). Most of the non-media data can be exported to XML. This allows much easier modding than the hex-editing of the old days (compare the two methods here). Some media resources can also be edited as "XML", referring to the fact that an XML file will be created alongside the resource's image/sound file when it is exported from the game data, and this XML companion file contains metadata about the media resource that allows OniSplit to re-import the resource when you are done editing it.

To learn what the different resource types do, and to see which types can be edited through XML, see the database link below. Though XML modding can generally be done with nothing more than OniSplit's command line interface and a text editor, the tutorials linked to below are written with the Anniversary Edition in mind, because the AE provides modding tools (including a GUI for OniSplit), gives you a framework for testing your mod package, and globalizes more of Oni's data so it can be used in any level.

Directory