Template:Dmbox/doc and Help:Creating mods: Difference between pages

From ZeldaMods (Breath of the Wild)
< Template:Dmbox(Difference between pages)
Jump to navigation Jump to search
imported>Leoetlino
m (1 revision imported)
 
imported>BravelyPeculiar
 
Line 1: Line 1:
{{Documentation subpage}}
Welcome, modders! This page is intended to be a collection of useful information for anybody who wants to create mods. If you want to simply use other people's mods, see [[Help:Playing with mods]].
{{High-risk| 317,000+ }}
<!-- Categories where indicated at the bottom of this page, please; interwikis go to Wikidata (see also: [[Wikipedia:Wikidata]]) -->
{{Mbox templates (small)}}


This is the {{tl|Dmbox}} (['''D''']isambiguation footer ['''m''']essage ['''box''']) metatemplate.
== Getting set up ==
To make mods, you'll need to start by dumping the unedited game files from your copy of BotW.
* [[Help:Playing with mods#Wii U/Cemu|Dumping the game files (Wii U)]]
* [[Help:Dumping games|Dumping the game files (Switch)]]


It is used to build [[WP:disambiguation|disambiguation]] and [[Wikipedia:set index article|set index article]] message boxes, such as {{tl|Disambiguation}} and {{tl|Shipindex}}.  
== Files, Tools and Tutorials ==
Since BotW uses a lot of Nintendo's own file formats, you'll need tools to be able to edit them. To use leoetlino's tools, you need to install the latest version of Python (64 bit version), and tick the "Add to PATH" / "Add to environment variables" box in the installer. Then, to install the tool, run <code>pip install TOOL_NAME</code> in the command line.


This template works similarly to {{tl|Ambox}} and mostly uses the same parameters. The main differences are that this box uses the disambiguation style and only has two "type" settings.
If you're not sure which tool to use on a file, search for its extension on this wiki to find what file format that extension is used for.


=== Usage ===
=== Yaz0 compression ===
Simple usage example:
Many files in the game are compressed with [[Yaz0]] compression. Compressed files generally have the letter <code>s</code> prefixed to their file extension. To decompress and recompress these files, use '''wszst''' (install with <code>pip install wszst-yaz0</code>).
* <code>wszst decompress INPUT_FILE.sbactorpack OUTPUT_FILE.bactorpack</code>
* <code>wszst compress INPUT_FILE.bfres OUTPUT_FILE.sbfres</code>


<pre>
=== SARC archives ===
{{dmbox | text = Some text.}}
[[SARC]] archives contain collections of other files and folders, like .zip folders. Unpack, edit and re-pack them with leoetlino's [https://pypi.org/project/sarc/ <code>sarc</code> tool]. This tool automatically decompresses Yaz0-encoded archives, and re-compresses them when you repack if the extension starts with an <code>s</code>.
</pre>
* <code>sarc extract INPUT_FILE.pack</code>
* <code>sarc create [-b] INPUT_FOLDER OUTPUT_FILE.sbactorpack</code> (Use <code>-b</code>for Wii U only).


{{dmbox | text = Some text.}}
=== BYML files ===
[[BYML]] files contain game parameters. Convert them to an editable format (and back) with leoetlino's [https://pypi.org/project/byml/ <code>byml</code> tool]. This tool automatically decompresses Yaz0-encoded files, and re-compresses them if the extension starts with an <code>s</code>.
* <code>byml_to_yml INPUT_FILE.byml OUTPUT_FILE.yml</code>
* <code>yml_to_byml [-b] INPUT_FILE.yml OUTPUT_FILE.sbyml</code> (Use <code>-b</code> for Wii U only).


<pre>
=== AAMP files ===
{{dmbox | type = setindex | text = Some text.}}
[[AAMP]] files also contain game parameters. Convert them to an editable format (and back) with leoetlino's [https://pypi.org/project/aamp/ <code>aamp</code> tool]. Unlike most other files, AAMP files are exactly the same on both Wii U and Switch.
</pre>
* <code>aamp_to_yml INPUT_FILE.bxml OUTPUT_FILE.yml</code>
* <code>yml_to_aamp INPUT_FILE.yml OUTPUT_FILE.bgparamlist</code>


{{dmbox | type = setindex | text = Some text.}}
=== BFRES files ===
[[BFRES]] files contain the game's models and textures. Tutorials on how to edit these for Wii U can be found in [https://drive.google.com/drive/folders/1Z1_A3w0VvPHp22H_Yh_dSdzI5hr4OAv9 Fooni's Tutorials].
* <code>.sbfres</code> files contain models.
* <code>.Tex1.sbfres</code> files contain textures (Wii U).
* <code>.Tex2.sbfres</code> files contain mipmaps for textures (Wii U). Since we can't edit these on Wii U yet, they need to be disabled.
* <code>.Tex.sbfres</code> files contain both textures and mipmaps (Switch). Unlike on Wii U, mipmaps don't cause any problems here.


== Rules ==


Complex example:
=== The RSTB file ===
The file [[ResourceSizeTable.product.rsizetable]] (referred to as the RSTB file) contains a list of size limits for almost every file in the game (calculated from the non-Yaz0-compressed file sizes). If you edit a file to make its filesize bigger, you'll need to edit this file to prevent errors. For details, see [[Help:Editing the RSTB]].


<pre>
=== File names and caching ===
{{dmbox
The game assumes that any 2 files with the exact same filename also have the exact same contents. If you don't follow this rule when editing files, the game might load the wrong version of the file, leading to errors.
| type      = setindex
| image    = {{nowrap| [[Image:Schooner.svg|30px]] [[Image:DAB list gray.svg|30px]] }}
| textstyle=color: red; font-weight: bold; font-style: normal;
| text      = The message body text.
}}
</pre>
 
{{dmbox
| type      = setindex
| image    = {{nowrap| [[Image:Schooner.svg|30px]] [[Image:DAB list gray.svg|30px]] }}
| textstyle=color: red; font-weight: bold; font-style: normal;
| text      = The message body text.
}}
 
 
Some other parameter combinations:
 
{{dmbox
| text  = No type and no image given ('''default''')
}}
{{dmbox
| image = none
| text  = No type and '''image=none''' – No image is used and the '''text''' uses the whole message box area.
}}
 
{{dmbox
| type = setindex
| imageright = [[Image:Schooner.svg|33px]]
| text  = type = setindex <br> imageright = <nowiki>[[Image:Schooner.svg|33px]]</nowiki>
}}
 
{{dmbox
| type = setindex
| imageright = [[Image:Schooner.svg|33px]]
| text  =
This article includes a [[Wikipedia:WikiProject Ships/Guidelines#Index pages|list of ships]] with the same or similar names. If an [[Special:Whatlinkshere/{{NAMESPACE}}:{{PAGENAME}}|internal link]] for a specific ship referred you to this page, you may wish to change the link to point directly to the intended ship article, if one exists.
}}
 
=== Parameters ===
List of all parameters:
 
<pre>
{{dmbox
| type  = disambig / setindex
| image = none / [[Image:Some image.svg|40px]]
| imageright = [[Image:Some image.svg|40px]]
| style=CSS values
| textstyle=CSS values
| text  = The message body text.
| nocat = {{{nocat|}}} / true
}}
</pre>
 
{{Para|type}}
:If no {{Para|type}} parameter is given the template defaults to type {{code|disambig}}.
:{{code|disambig}} = Makes it so the {{tl|disambig editintro}} is displayed when editing a page with this template on. (Means that this template internally sets the CSS id "disambigbox". The id is used by the javascript in [[MediaWiki:Common.js]] to determine if a page is a disambiguation page or not.) And adds [[:Category:All disambiguation pages]] and [[:Category:All article disambiguation pages]].
 
:{{code|setindex}} = Does ''not'' trigger the {{tl|disambig editintro}} when editing a page. (Because this instead sets the CSS id "setindexbox".) And adds [[:Category:All set index articles]].
 
{{Para|nocat}}
:{{code|true}} = [[Wikipedia:Category suppression|Stops this template from categorizing]]. Useful for tests and demonstrations. Dmbox templates should forward{{when defined as}} {{para|nocat}}, so they too have the option to suppress categories. Thus, it is recommended that Dmbox templates always add something similar to this:
::<code><nowiki>nocat = {{{nocat|}}}</nowiki></code>
 
{{Para|image}}
:''<span style="color:gray">[No parameter]</span>'' = If no {{Para|image}} parameter is given, the template uses the default {{para|disambig}} or {{para|setindex}} image, depending on the {{Para|type}} parameter.
:''An image'' = Should be an image with usual wiki notation. 30px - 50px width are usually about right depending on the image height to width ratio. (But the message box can handle images of any size.) For example:
::<code><nowiki>image = [[Image:Schooner.svg|30px]]</nowiki></code>
:<code>none</code> = Means that no image is used.
 
{{Para|imageright}}
:'''No parameter''' = If no {{Para|imageright}} parameter is given then no image is shown on the right side.
:'''An image''' = Should be an image with usual wiki notation. 30px - 50px width are usually about right depending on the image height to width ratio. (But the message box can handle images of any size.) For example:
::<code><nowiki>imageright = [[Image:Nuvola apps bookcase.png|40px]]</nowiki></code>
:'''Anything''' = Any other object that you want to show on the right side.
 
{{Para|style}}
:Optional [[Cascading Style Sheets|CSS]] values used by the entire message box table. Without quotation marks <code>" "</code> but with the ending semicolons <code>;</code>. For example:
::<code>style=margin-bottom: 0.2em;</code>
 
{{Para|textstyle}}
:Optional [[Cascading Style Sheets|CSS]] values used by the text cell. For example:
::<code>textstyle=text-align: center;</code>
 
{{Para|text}}
:The message body text. This message box has ''italic'' text as default, thus no need to manually set that.
 
=== Technical details ===
This template currently uses hard coded styles and class names. Later it will only use CSS classes making it easier to skin. (In the meantime it can be skinned by using the "<code>!important</code>" keyword.)
 
If you need to use special characters in the text parameter then you need to escape them like this:
 
<pre>
{{dmbox
| text  = <div>
Equal sign = and a start and end brace { } work fine as they are.
But here is a pipe {{!}} and two end braces &lt;nowiki>}}&lt;/nowiki>.
And now a pipe and end braces &lt;nowiki>|}}&lt;/nowiki>.
</div>
}}
</pre>
 
{{dmbox
| text  = <div>
Equal sign = and a start and end brace { } work fine as they are.
But here is a pipe {{!}} and two end braces <nowiki>}}</nowiki>.
And now a pipe and end braces <nowiki>|}}</nowiki>.
</div>
}}
 
 
Internally, this meta-template uses HTML markup instead of wiki markup for the table code. That is the usual way we make meta-templates since wiki markup has several drawbacks. For instance it makes it harder to use [[m:Help:ParserFunctions|parser functions]] and special characters in parameters.
 
For more technical details see the [[Template talk:Dmbox|talk page]]. Since this template works almost exactly like {{tl|ambox}}, {{tl|tmbox}}, {{tl|imbox}}, {{tl|cmbox}} and {{tl|ombox}} their talk pages and related pages might also contain more details.
 
===See also===
{{Mbox templates see also}}
 
Other pages:
* [[Wikipedia:Disambiguation]], which includes a section explaining [[Wikipedia:Disambiguation#Set index articles|set index articles]].
* [[Wikipedia:WikiProject Disambiguation]]
* [[MediaWiki:Disambiguationspage]], where all disambiguation message boxes should be listed to assist automatic tools' identification of disambiguation pages. Now also has a separate list with all set index message boxes, so some tools can know what pages are set index articles.
* {{tl|Disambiguation}}, the generic disambiguation message box.
* {{tl|Set index article}}, the generic set index article message box.
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox |
| <!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Disambiguation message boxes| ]]
[[Category:Set index article templates| ]]
[[Category:Mbox and messagebox templates]]
}}</includeonly>

Revision as of 15:56, 15 October 2018

Welcome, modders! This page is intended to be a collection of useful information for anybody who wants to create mods. If you want to simply use other people's mods, see Help:Using mods.

Getting set up

To make mods, you'll need to start by dumping the unedited game files from your copy of BotW.

Files, Tools and Tutorials

Since BotW uses a lot of Nintendo's own file formats, you'll need tools to be able to edit them. To use leoetlino's tools, you need to install the latest version of Python (64 bit version), and tick the "Add to PATH" / "Add to environment variables" box in the installer. Then, to install the tool, run pip install TOOL_NAME in the command line.

If you're not sure which tool to use on a file, search for its extension on this wiki to find what file format that extension is used for.

Yaz0 compression

Many files in the game are compressed with Yaz0 compression. Compressed files generally have the letter s prefixed to their file extension. To decompress and recompress these files, use wszst (install with pip install wszst-yaz0).

  • wszst decompress INPUT_FILE.sbactorpack OUTPUT_FILE.bactorpack
  • wszst compress INPUT_FILE.bfres OUTPUT_FILE.sbfres

SARC archives

SARC archives contain collections of other files and folders, like .zip folders. Unpack, edit and re-pack them with leoetlino's sarc tool. This tool automatically decompresses Yaz0-encoded archives, and re-compresses them when you repack if the extension starts with an s.

  • sarc extract INPUT_FILE.pack
  • sarc create [-b] INPUT_FOLDER OUTPUT_FILE.sbactorpack (Use -bfor Wii U only).

BYML files

BYML files contain game parameters. Convert them to an editable format (and back) with leoetlino's byml tool. This tool automatically decompresses Yaz0-encoded files, and re-compresses them if the extension starts with an s.

  • byml_to_yml INPUT_FILE.byml OUTPUT_FILE.yml
  • yml_to_byml [-b] INPUT_FILE.yml OUTPUT_FILE.sbyml (Use -b for Wii U only).

AAMP files

AAMP files also contain game parameters. Convert them to an editable format (and back) with leoetlino's aamp tool. Unlike most other files, AAMP files are exactly the same on both Wii U and Switch.

  • aamp_to_yml INPUT_FILE.bxml OUTPUT_FILE.yml
  • yml_to_aamp INPUT_FILE.yml OUTPUT_FILE.bgparamlist

BFRES files

BFRES files contain the game's models and textures. Tutorials on how to edit these for Wii U can be found in Fooni's Tutorials.

  • .sbfres files contain models.
  • .Tex1.sbfres files contain textures (Wii U).
  • .Tex2.sbfres files contain mipmaps for textures (Wii U). Since we can't edit these on Wii U yet, they need to be disabled.
  • .Tex.sbfres files contain both textures and mipmaps (Switch). Unlike on Wii U, mipmaps don't cause any problems here.

Rules

The RSTB file

The file ResourceSizeTable.product.rsizetable (referred to as the RSTB file) contains a list of size limits for almost every file in the game (calculated from the non-Yaz0-compressed file sizes). If you edit a file to make its filesize bigger, you'll need to edit this file to prevent errors. For details, see Help:Editing the RSTB.

File names and caching

The game assumes that any 2 files with the exact same filename also have the exact same contents. If you don't follow this rule when editing files, the game might load the wrong version of the file, leading to errors.