Scheduled system upgrade on Sunday 21 April 2024 15:00-16:00 UTC - On that day, the wiki and other services might go down for 5-15 minutes.

Help:Adding items: Difference between revisions

Jump to navigation Jump to search
imported>Ginger
m (→‎Before we begin: Removed references to multiple methods)
imported>Ginger
(4 intermediate revisions by the same user not shown)
Line 78: Line 78:
**'''Do not change anything with "Havok" in the name as those point to data inside the hkcl file which we cannot change.''' Physics should work fine without changing data ''inside'' the <code>hkcl</code> file, as long as you do change the ''name'' of the <code>hkcl</code> file.
**'''Do not change anything with "Havok" in the name as those point to data inside the hkcl file which we cannot change.''' Physics should work fine without changing data ''inside'' the <code>hkcl</code> file, as long as you do change the ''name'' of the <code>hkcl</code> file.
*Inside <code>bxml</code>:
*Inside <code>bxml</code>:
**changing the line that says <code>ActorCaptureUser: !strRef [ActorName]</code> to the new actor name
**changing the line that says <code>ActorCaptureUser: [ActorName]</code> to the new actor name
**changing the line that says <code>GParamUser: !strRef [ActorName]</code> to the new actor name
**changing the line that says <code>GParamUser: [ActorName]</code> to the new actor name
**changing the line that says <code>ModelUser: !strRef [ActorName]</code> to the new actor name
**changing the line that says <code>ModelUser: [ActorName]</code> to the new actor name
**changing the line that says <code>PhysicsUser: !StrRef [ModelName]</code> to the new model name[[File:Addingitems_bgparamlist.jpg|thumb|Example of two parameters commonly changed, inside the bgparamlist file.]]
**changing the line that says <code>PhysicsUser: [ModelName]</code> to the new model name[[File:Addingitems_bgparamlist.jpg|thumb|Example of two parameters commonly changed, inside the bgparamlist file.]]
*Inside <code>bgparamlist</code>:
*Inside <code>bgparamlist</code>:
**If your armor is upgradeable, changing the line that says <code>NextRankName: [ActorName]</code> to the actor name for the actor that this one upgrades into. (In game terms, "upgradeable" means via the Great Fairies)
**If your item is an armor that is upgradeable, changing the line that says <code>NextRankName: !str64 [ActorName]</code> to the actor name for the actor that this one upgrades into. (In game terms, "upgradeable" means via the Great Fairies. If your armor is not upgradable, put <code>!str64</code>  noting the extra space after the 4)
**The <code>bgparamlist</code> file also 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 inside the <code>bgparamlist</code> file 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).
**The <code>bgparamlist</code> file also 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 inside the <code>bgparamlist</code> file 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).


Line 141: Line 141:


===Creating the save game data flags===
===Creating the save game data flags===
'''You should ignore this section if you are making an armor or something that never goes into Link's inventory.'''
This section covers the save game flags, which the game uses to remember whether or not you've picked up an item before. If you are adding a common item, like a material or consumable, this will make it so that the little popup that happens the first time you pick up an item, doesn't happen every single time you pick your new item up.
This section covers the save game flags, which the game uses to remember whether or not you've picked up an item before. If you are adding a common item, like a material or consumable, this will make it so that the little popup that happens the first time you pick up an item, doesn't happen every single time you pick your new item up.


Navigate to <code>content\Pack\Bootup.pack\GameData\gamedata.ssarc</code> and find the flag for your base game item. It might be contained in any of the <code>bool_data_#.bgdata.yml</code> files. The name you are looking for is <code>IsGet_[OldActorName]</code>.
Navigate to <code>content\Pack\Bootup.pack\GameData\gamedata.ssarc</code> and find the flag for your base game item. It might be contained in any of the <code>bool_data_#.bgdata.yml</code> files. The name you are looking for is <code>IsGet_[OldActorName]</code>.
[[File:Addingitems_crc32hashpython.png|thumb|After running the python command, copy the underlined result to use as your HashValue]]
[[File:Addingitems_crc32hashpython.png|thumb|After running the python command, copy the underlined result to use as your HashValue]]
Copy the entire section for the flag into the space right after that flag. Change <code>IsGet_[OldActorName]</code> to <code>IsGet_[NewActorName]</code>. Then, open a new Powershell window anywhere. Use the command <code>python</code> to enter a python command line. Run the command <code>import ctypes; import binascii; ctypes.c_int32(binascii.crc32('''IsGet_[NewActorName]''')).value</code> to obtain a positive or negative number. (Bolding has been added to distinguish the name of the flag. You need to use the actual name of the flag you're adding.)
Copy the entire section for the flag into the space right after that flag. Change <code>IsGet_[OldActorName]</code> to <code>IsGet_[NewActorName]</code>. Then, open a new Powershell window anywhere. Use the command <code>python</code> to enter a python command line. Run the command <code>import ctypes; import binascii; ctypes.c_int32(binascii.crc32(b''''IsGet_[NewActorName]'''<nowiki/>')).value</code> to obtain a positive or negative number. (Bolding has been added to distinguish the name of the flag. You need to use the actual name of the flag you're adding.)
[[File:Addingitems_booldata0.jpg|thumb|Once you've copied the boolean data section, change the DataName and HashValue to match your new item.]]
[[File:Addingitems_booldata0.jpg|thumb|Once you've copied the boolean data section, change the DataName and HashValue to match your new item.]]
In your text editor, paste the result from your calculator into the <code>HashValue</code> after <code>IsGet_[NewActorName]</code>, and save the file.
In your text editor, paste the result from your calculator into the <code>HashValue</code> after <code>IsGet_[NewActorName]</code>, and save the file.


===Finishing up and installing the mod===
===Finishing up and installing the mod===
Line 155: Line 158:


==Troubleshooting==
==Troubleshooting==
{{Empty section}}
 
=== My actor isn't appearing in the game! ===
Make sure the actor's info entry (part 5 of the tutorial) is correct. Formatting is important here. It's also important to make sure your actor's name is valid. If it isn't, the game won't know what to do with it, so it won't create it. For example, weapons need to be named <code>Weapon_[WeaponProfile]_[AnythingElseYouWant]</code>, while armors need to be named <code>Armor_[ThreeDigitNumber]_[AnythingElseYouWant]_[Head/Upper/Lower]</code> (Except <code>Armor_001_Head</code> or <code>Armor_001_G_Head</code> both work, but <code>Armor_001__Head</code> doesn't because it has two underscores between 001 and Head)
 
=== My weapon/armor actor is appearing in my inventory, but it doesn't equip and disappears if I try to drop it from my inventory! ===
This one's difficult: Something, somewhere, in the actor or in one of the resource files, is broken. It could be just about anything except for the text and flags. Whenever the game encounters something it doesn't expect, it silently fails and doesn't create the actor, but doesn't tell you why. There isn't really any better way to pinpoint what could be causing the issue.
 
=== My game is crashing when loading the item! ===
Another difficult one, but typically this is because the way you placed the item in the world (which is not covered by this tutorial) was wrong, or, if it's crashing when equipping it (if an item) or when loading it into the world (if it's a field object), it's because the model is broken. Check the model replacement tutorial for info on the "vertex buffers" and what to do about them.
 
=== My game is crashing after shaders compile! ===
Depending on how many mods you have installed, the number of game data flags your game has can cause it to crash. The game loads all flags into a special section of memory when booting up, and if too many flags are loaded, the game doesn't have enough spare memory to load other things, and crashes. The Wii U version is limited to about 650 more flags than the vanilla game has. We don't know the limit of the Switch version, but we do know that it is much higher, due to the much larger amount of memory the Switch has.
[[Category:Guides]]
[[Category:Guides]]
Anonymous user

Navigation menu