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 (link fix)
 
(17 intermediate revisions by 3 users 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]].''
{{Hatnote|This article builds on [[Introduction to modding|this general introduction to modding]].}}
The '''XML''' namespace is devoted to explaining Oni's data types in plainer language than the technical documentation at [[OBD]] and also provides tutorials in XML-based modding.


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]].
==Introduction==
Oni's resources could be separated into one of two categories: media (such as models, 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 media file(s) when the resources are exported from the game data, and this XML companion file will contain metadata about the media files that allows [[OniSplit]] to re-import them properly when you are done editing them.


==Directory==
To learn what all the resource types do, and to see which types can be edited through XML, see the link to the database below. Though XML modding can generally be done with nothing more than OniSplit's command line interface and a text editor, the tutorials linked below are written with the [[Anniversary Edition]] in mind because the AE provides modding tools (including a GUI for OniSplit) and a framework for testing your mod package, and globalizes more of Oni's data so that it can be used in any level.
*[[XML:Introduction|Introduction]]
 
==Working with XML files==
{{Divhide|Beginners will find this useful}}
[[Image:Visual Studio collapsed code.png|thumb|right|Code folding in Visual Studio 2019.]]
[[Image:Xcode collapsed code.png|thumb|right|Xcode 12. If you don't see the code folding ribbon, see Preferences… > Text Editing > Display > Code folding ribbon.]]
[[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><nowiki><TagName>Some data here</TagName></nowiki></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 name 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.
 
* '''[[#Starter_tutorials|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 required by OniSplit but it helps one get an understanding of the hierarchy. Two examples:
 
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 allows you to collapse tags in order to get a better sense of the overall file structure, and is found in [[wikipedia:IDE|IDEs]] like [https://visualstudio.microsoft.com Microsoft Visual Studio] (Windows) and [https://developer.apple.com/xcode/ Xcode] (Mac). Both programs are free.
 
* '''File comparison''': For comparing two versions of an XML file to find the changes, you can use [https://winmerge.org/ WinMerge] (Windows) or FileMerge (Mac, comes with Xcode). Note that if one of the two files has passed through Oni and been re-exported, the data may have been totally reordered and cannot be diff-gazed effectively.
{{Divhide|end}}
==Knowledge database==
*[[XML:File types|XML resource type database]]
 
==Starter tutorials==
*[[XML:Basic tutorial|Basic tutorial]]
*[[XML:Basic tutorial|Basic tutorial]]
*[[XML:Advanced tutorial|Advanced tutorial]]
*[[XML:Advanced tutorial|Advanced tutorial]]
*[[Making a patch mod]] (read before expert tutorial)
*[[XML:Expert tutorial|Expert tutorial]]
*[[XML:Expert tutorial|Expert tutorial]]


<!-- setting up alarm consoles should be a good candidate for this
==Additional tutorials==
alternative choices for such tutorial: TRAM usage of characters, ONIE
*[[Creating a level]]
 
*[[Modifying an existing level]]
alarm consoles, reading material:
*[[Adding spawnable characters|Adding spawnable characters to a level]]
http://wiki.oni2.net/AI#Pursuit_of_enemy_alias_.22I_will_find_you....22
*[[XML:Adding Daodan powers to a character|Adding Daodan powers to a character]]
http://wiki.oni2.net/AI#Alarm_behavior_-_.22She.27s_everywhere.21.22
*[[XML:TRAM#Color_trails|Adding colored contrails to combat moves]]
-->


{{OBD}}
{{XML}}

Latest revision as of 19:17, 9 November 2023

XML.png
This article builds on this general introduction to modding.

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

Introduction

Oni's resources could be separated into one of two categories: media (such as models, 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 media file(s) when the resources are exported from the game data, and this XML companion file will contain metadata about the media files that allows OniSplit to re-import them properly when you are done editing them.

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

Working with XML files

Knowledge database

Starter tutorials

Additional tutorials