Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <span style='font-size:4;'><strong><span style='text-decoration:underline;'>[ANCHOR="The .honmod format"]9. The .honmod Format[/ANCHOR]</span></strong></span><br>
- <br>
- [SPOILER]Just like an ".s2z" a ".honmod" is a renamed ZIP. It contains the following files:<br>
- <ul><br>
- <li><span style='color:Red;'>[FONT=Courier New]mod.xml[/FONT]</span>: A valid XML file with describing "how the mod is applied", that is where to add/edit/delete code from the original files. There is a very detailed documentation given below, but you might as well just try looking at other mods to understand how this file works.</li><br>
- <li><span style='color:Red;'>[FONT=Courier New]icon.png[/FONT]</span>: A 48x48 icon to be displayed next to the mod's name in the mod manager. Note that partial transparency may not work or look fugly. This file is optional.</li><br>
- <li><span style='color:Blue;'>[FONT=Courier New]changelog.txt[/FONT]</span>: Optional file. This file will be displayed in the description of your mod as a possibility for the user to see the changelog. Accepts normal BBCode.</li><br>
- <li>Any supportive files, e.g. new files your mod adds. You need to reference these in mod.xml or they will be ignored.</li><br>
- </ul><br>
- <br>
- <span style='font-size:3;'>Elements and Attributes in mod.xml</span><br>
- <blockquote><br>
- <span style='color:Cyan;'><?xml</span> <span style='color:Red;'>version</span>="1.0" <span style='color:Red;'>encoding</span>="UTF-8"<span style='color:Cyan;'>?></span><br>
- <span style='color:Cyan;'><modification</span><br>
- <span style='color:Red;'>application</span>="Heroes of Newerth" <span style='color:Lime;'><span style='font-style:italic;'>fixed</span></span><br>
- <span style='color:Red;'>appversion</span>="0.3" <span style='color:Lime;'><span style='font-style:italic;'>game version requirement (shown is "anything starting with 0.3")</span></span><br>
- <span style='color:Red;'>mmversion</span>="1.3" <span style='color:Lime;'><span style='font-style:italic;'>fixed, the version of the file format</span></span><br>
- <span style='color:Red;'>name</span>="The Mod's Name" <span style='color:Lime;'><span style='font-style:italic;'>It is <strong>strongly</strong> recommended to keep this name consistent as it will identify the mod.</span></span><br>
- <span style='color:Red;'>version</span>="1.0" <span style='color:Lime;'><span style='font-style:italic;'>The current version of the mod. Should grow with each new release.</span></span><br>
- <span style='color:Red;'>description</span>="blahblahblah" <span style='color:Lime;'><span style='font-style:italic;'>Explanatory text about the mod to be shown when selected in the Mod Manager (optional)</span></span><br>
- <span style='color:Red;'>author</span>="Your Nickname" <span style='color:Lime;'><span style='font-style:italic;'>Will be shown below the mod's name. (optional)</span></span><br>
- <span style='color:Red;'>weblink</span>="http://www.com/" <span style='color:Lime;'><span style='font-style:italic;'>A clickable link to be shown below the description text. (optional)</span></span><br>
- <span style='color:Red;'>updatecheckurl</span>="http://.../version.txt"<span style='color:Lime;'><span style='font-style:italic;'>A URL to a text file containing the newest version number. (optional)</span></span><br>
- <span style='color:Red;'>updatedownloadurl</span>="http://.../m.honmod"<span style='color:Lime;'><span style='font-style:italic;'>A URL to a .honmod file that will be downloaded and replace this mod file when the text file specified above contains a higher version number than this mod currently has. (optional)</span></span><br>
- <span style='color:Cyan;'>></span><br>
- <span style='color:Lime;'><!-- <span style='font-style:italic;'>Of the elements being described below each kind may appear any number of times and in any order</span> --></span><br>
- <br>
- <span style='color:Cyan;'><incompatibility</span> <span style='color:Red;'>name</span>="Other mod" <span style='color:Red;'>version</span>="1.0-1.4" <span style='color:Cyan;'>/></span><br>
- <span style='color:Lime;'><!-- <span style='font-style:italic;'>States an incompatibility with certain versions of another mod to be abided by the Mod Manager; this mod cannot be enabled when the other mod is enabled.</span> --></span><br>
- <br>
- <span style='color:Cyan;'><requirement</span> <span style='color:Red;'>name</span>="Other mod" <span style='color:Red;'>version</span>="2.5.1-*" <span style='color:Cyan;'>/></span><br>
- <span style='color:Lime;'><!-- <span style='font-style:italic;'>States a dependence on another mod to be abided by the Mod Manager; this mod cannot be enabled when the other mod is not present and enabled.</span> --></span><br>
- <br>
- <span style='color:Cyan;'><applyafter</span> <span style='color:Red;'>name</span>="Other mod" <span style='color:Red;'>version</span>="2.5.1-*" <span style='color:Cyan;'>/></span><br>
- <span style='color:Cyan;'><applybefore</span> <span style='color:Red;'>name</span>="Other mod" <span style='color:Red;'>version</span>="2.5.1-*" <span style='color:Cyan;'>/></span><br>
- <span style='color:Lime;'><!-- <span style='font-style:italic;'>If the specified other mod is enabled, this mod will be applied after/before it.</span> --></span><br>
- <br>
- <span style='color:Cyan;'><copyfile</span> <span style='color:Red;'>name</span>="path1" <span style='color:Red;'>source</span>="path2" <span style='color:Red;'>overwrite</span>="newer" <span style='color:Red;'>condition</span>="..." <span style='color:Cyan;'>/></span><br>
- <span style='color:Lime;'><!-- <span style='font-style:italic;'>Copies a supportive file from the mod archive. If "path2" is not specified the file "path1" is copied, if it is "path2" is copied and renamed to "path1".<br>
- overwrite specifies a controlled behaviour in case the target file already exists:<br>
- "yes" -> target file is overwritten<br>
- "no" -> target file is left as is<br>
- "newer" -> target file is overwritten if its last modified date is newer than target file<br>
- <br>
- If the condition attribute is specified the copying is only performed if the given condition is true. A condition can consist of another mod being enabled or disabled or a boolean expression combining multiple such conditions. Examples of valid condition strings:<br>
- 'Tiny UI'<br>
- not 'Tiny UI'<br>
- 'Tiny UI[v3.0]' and 'Automatic Ability Learner[v1.1-1.5]'<br>
- ('BardUI' or ('Improved UI by Barter[v1.08]' and 'Improved UI Addon - Juking Map')) and not 'Tiny UI'</span> --></span><br>
- <br>
- <span style='color:Cyan;'><editfile</span> <span style='color:Red;'>name</span>="path" <span style='color:Red;'>condition</span>="..."<span style='color:Cyan;'>></span><br>
- <span style='color:Lime;'><!-- <span style='font-style:italic;'>Edits a file from resources0.s2z or one that has already been copied</span><br>
- If condition is specified this editfile tag is only executed if the given condition is true; uses the same syntax as for copyfile. --><br>
- <br>
- <!-- <span style='font-style:italic;'>Files are edited by executing a sequence of steps, each being represented by one of the four elements below.<br>
- All elements need a string as input, which can either be delivered as inner text node (between the <operation></operation> tags) or read from a file in the mod archive specified by a [COLOR=Red]source</span> attribute.<br>
- Every operation interacts with a "cursor" variable which points to a area in the file and starts out at the beginning of the file.</span> -->[/COLOR]<br>
- <br>
- <span style='color:Cyan;'><find</span> <span style='color:Red;'>position</span>="end" <span style='color:Cyan;'>/></span> <span style='color:Lime;'><!-- <span style='font-style:italic;'>synonyms for "find" are "seek" and "search"</span> --></span><br>
- <span style='color:Lime;'><!-- <span style='font-style:italic;'>Moves the "cursor" to the next occurrence of the source string<br>
- OR as specified by the [COLOR=Red]position</span> attribute, possible values being:<br>
- "start" -> Beginning of the file (synonyms: "begin", "head", "before")<br>
- "end" -> End of the file (synonyms: "tail", "after", "eof")<br>
- any integer -> Move forward the specified number of characters (negative values allowed)</span> -->[/COLOR]<br>
- <span style='color:Cyan;'><findup</span> <span style='color:Cyan;'>/></span> <span style='color:Lime;'><!-- <span style='font-style:italic;'>synonyms for "findup" are "seekup" and "searchup"</span> --></span><br>
- <span style='color:Lime;'><!-- <span style='font-style:italic;'>Moves the "cursor" to the next occurrence of the source string, but searching backwards.</span> --></span><br>
- <br>
- <span style='color:Cyan;'><findall</span> <span style='color:Cyan;'>/></span><br>
- <span style='color:Lime;'><!-- <span style='font-style:italic;'>Moves the "cursor" to all occurrences of the source string. Afterwards, the cursor will be reset to the start of the file.</span> --></span><br>
- <br>
- <span style='color:Cyan;'><insert</span> <span style='color:Red;'>position</span>="after" <span style='color:Cyan;'>/></span> <span style='color:Lime;'><!-- <span style='font-style:italic;'>synonym for "insert" is "add"</span> --></span><br>
- <span style='color:Lime;'><!-- <span style='font-style:italic;'>Inserts the source string at the "cursor", either before or after as the [COLOR=Red]position</span> attribute specifies.</span> -->[/COLOR]<br>
- <br>
- <span style='color:Cyan;'><replace /></span><br>
- <span style='color:Lime;'><!-- <span style='font-style:italic;'>Replaces the string pointed to by the "cursor" with the source string.</span> --></span><br>
- <br>
- <span style='color:Cyan;'><delete /></span><br>
- <span style='color:Lime;'><!-- <span style='font-style:italic;'>Deletes the string pointed to by the "cursor". Does not require a source string.</span> --></span><br>
- <span style='color:Cyan;'></editfile></span><br>
- <span style='color:Cyan;'></modification></span><br>
- </blockquote>Remarks:<br>
- <ul><br>
- <li> Version values may only contain digits and periods. Letters will be ignored!</li><br>
- <li> No two mods with the same name can be loaded at once.</li><br>
- <li> "Requirements" allow mods of mods; such mods will always be applied <span style='font-style:italic;'>after</span> the mods they marked as required so that they may edit their code; note that <requirement /> automatically implies <applyafter />.</li><br>
- </ul><br>
- [/SPOILER] [GOTO="Top"]Back To The Top![/GOTO]<br>
- <span style='font-size:4;'><span style='color:royalblue;'><strong><span style='text-decoration:underline;'>_____________________</span></strong></span></span><br>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement