Making a patch mod: Difference between revisions

clarifying a little
(Created page with "==Overview== A patch mod, or XML patch mod, is a solution to the problem of conflicting mod packages. The AE releases prior to Seven dealt with this conflict for certain m...")
 
(clarifying a little)
Line 1: Line 1:
==Overview==
==Overview==
A patch mod, or XML patch mod, is a solution to the problem of conflicting mod packages. The [[AE]] releases prior to Seven dealt with this conflict for certain mods by pre-modding certain base .oni files, forcing the player to have them installed. However, like [[OniSplit]] allowed us to create optional mods for level files by splitting the levels into modular .oni files that could be replaced, so patch modding extends our control over the data even further, allowing us to modify specific properties of .oni files. It does this by providing the [[AEI]] with just the changes that should be made to an XML export of a resource, which are then applied using [[XmlTools]]. This provides a way to stack any mods which modify data besides media files like TXMPs and SNDDs. The full process for how the AEI handles patch mods is described [[Anniversary Edition/Framework|HERE]].
A patch mod, or XML patch mod, is a solution to the problem of conflicting mod packages. The [[AE]] releases prior to Seven dealt with this conflict for certain mods by pre-modding certain base .oni files, forcing the player to have them installed. However, like [[OniSplit]] allowed us to create optional mods for level files by splitting the levels into modular .oni files that could be replaced, so patch modding extends our control over the data even further, allowing us to modify specific properties of .oni files. It does this by providing the [[AEI]] with just the changes that should be made to an XML export of a resource, which are then applied using [[XmlTools]]. This provides a way to stack any mods which modify data like ONCCs and TRAMs (but not media resources like TXMPs and SNDDs). The full process for how the AEI handles patch mods is described [[Anniversary Edition/Framework|HERE]].


==Purpose of patch modding==
==Purpose of patch modding==
'''Problem''': You want to mod a certain resource, but it's already a part of another mod. That mod might come after yours numerically, thus erasing any change your mod makes if a player installs both mods. It seems that your only option is to mark your mod as incompatible with the other one, so the player has to choose which one to install. But wait!
'''Problem''': You want to mod a certain resource, but you know that the resource is already getting replaced by another mod. That mod might come after yours numerically, thus erasing any change your mod makes if a player installs both mods. It seems that your only option is to mark your mod as incompatible with the other one, so the player has to choose which one to install. But wait!


'''Solution''': If you aren't altering the exact same part of a certain resource as another mod, you can use a patch mod instead. A patch mod allows you to only alter the part of the resource that you need to; thus, patches can "stack" onto each other, so that any number of mods can affect the same resource without overriding each other.
'''Solution''': If you aren't altering the exact same part of a certain resource as another mod, you can use a patch mod instead. A patch mod allows you to only alter the part of the resource that you need to; thus, patches can "stack" onto each other, so that any number of mods can affect the same resource without overriding each other.


'''Example''': Consider the mods Glass Breaking Moves, Domino Knockdowns, and Disarm Revamp. Glass Breaking Moves adds a glass-breaking property to attacks and falling-body animations so they will shatter glass if the body hits a window. Domino Knockdowns adds a damaging stun or stagger property to an animation so that a falling character can hurt a character they collide with. Disarm Revamp removes the DropWeapon flag from knockdown animations so that characters can hold onto their gun more easily, and shoot at the enemy while laying on the ground. These mods have a potential three-way conflict; for instance, they all desire to affect TRAMKONOKOknockdown1. However, although they have file conflicts, there are no actual conflicts in how the mods wish to alter Oni's data. A patch mod will allow all three mods to be installed at once.
'''Example''': Consider the mods Glass Breaking Moves, Domino Knockdowns, and Disarm Revamp. Glass Breaking Moves adds a glass-breaking property to attacks and falling-body animations so they will shatter glass if they connect with a window. Domino Knockdowns adds a damaging stun or stagger property to an animation so that a falling character can hurt a character they collide with. Disarm Revamp removes the DropWeapon flag from knockdown animations so that characters can hold onto their gun more easily, and shoot at the enemy while laying on the ground. These mods have a potential three-way conflict; for instance, they all desire to affect TRAMKONOKOknockdown1. However, although they have file conflicts, there are no actual conflicts in how the mods wish to alter Oni's data. A patch mod will allow all three mods to be installed at once.


==Creation process==
==Creation process==
Line 24: Line 24:
  @COMMAND replaceall -element:FirstLevel -value:0
  @COMMAND replaceall -element:FirstLevel -value:0


The AEI will then process this file by looking up the TRAM whose name matches the .oni-patch file (TRAMKONCOMcomb_k_k_k), exporting it as XML, running XmlTools to apply the patch, then re-importing the XML as an .oni file and combining it with all other selected mods into the new level data for Oni to use.
The AEI will then process this file by looking up the TRAM whose name matches the .oni-patch file (TRAMKONCOMcomb_k_k_k), exporting it as XML, running XmlTools to apply the patch, then re-importing the XML as an .oni file and combining it with all other selected mods into the new level data for Oni to use. The modder does not have to worry about whether there is a modded form of this TRAM in some active mod because the AEI will use the .oni from the highest-numbered mod as the base for the patch. The AEI will use the vanilla resource from Oni if there are no modded versions of the .oni among the player's active mods.


[[Category:Modding tutorials]]
[[Category:Modding tutorials]]