Advertisement
shirkit

Input

Jul 18th, 2011
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.43 KB | None | 0 0
  1. [SIZE=4][B][U][ANCHOR="The .honmod format"]9. The .honmod Format[/ANCHOR][/U][/B][/SIZE]
  2.  
  3. [SPOILER]Just like an ".s2z" a ".honmod" is a renamed ZIP. It contains the following files:
  4. [LIST]
  5. [*][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.
  6. [*][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.
  7. [*][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.
  8. [*]Any supportive files, e.g. new files your mod adds. You need to reference these in mod.xml or they will be ignored.
  9. [/LIST]
  10.  
  11. [SIZE=3]Elements and Attributes in mod.xml[/SIZE]
  12. [CODE]
  13. [COLOR=Cyan]<?xml[/COLOR] [COLOR=Red]version[/COLOR]="1.0" [COLOR=Red]encoding[/COLOR]="UTF-8"[COLOR=Cyan]?>[/COLOR]
  14. [COLOR=Cyan]<modification[/COLOR]
  15. [COLOR=Red]application[/COLOR]="Heroes of Newerth" [COLOR=Lime][I]fixed[/I][/COLOR]
  16. [COLOR=Red]appversion[/COLOR]="0.3" [COLOR=Lime][I]game version requirement (shown is "anything starting with 0.3")[/I][/COLOR]
  17. [COLOR=Red]mmversion[/COLOR]="1.3" [COLOR=Lime][I]fixed, the version of the file format[/I][/COLOR]
  18. [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]
  19. [COLOR=Red]version[/COLOR]="1.0" [COLOR=Lime][I]The current version of the mod. Should grow with each new release.[/I][/COLOR]
  20. [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]
  21. [COLOR=Red]author[/COLOR]="Your Nickname" [COLOR=Lime][I]Will be shown below the mod's name. (optional)[/I][/COLOR]
  22. [COLOR=Red]weblink[/COLOR]="http://www.com/" [COLOR=Lime][I]A clickable link to be shown below the description text. (optional)[/I][/COLOR]
  23. [COLOR=Red]updatecheckurl[/COLOR]="http://.../version.txt"[COLOR=Lime][I]A URL to a text file containing the newest version number. (optional)[/I][/COLOR]
  24. [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]
  25. [COLOR=Cyan]>[/COLOR]
  26. [COLOR=Lime]<!-- [I]Of the elements being described below each kind may appear any number of times and in any order[/I] -->[/COLOR]
  27.  
  28. [COLOR=Cyan]<incompatibility[/COLOR] [COLOR=Red]name[/COLOR]="Other mod" [COLOR=Red]version[/COLOR]="1.0-1.4" [COLOR=Cyan]/>[/COLOR]
  29. [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]
  30.  
  31. [COLOR=Cyan]<requirement[/COLOR] [COLOR=Red]name[/COLOR]="Other mod" [COLOR=Red]version[/COLOR]="2.5.1-*" [COLOR=Cyan]/>[/COLOR]
  32. [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]
  33.  
  34. [COLOR=Cyan]<applyafter[/COLOR] [COLOR=Red]name[/COLOR]="Other mod" [COLOR=Red]version[/COLOR]="2.5.1-*" [COLOR=Cyan]/>[/COLOR]
  35. [COLOR=Cyan]<applybefore[/COLOR] [COLOR=Red]name[/COLOR]="Other mod" [COLOR=Red]version[/COLOR]="2.5.1-*" [COLOR=Cyan]/>[/COLOR]
  36. [COLOR=Lime]<!-- [I]If the specified other mod is enabled, this mod will be applied after/before it.[/I] -->[/COLOR]
  37.  
  38. [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]
  39. [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".
  40. overwrite specifies a controlled behaviour in case the target file already exists:
  41. "yes" -> target file is overwritten
  42. "no" -> target file is left as is
  43. "newer" -> target file is overwritten if its last modified date is newer than target file
  44.  
  45. 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:
  46. 'Tiny UI'
  47. not 'Tiny UI'
  48. 'Tiny UI[v3.0]' and 'Automatic Ability Learner[v1.1-1.5]'
  49. ('BardUI' or ('Improved UI by Barter[v1.08]' and 'Improved UI Addon - Juking Map')) and not 'Tiny UI'[/I] -->[/COLOR]
  50.  
  51. [COLOR=Cyan]<editfile[/COLOR] [COLOR=Red]name[/COLOR]="path" [COLOR=Red]condition[/COLOR]="..."[COLOR=Cyan]>[/COLOR]
  52. [COLOR=Lime]<!-- [I]Edits a file from resources0.s2z or one that has already been copied[/I]
  53. If condition is specified this editfile tag is only executed if the given condition is true; uses the same syntax as for copyfile. -->
  54.  
  55. <!-- [I]Files are edited by executing a sequence of steps, each being represented by one of the four elements below.
  56. 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.
  57. 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]
  58.  
  59. [COLOR=Cyan]<find[/COLOR] [COLOR=Red]position[/COLOR]="end" [COLOR=Cyan]/>[/COLOR] [COLOR=Lime]<!-- [I]synonyms for "find" are "seek" and "search"[/I] -->[/COLOR]
  60. [COLOR=Lime]<!-- [I]Moves the "cursor" to the next occurrence of the source string
  61. OR as specified by the [COLOR=Red]position[/COLOR] attribute, possible values being:
  62. "start" -> Beginning of the file (synonyms: "begin", "head", "before")
  63. "end" -> End of the file (synonyms: "tail", "after", "eof")
  64. any integer -> Move forward the specified number of characters (negative values allowed)[/I] -->[/COLOR]
  65. [COLOR=Cyan]<findup[/COLOR] [COLOR=Cyan]/>[/COLOR] [COLOR=Lime]<!-- [I]synonyms for "findup" are "seekup" and "searchup"[/I] -->[/COLOR]
  66. [COLOR=Lime]<!-- [I]Moves the "cursor" to the next occurrence of the source string, but searching backwards.[/I] -->[/COLOR]
  67.  
  68. [COLOR=Cyan]<findall[/COLOR] [COLOR=Cyan]/>[/COLOR]
  69. [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]
  70.  
  71. [COLOR=Cyan]<insert[/COLOR] [COLOR=Red]position[/COLOR]="after" [COLOR=Cyan]/>[/COLOR] [COLOR=Lime]<!-- [I]synonym for "insert" is "add"[/I] -->[/COLOR]
  72. [COLOR=Lime]<!-- [I]Inserts the source string at the "cursor", either before or after as the [COLOR=Red]position[/COLOR] attribute specifies.[/I] -->[/COLOR]
  73.  
  74. [COLOR=Cyan]<replace />[/COLOR]
  75. [COLOR=Lime]<!-- [I]Replaces the string pointed to by the "cursor" with the source string.[/I] -->[/COLOR]
  76.  
  77. [COLOR=Cyan]<delete />[/COLOR]
  78. [COLOR=Lime]<!-- [I]Deletes the string pointed to by the "cursor". Does not require a source string.[/I] -->[/COLOR]
  79. [COLOR=Cyan]</editfile>[/COLOR]
  80. [COLOR=Cyan]</modification>[/COLOR]
  81. [/CODE]Remarks:
  82. [LIST]
  83. [*] Version values may only contain digits and periods. Letters will be ignored!
  84. [*] No two mods with the same name can be loaded at once.
  85. [*] "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 />.
  86. [/LIST]
  87. [/SPOILER] [GOTO="Top"]Back To The Top![/GOTO]
  88. [SIZE=4][COLOR=royalblue][B][U]_____________________[/U][/B][/COLOR][/SIZE]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement