Help:Adding items: Difference between revisions

Update for botw_actor_tool
(→‎Adding the actor info: Fix key instructions)
(Update for botw_actor_tool)
Line 1: Line 1:
Mods that deal with items will often edit items that already exist in the game. However, this can lead to conflicts between mods, so it is generally advised to make a new item, instead. This tutorial will cover all of the steps needed to add new items.
Mods that deal with items will often edit items that already exist in the game. However, this can lead to conflicts between mods, so it is generally advised to make a new item, instead. This tutorial will cover all of the steps needed to add new items.
Two methods are provided. Using BotW Actor Tool is much simpler, but it is in a beta state and may have bugs.


==Required tools==
==Required tools==
Adding new items requires several tools, most of which are described and are available [[Help:Setting up tools|here]].
Adding new items requires several tools, most of which are described and are available [[Help:Setting up tools|here]].


*[https://www.python.org/downloads/release/python-374/ Python 3.7] is necessary for just about every tool (Python 3.8 exists, but is not currently compatible with [[Help:Tools/aamp|aamp]] or [[Help:Tools/BCML|BCML]])
Both methods require the following:
*[https://www.python.org/downloads/release/python-379/ Python 3.7] (64-bit) is necessary for just about every tool (Python 3.8 exists, but is not currently compatible with [[Help:Tools/aamp|aamp]] or [[Help:Tools/BCML|BCML]])
*[https://github.com/KillzXGaming/Switch-Toolbox/releases Switch Toolbox]
*Breath of the Wild Cemu Mod Loader (or <code>bcml</code>) {{Install py package help|package=bcml}}
 
The new method requires:
*BotW Actor Tool {{Install py package help|package=botw_actor_tool}}
 
The old method requires:
*A text editor like [https://notepad-plus-plus.org/downloads/ Notepad++]
*A text editor like [https://notepad-plus-plus.org/downloads/ Notepad++]
*Wild Bits {{Install py package help|package=wildbits}}
*Wild Bits {{Install py package help|package=wildbits}}
*Breath of the Wild Cemu Mod Loader (or <code>bcml</code>) {{Install py package help|package=bcml}}
*[https://github.com/KillzXGaming/Switch-Toolbox/releases Switch Toolbox]
*Hyrule Builder {{Install py package help|package=hyrule_builder}}
*Hyrule Builder {{Install py package help|package=hyrule_builder}}
*BOTW Flag Utilities {{Install py package help|package=botw_flag_util}}
*BOTW Flag Utilities {{Install py package help|package=botw_flag_util}}


==Tutorial==
==Using BotW Actor Tool==
 
===Creating a mod directory===
The folder structure is important, as BotW will only load files if they're in a certain location. To begin with, you will want to create a folder structure that looks like this:
 
*BreathOfTheWild_[MyAwesomeModName]
**content
***Actor*
****Pack*
***Model
***Pack*
***UI
****StockItem
 
Starred folders will be created by the actor tool if they don't already exist. Note that the folder names are case-sensitive.
 
===Setting up the tool===
Open a command prompt (WinKey + R, enter <code>cmd</code>) and use the command <code>botw_actor_tool</code> to open it.
 
If this is your first time using the actor tool, set your paths in the settings menu. If you set them wrong, the tool will warn you. They should be set as follows:
* Game directory should be the content folder of your base game dump. Example: <code>C:\Games\BotW\basegame\content</code>
* Update directory should be the content folder of your update dump. Example: <code>C:\Games\BotW\update\content</code>
* DLC directory should be the 0010 folder of your DLC dump. Example: <code>C:\Games\BotW\DLC\content\0010</code>
* Language should be set to the region and language you use. For example, USen is for United States English, while EUes is for European Spanish.
 
===Opening the base actor===
Use File -> Open Vanilla Actor to open a list of all actors from vanilla BotW. Pick the actor from the list that most closely matches your new desired item. (e.g. if you want to create a wooden shield, you would pick an actor for one of the base game's wooden shields)
 
Once the tool has loaded the actor data, click on the Model button in the Actor Property box at the top, then scroll to the bottom. There should be a single line that says <code>Folder</code>. Take note of what it says after that, as that is the name of the <code>sbfres</code> file that you will need in [[#Creating your item's resource files]]. Then switch back to the Actor Link tab by clicking on the Actor Link button in the Actor Property box.
 
===The Actor Link tab===
The Actor Link tab contains the name of your item, the names of the unique files your actor uses, plus some other tidbits. Click on the Actor Name field, and change the name to whatever new name you want, then hit the Apply button to the right of that text field.
 
Make sure your item's tags (at the bottom) are correct. The tag for a dyable armor is <code>ArmorDye</code>, the tag for a weapon that can have a picture taken for the compendium is <code>ZukanWeapon</code>, anything that can be equipped has the tag <code>CanEquip</code>, etc. If you make a change, make sure to hit the Apply button to the right before moving on.
 
===The General Param tab===
This tab contains most of the information about the stats of items. For example, a weapon/shield's durability, a weapon's damage, a shield's block rate, an armor's defense, an armor's set (and therefore set bonus) are all stored here. You may want to change some of these things. A comprehensive list of the things that can appear in this tab is available [[Bgparamlist|here]]. Commonly changed parameters include: <code>Life</code> (the durability of the item, in the <code>General</code> category), <code>Power</code> (a weapons' damage, in the <code>Attack</code> category), <code>DefenceAddLevel</code> (an armor's defense rating, in the <code>Armor</code> category)
 
If your item is an armor that is upgradable, change the line that says <code>NextRankName: !str64 [ActorName]</code> to the actor name for the actor that this one upgrades into. (In game terms, "upgradable" means via the Great Fairies. If your armor is not upgradable, put <code>!str64 ""</code>)
 
Make sure to click the save button at the bottom before moving on.
 
===The Model tab===
On this tab, there will be a line toward the bottom that says <code>Folder:</code>.
 
If your item is an armor piece, this may not match your new armor name. Be sure to check, and change it, if necessary. Note that, if you do need to change it for an armor, you should not include the <code>_Head</code>, <code>_Upper</code>, or <code>_Lower</code> as part of the new Folder.
 
Whether or not your item is an armor piece, take note of what the Folder field now says. This will be the name for your resource files.
 
If you changed anything, make sure to click the save button at the bottom before moving on.
 
===The Texts tab===
This tab contains the entries for what text will be shown by the game.
*If your item is a cookable that has more than one recipe result (like a mushroom skewer) then you should set the BaseName to what you want displayed for its name. Otherwise, the BaseName is not used.
*Set the Name to what you want your item to be named.
*Set the Desc to what you want the inventory to display as the description of your item, when you select it.
*If your item can have a picture taken of it and be put in the compendium, set the PictureBook to field to what you want the compendium summary of the item to be. This is often a copy of Desc.
 
Again, if you changed anything, make sure to click the save button at the bottom before moving on.
 
===Saving your item===
Click File -> Save, and then pick the <code>content</code> folder you created in the [[#Creating the mod directory]] step. The tool should freeze for a little less than 10 seconds while it packages all the item's data and saves all the necessary files. This should properly create <code>Actor/ActorInfo.product.sbyml</code>, <code>Pack/Bootup.pack</code>, <code>Pack/Bootup_XXxx.pack</code> (where XXxx is your region/language), and your item's <code>sbactorpack</code> file.
 
===Creating your item's resource files===
You'll need to copy the resources for the original item that you're modifying to your mod's <code>content\Model</code> folder. You will find the original resource files in your dumped UPDATE files (not the base game files), in the same location. (<code>content\Model</code>) The files you're looking for are the ones that whose names match the <code>Folder</code> field you took note of during the [[#Opening the base actor]] step. There should be two files, one with an <code>sbfres</code> extension (the model) and one with a <code>Tex.sbfres</code> extension. '''If you are modding for WiiU or Cemu, there are actually three files you will need: <code>sbfres</code>, <code>Tex1.sbfres</code>, and <code>Tex2.sbfres</code>. If <code>Tex1.sbfres</code> is not present in your UPDATE files, you will need to find it in your BASE GAME dumped files. This is the case for most, if not all, vanilla (non-DLC) items.'''
 
Once you have copied the old files to the new location, you need to rename them to whatever it said in the <code>Folder</code> field you took note of during [[#The Model tab]] step.
 
The bulk of the [[Help:Replacing models|model replacement]] and [[Help:Replacing textures|texture replacement]] is explained in the tutorials linked there. Once you've used those tutorials to replace the bulk of the data, we can change the names that BotW uses to refer to that data. All the rest of this section assumes that you have both <code>sbfres</code> files for your actor open in Switch Toolbox. (If on WiiU, you don't need to open the Tex2 file. Switch Toolbox will read its data whenever you open the Tex1 file, as long as they are in the same folder.)
 
The first thing to change is the <code>bfres</code> name. This did not happen automatically when you renamed the file. You can do this by clicking on the orange file labeled "FRES" on the left side, clicking on the name on the right side, and changing it.
 
Some important terms in modeling:
A "model" is the 3D data for a whole actor. The models are everything that is inside the <code>Models</code> folder inside the <code>sbfres</code> file.
An "object" is the 3D data for a piece of an actor. The objects are everything that is inside the <code>Objects</code> folders inside the <code>Models</code> folder.
A single model will be made up of one or more objects.
A "material" is the data the game uses to "paint" a model, so that it knows what color it is, how it reflects light, whether or not it's shiny or dull, etc. The materials are everything that is inside the <code>Materials</code> folders inside the <code>Models</code> folder.
A "texture" (or "map") is a single picture that contains color, light reflection, metallic, or other data for a material. Textures are contained separately, in the <code>Tex.sbfres</code> file. (<code>Tex1.sbfres</code> for WiiU/Cemu)
A material will consist of one or more textures, plus shader data. (The author of this tutorial doesn't even really understand shaders. Sorry.)
Each model will contain one or more materials. Each object will be assigned one material. A single material may be assigned to any number of objects.
 
The name of the model (inside the <code>Models</code> folder) is important, as the game will not load the actor if the model name doesn't match your item's actor name as you entered it in the actor tool! Object names can be arbitrary, but they generally follow the rule: <code>[ObjectName]__[MaterialName]</code> where <code>[ObjectName]</code> is whatever you want, and <code>[MaterialName]</code> is the name of the material assigned to it. Adhering to this naming convention is encouraged, so that if anyone else ever tries to reuse your files, they can make sense of them.
Click on the model name on the left side that you need to change. On the right side, near the top, the model name will be displayed. Click on that to edit it, and change it to your new mesh name that you used in the actor pack and actor info files. If successful, it will also change on the left side.
You may also change the names of the objects and materials in the same way.
When changing the names of the materials, on the right side, there will be a tab labeled Textures that will be selected by default. It will contain the names of all the textures being used by that material, and these will all be the names of the old textures. Switch over to the texture <code>sbfres</code> now, and change all the textures to names that fit your new actor.
When you are done changing all the names of the textures, switch back to the model <code>sbfres</code> and look at the Textures section of the material. Click on one of the entries in the table (for example, <code>[OldModelName]_Alb</code>) and then click on Edit. A new window will pop up, with a list of all the textures contained in the texture <code>sbfres</code>. Choose the one that corresponds with the new texture (for example, <code>[NewModelName]_Alb</code> or <code>[NewModelName]_Alb.0</code>) and click save. Do this for all the entries in the Textures table for this material, and then repeat the process for every other material.
 
If you are editing an armor that is dyeable, you then need to expand the Animations folder on the left, then Texture Pattern Animations, then right-click the folder that corresponds to your item (Head for the head, Upper for the torso, Lower for the legs). Select Export, select to save as "Yet Another Markup Language" (or YAML Ain't Markup Language, if it's been since changed to the official name) and save it somewhere. Open the new <code>yaml</code> file that you just saved in a text editor. You will need to edit all the texture and material names to the new ones. For example, changing <code>[OldModelName]_Alb.0</code> to <code>[NewModelName]_Alb.0</code> and <code>[OldMaterialName]</code> to <code>[NewMaterialName]</code> (e.g. <code>Mt_Hood_001</code> to <code>Mt_Hood_9001</code>). Save it, then, back in Switch Toolbox, right-click on the folder inside Texture Pattern Animations that corresponds to your item, and select Replace. Select the <code>yaml</code> you edited.
 
When you are done, select any file or folder from the model <code>sbfres</code>, in the list on the left, and save it. Switch Toolbox will ask if you want to Yaz0 compress the file, click Yes. Then click on any file or folder from the texture <code>sbfres</code>, in the list on the left, and save it. Switch Toolbox will again ask if you want to Yaz0 compress the file, click Yes. If you are editing a WiiU texture <code>sbfres</code>, it will then ask you to save the Tex2 sbfres, so save it and Yaz0 compress it, as well. And that's it, you are done with the files that tell the game what the new item looks like.
 
===Creating an inventory icon===
This section covers the inventory icons, the square images you see in the inventory grid in the pause menu. These files are kept in <code>content\UI\StockItem</code> for inventory items. Copy the old <code>sbitemco</code> file for the item you are using as your foundation, to the same location in your mod files (<code>content\UI\StockItem</code>). An <code>sbitemco</code> file is pretty much the same thing as an <code>sbfres</code> for textures, so you will edit it the same way, using Switch Toolbox. Make sure to change the name of the file to <code>[NewActorName].sbitemico</code>, the name of the file it contains in Toolbox to <code>[NewActorName].bitemico</code>, and the texture it contains to <code>[NewActorName]</code>
 
===Installing the mod===
And now you are done! Basically! Use the directions located [[Help:Using_mods#Installing_mods_with_the_graphic_pack_menu|here]] to make a rules.txt if you haven't already. To use the mod, open <code>bcml</code> via command prompt (just run the command <code>bcml</code>) and click the blue circle in the bottom right. Then select Browse, select the rules.txt inside your <code>BreathOfTheWild_[MyAwesomeModName]</code> folder, and click Install. Wait for it to install, and you're ready to play the game with your new item!
 
==Using text editors and WildBits==


===Before we begin===
===Before we begin===
Line 153: Line 258:


===Installing the mod===
===Installing the mod===
And now you are done! Basically! Use the directions located [https://zeldamods.org/wiki/Help:Using_mods#Installing_mods_with_the_graphic_pack_menu here] to make a rules.txt if you haven't already. To use the mod, open <code>bcml</code> via Powershell (just run the command <code>bcml</code>) and select Install... Then select Add Folder, select the <code>BreathOfTheWild_[MyAwesomeModName]</code> folder, and click OK. Wait for it to install, and you're ready to play the game with your new item!
And now you are done! Basically! Use the directions located [[Help:Using_mods#Installing_mods_with_the_graphic_pack_menu|here]] to make a rules.txt if you haven't already. To use the mod, open <code>bcml</code> via Powershell (just run the command <code>bcml</code>) and select Install... Then select Add Folder, select the <code>BreathOfTheWild_[MyAwesomeModName]</code> folder, and click OK. Wait for it to install, and you're ready to play the game with your new item!


==Troubleshooting==
==Troubleshooting==
autopatrol, editnews
151

edits