Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [SIZE=4][B][U][ANCHOR="The .honmod format"]9. The .honmod Format[/ANCHOR][/U][/B][/SIZE]
- [SPOILER]Just like an ".s2z" a ".honmod" is a renamed ZIP. It contains the following files:
- [LIST]
- [*][COLOR=Red][FONT=Courier New]mod.xml[/FONT][/COLOR]: 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.
- [*][COLOR=Red][FONT=Courier New]icon.png[/FONT][/COLOR]: 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.
- [*][COLOR=Blue][FONT=Courier New]changelog.txt[/FONT][/COLOR]: 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.
- [*]Any supportive files, e.g. new files your mod adds. You need to reference these in mod.xml or they will be ignored.
- [/LIST]
- [SIZE=3]Elements and Attributes in mod.xml[/SIZE]
- [CODE]
- [COLOR=Cyan]<?xml[/COLOR] [COLOR=Red]version[/COLOR]="1.0" [COLOR=Red]encoding[/COLOR]="UTF-8"[COLOR=Cyan]?>[/COLOR]
- [COLOR=Cyan]<modification[/COLOR]
- [COLOR=Red]application[/COLOR]="Heroes of Newerth" [COLOR=Lime][I]fixed[/I][/COLOR]
- [COLOR=Red]appversion[/COLOR]="0.3" [COLOR=Lime][I]game version requirement (shown is "anything starting with 0.3")[/I][/COLOR]
- [COLOR=Red]mmversion[/COLOR]="1.3" [COLOR=Lime][I]fixed, the version of the file format[/I][/COLOR]
- [COLOR=Red]name[/COLOR]="The Mod's Name" [COLOR=Lime][I]It is [B]strongly[/B] recommended to keep this name consistent as it will identify the mod.[/I][/COLOR]
- [COLOR=Red]version[/COLOR]="1.0" [COLOR=Lime][I]The current version of the mod. Should grow with each new release.[/I][/COLOR]
- [COLOR=Red]description[/COLOR]="blahblahblah" [COLOR=Lime][I]Explanatory text about the mod to be shown when selected in the Mod Manager (optional)[/I][/COLOR]
- [COLOR=Red]author[/COLOR]="Your Nickname" [COLOR=Lime][I]Will be shown below the mod's name. (optional)[/I][/COLOR]
- [COLOR=Red]weblink[/COLOR]="http://www.com/" [COLOR=Lime][I]A clickable link to be shown below the description text. (optional)[/I][/COLOR]
- [COLOR=Red]updatecheckurl[/COLOR]="http://.../version.txt"[COLOR=Lime][I]A URL to a text file containing the newest version number. (optional)[/I][/COLOR]
- [COLOR=Red]updatedownloadurl[/COLOR]="http://.../m.honmod"[COLOR=Lime][I]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)[/I][/COLOR]
- [COLOR=Cyan]>[/COLOR]
- [COLOR=Lime]<!-- [I]Of the elements being described below each kind may appear any number of times and in any order[/I] -->[/COLOR]
- [COLOR=Cyan]<incompatibility[/COLOR] [COLOR=Red]name[/COLOR]="Other mod" [COLOR=Red]version[/COLOR]="1.0-1.4" [COLOR=Cyan]/>[/COLOR]
- [COLOR=Lime]<!-- [I]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.[/I] -->[/COLOR]
- [COLOR=Cyan]<requirement[/COLOR] [COLOR=Red]name[/COLOR]="Other mod" [COLOR=Red]version[/COLOR]="2.5.1-*" [COLOR=Cyan]/>[/COLOR]
- [COLOR=Lime]<!-- [I]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.[/I] -->[/COLOR]
- [COLOR=Cyan]<applyafter[/COLOR] [COLOR=Red]name[/COLOR]="Other mod" [COLOR=Red]version[/COLOR]="2.5.1-*" [COLOR=Cyan]/>[/COLOR]
- [COLOR=Cyan]<applybefore[/COLOR] [COLOR=Red]name[/COLOR]="Other mod" [COLOR=Red]version[/COLOR]="2.5.1-*" [COLOR=Cyan]/>[/COLOR]
- [COLOR=Lime]<!-- [I]If the specified other mod is enabled, this mod will be applied after/before it.[/I] -->[/COLOR]
- [COLOR=Cyan]<copyfile[/COLOR] [COLOR=Red]name[/COLOR]="path1" [COLOR=Red]source[/COLOR]="path2" [COLOR=Red]overwrite[/COLOR]="newer" [COLOR=Red]condition[/COLOR]="..." [COLOR=Cyan]/>[/COLOR]
- [COLOR=Lime]<!-- [I]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".
- overwrite specifies a controlled behaviour in case the target file already exists:
- "yes" -> target file is overwritten
- "no" -> target file is left as is
- "newer" -> target file is overwritten if its last modified date is newer than target file
- 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:
- 'Tiny UI'
- not 'Tiny UI'
- 'Tiny UI[v3.0]' and 'Automatic Ability Learner[v1.1-1.5]'
- ('BardUI' or ('Improved UI by Barter[v1.08]' and 'Improved UI Addon - Juking Map')) and not 'Tiny UI'[/I] -->[/COLOR]
- [COLOR=Cyan]<editfile[/COLOR] [COLOR=Red]name[/COLOR]="path" [COLOR=Red]condition[/COLOR]="..."[COLOR=Cyan]>[/COLOR]
- [COLOR=Lime]<!-- [I]Edits a file from resources0.s2z or one that has already been copied[/I]
- If condition is specified this editfile tag is only executed if the given condition is true; uses the same syntax as for copyfile. -->
- <!-- [I]Files are edited by executing a sequence of steps, each being represented by one of the four elements below.
- 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[/COLOR] attribute.
- Every operation interacts with a "cursor" variable which points to a area in the file and starts out at the beginning of the file.[/I] -->[/COLOR]
- [COLOR=Cyan]<find[/COLOR] [COLOR=Red]position[/COLOR]="end" [COLOR=Cyan]/>[/COLOR] [COLOR=Lime]<!-- [I]synonyms for "find" are "seek" and "search"[/I] -->[/COLOR]
- [COLOR=Lime]<!-- [I]Moves the "cursor" to the next occurrence of the source string
- OR as specified by the [COLOR=Red]position[/COLOR] attribute, possible values being:
- "start" -> Beginning of the file (synonyms: "begin", "head", "before")
- "end" -> End of the file (synonyms: "tail", "after", "eof")
- any integer -> Move forward the specified number of characters (negative values allowed)[/I] -->[/COLOR]
- [COLOR=Cyan]<findup[/COLOR] [COLOR=Cyan]/>[/COLOR] [COLOR=Lime]<!-- [I]synonyms for "findup" are "seekup" and "searchup"[/I] -->[/COLOR]
- [COLOR=Lime]<!-- [I]Moves the "cursor" to the next occurrence of the source string, but searching backwards.[/I] -->[/COLOR]
- [COLOR=Cyan]<findall[/COLOR] [COLOR=Cyan]/>[/COLOR]
- [COLOR=Lime]<!-- [I]Moves the "cursor" to all occurrences of the source string. Afterwards, the cursor will be reset to the start of the file.[/I] -->[/COLOR]
- [COLOR=Cyan]<insert[/COLOR] [COLOR=Red]position[/COLOR]="after" [COLOR=Cyan]/>[/COLOR] [COLOR=Lime]<!-- [I]synonym for "insert" is "add"[/I] -->[/COLOR]
- [COLOR=Lime]<!-- [I]Inserts the source string at the "cursor", either before or after as the [COLOR=Red]position[/COLOR] attribute specifies.[/I] -->[/COLOR]
- [COLOR=Cyan]<replace />[/COLOR]
- [COLOR=Lime]<!-- [I]Replaces the string pointed to by the "cursor" with the source string.[/I] -->[/COLOR]
- [COLOR=Cyan]<delete />[/COLOR]
- [COLOR=Lime]<!-- [I]Deletes the string pointed to by the "cursor". Does not require a source string.[/I] -->[/COLOR]
- [COLOR=Cyan]</editfile>[/COLOR]
- [COLOR=Cyan]</modification>[/COLOR]
- [/CODE]Remarks:
- [LIST]
- [*] Version values may only contain digits and periods. Letters will be ignored!
- [*] No two mods with the same name can be loaded at once.
- [*] "Requirements" allow mods of mods; such mods will always be applied [I]after[/I] the mods they marked as required so that they may edit their code; note that <requirement /> automatically implies <applyafter />.
- [/LIST]
- [/SPOILER] [GOTO="Top"]Back To The Top![/GOTO]
- [SIZE=4][COLOR=royalblue][B][U]_____________________[/U][/B][/COLOR][/SIZE]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement