16,532
editsMore actions
no edit summary
No edit summary |
|||
(40 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
|description=This page is a hub for everything related to Modding Baldur's Gate 3. Check out the following guides to learn how to mod BG3. | |description=This page is a hub for everything related to Modding Baldur's Gate 3. Check out the following guides to learn how to mod BG3. | ||
|image=Modding_resources.webp | |image=Modding_resources.webp | ||
}}{{ | }}{{Modding box}}{{Modding sidebar}} | ||
Welcome to the file setup portion of making a hair mod. For an overview of all the steps, see [[Modding:Creating Hair Mods]]. | |||
Welcome to the file setup portion of making a hair mod. | |||
== Tools You'll Need == | == Tools You'll Need == | ||
* [https://github.com/ShinyHobo/BG3-Modders-Multitool BG3 Modders Multitool] (required) | * [https://github.com/ShinyHobo/BG3-Modders-Multitool BG3 Modders Multitool] (required) | ||
* [https:// | * [https://bg3.wiki/wiki/Modding:BG3_Mini_Tool BG3 Mini Tool] (optional but helpful) | ||
* [https://www.nexusmods.com/baldursgate3/mods/437 Padme's Hair Template] (required unless you have a template from somewhere else) | * [https://www.nexusmods.com/baldursgate3/mods/437 Padme's Hair Template] (required unless you have a template from somewhere else) | ||
* [https://code.visualstudio.com/ VSCode] or [https://notepad-plus-plus.org/ Notepad++] (required) | * [https://code.visualstudio.com/ VSCode] or [https://notepad-plus-plus.org/ Notepad++] (required) | ||
Line 28: | Line 27: | ||
=== What are autosnapping and non autosnapping hairs? === | === What are autosnapping and non autosnapping hairs? === | ||
Autosnapping hairs are basically when you have an asset you want to work for more than one race/bodyshape/bodytype, but don't want to make a mesh for every single variation. So when setup to be autosnapping, you can apply one mesh to be used by multiple races/bodyshapes/bodytypes. And the game "autosnaps" them into place using a series of "sockets" that the hair is weighted to. | {{CollapsibleOnDesktop|Autosnapping hairs are basically when you have an asset you want to work for more than one race/bodyshape/bodytype, but don't want to make a mesh for every single variation. So when setup to be autosnapping, you can apply one mesh to be used by multiple races/bodyshapes/bodytypes. And the game "autosnaps" them into place using a series of "sockets" that the hair is weighted to. | ||
Sometimes you may still need three autosnapping meshes, one for the shorter races, one for the default bodytype and one for the strong bodytype. However we will go through when this is needed further into the tutorial. | |||
Non autosnapping is when the game doesn't snap the hair into place at all. So, you have to create your hair mesh for each race/bodyshape/bodytype that you want it to be usable for. Obviously, this takes more work, but it can often give better/less crunchy results than autosnapping, and it is much easier to manually weight a non-autosnapping hair than an autosnapping hair. For instance, for personal use hairs, you might decide you only want it for one character. Then non autosnapping might be the way to go.|collapsed=Autosnapping hairs are basically when you have an asset you want to work for more than one race/bodyshape/bodytype, but don't want to make a mesh for every single variation. So when setup to be autosnapping, you can apply one mesh to be used by multiple races/bodyshapes/bodytypes. And the game "autosnaps" them into place using a series of "sockets" that the hair is weighted to. | |||
Sometimes you may still need three autosnapping meshes, one for the shorter races, one for the default bodytype and one for the strong bodytype. However we will go through when this is needed further into the tutorial. | Sometimes you may still need three autosnapping meshes, one for the shorter races, one for the default bodytype and one for the strong bodytype. However we will go through when this is needed further into the tutorial. | ||
Non autosnapping is when the game doesn't snap the hair into place at all. So, you have to create your hair mesh for each race/bodyshape/bodytype that you want it to be usable for. Obviously, this takes more work, but it can often give better/less crunchy results than autosnapping, and it is much easier to manually weight a non-autosnapping hair than an autosnapping hair. For instance, for personal use hairs, you might decide you only want it for one character. Then non autosnapping might be the way to go.}} | |||
Non autosnapping is when the game doesn't snap the hair into place at all. So, you have to create your hair mesh for each race/bodyshape/bodytype that you want it to be usable for. Obviously, this takes more work, but it can often give better/less crunchy results than autosnapping, and it is much easier to manually weight a non-autosnapping hair than an autosnapping hair. For instance, for personal use hairs, you might decide you only want it for one character. Then non autosnapping might be the way to go. | |||
== Following the Template == | == Following the Template == | ||
Following Padme's [https://www.nexusmods.com/baldursgate3/mods/437 | Following Padme's [https://www.nexusmods.com/baldursgate3/mods/437 template] (or using it as a guide to copy parts from the game files), follow along with this tutorial. | ||
If you are only adding an existing hair from the game to CC without wanting to do any edits, you can remove the Generated folder from your copy of the template and instead just link to the game's existing hair in the _merged. | |||
You may have downloaded the template, and now feel overwhelmed by all the files and folders, but it's really not too complicated. There are only four* files that we need to edit: loca.xml, meta.lsx, _merged.lsf.lsx and CharacterCreationAppearanceVisuals.lsx. You'll also need to place your .GR2 in the Generated folder, but more on that later. | |||
If | *If using the CharacterCreationSharedVisuals method, technically five files including Races.lsx. More on that later! | ||
Alternatively you can follow [https://youtu.be/dNLP6Lt_zFo?si=fmRVTUYBpF00s-Uc this video] by Bububull for the file setup if you want to use the CharacterCreationAppearanceVisuals method. | |||
== Mods/meta.lsx == | == Mods/meta.lsx == | ||
Remember to create your meta.lsx for your mod as well, as it is required for all pak mods. If using multitool to pack, you can create a Mods folder in your workspace folder and let multitool create the meta.lsx for you. Otherwise, follow this tutorial on how to create your meta.lsx: [[Modding:Creating meta.lsx|Creating your Meta.lsx]] | Remember to create your meta.lsx for your mod as well, as it is required for almost all pak mods. If using multitool to pack, you can create a Mods folder in your workspace folder and let multitool create the meta.lsx for you. Otherwise, follow this tutorial on how to create your meta.lsx: [[Modding:Creating meta.lsx|Creating your Meta.lsx]] | ||
== Localization/English/custom_name_here.loca.xml == | == Localization/English/custom_name_here.loca.xml == | ||
Line 53: | Line 58: | ||
Why is it named .loca.xml? This is because if you package the Main folder (also known as your workspace folder) with multitool, it will auto convert the .loca.xml to .loca. This way, you don't have to manually do the conversions yourself. However, if you prefer to do manual conversions, change the extension to .xml only. | Why is it named .loca.xml? This is because if you package the Main folder (also known as your workspace folder) with multitool, it will auto convert the .loca.xml to .loca. This way, you don't have to manually do the conversions yourself. However, if you prefer to do manual conversions, change the extension to .xml only. | ||
You can find the _merged file at: Localization/English/custom_name_here.loca.xml. | |||
Change custom_name_here to a custom name. It's best to add a personalized prefix beforehand so there is no chance of your mod name clashing with another mod. For example, Padme4000 uses her username, but shortened to P4. So for Padme's viking braid hair, her .loca.xml would be called p4_viking_braid.loca.xml | Change custom_name_here to a custom name. It's best to add a personalized prefix beforehand so there is no chance of your mod name clashing with another mod. For example, Padme4000 uses her username, but shortened to P4. So for Padme's viking braid hair, her .loca.xml would be called p4_viking_braid.loca.xml | ||
Line 70: | Line 77: | ||
Once you have multitool open, make sure to check the box next to Handle. Then you can click Generate for the tool to generate a new handle. Clicking on the box that has the handle inside will copy it to your clipboard so you can go to your file and paste it in. | Once you have multitool open, make sure to check the box next to Handle. Then you can click Generate for the tool to generate a new handle. Clicking on the box that has the handle inside will copy it to your clipboard so you can go to your file and paste it in. | ||
=== (Optional) Using mini tool to create/edit the .loca === | === [https://bg3.wiki/wiki/Modding:BG3_Mini_Tool#Using_mini_tool_to_create%2Fedit_the_.loca (Optional) Using mini tool to create/edit the .loca] === | ||
== Hair _merged.lsf == | == Hair _merged.lsf == | ||
Line 98: | Line 83: | ||
Next, let's look at _merged.lsf.lsx. What is this? It's the file where we tell the game where to locate our mesh in our mod, as well as other information it might need. | Next, let's look at _merged.lsf.lsx. What is this? It's the file where we tell the game where to locate our mesh in our mod, as well as other information it might need. | ||
Why is it called _merged.lsf.lsx? Similar to the .loca file, the multitool will automatically convert our _merged to .lsf file format, which it needs in order to be read by the game. | Why is it called _merged.lsf.lsx? Similar to the .loca file, the multitool will automatically convert our _merged to .lsf file format, which it needs in order to be read by the game. Of course, you can name it _merged.lsx if you want to convert it manually. | ||
You can find the _merged file at: Public\Autosnapping_Template\Content\Assets\Characters\[PAK]_Hair\_merged.lsf.lsx. | You can find the _merged file at: Public\Autosnapping_Template\Content\Assets\Characters\[PAK]_Hair\_merged.lsf.lsx. | ||
Line 161: | Line 146: | ||
<attribute id="ID" type="FixedString" value="955faf79-1707-4ea9-87f4-39a5fba49120" /> | <attribute id="ID" type="FixedString" value="955faf79-1707-4ea9-87f4-39a5fba49120" /> | ||
You want this line to have a unique UUID. Either use | You want this line to have a unique UUID. Either use the Multitool to generate a new uuid, or use an extension/plugin for your code editing program. | ||
<attribute id="Name" type="LSString" value="AT_Hair01" /> | <attribute id="Name" type="LSString" value="AT_Hair01" /> | ||
Line 184: | Line 169: | ||
This is the path to your hair .GR2 in your mod folders. | This is the path to your hair .GR2 in your mod folders. | ||
* Make sure to use / and not \ | * Make sure to use / and not \. Windows will automatically insert \ when copying the file path, so be careful. | ||
* | * Always start the path from your Generated folder. | ||
* | * Double check that your mesh's extension in the folder is .GR2 and not .gr2. It will not work if the file extension is lowercase. | ||
<attribute id="Template" type="FixedString" value="Generated/Public/Autosnapping_Template/[PAK]_Autosnapping_Template/AT_Test.Dummy_Root.0" /> | <attribute id="Template" type="FixedString" value="Generated/Public/Autosnapping_Template/[PAK]_Autosnapping_Template/AT_Test.Dummy_Root.0" /> | ||
This path is almost the same as above, so feel free to copy and paste your path from before to this line. | This path is almost the same as above, so feel free to copy and paste your path from before to this line. | ||
* Do not remove .Dummy_Root.0 from the line | * Do not remove .Dummy_Root.0 from the line. | ||
* | * This line does not need .GR2 at the end. You are linking to the Dummy_Root in the .GR2. | ||
<node id="AnimationWaterfall"> | <node id="AnimationWaterfall"> | ||
Line 217: | Line 202: | ||
<attribute id="MaterialID" type="FixedString" value="89b063ff-7bf3-44a8-7e7d-41b29d0dd469" /> | <attribute id="MaterialID" type="FixedString" value="89b063ff-7bf3-44a8-7e7d-41b29d0dd469" /> | ||
This defines the MaterialID, or the texture of your hair (straight, wavy, curly, etc). Usually you want the same material as the hair you used for that part. If the different parts are using the same materials, you can keep this the same for each new section you make. | This defines the MaterialID, or the texture of your hair (straight, wavy, curly, etc). Usually you want the same material as the hair you used for that part. If the different parts are using the same materials, you can keep this the same for each new section you make. See https://bg3.wiki/wiki/Modding:Hair_Meshes for a list of all vanilla hair MaterialIDs. | ||
When making a new section, make sure to also update "_Mesh.0" by increasing the number by 1. | |||
For example: | For example: | ||
Line 244: | Line 229: | ||
and so on. | and so on. | ||
If you want to set up a custom texture for your hair, see [[Creating hair merged.lsf with custom texture]] | If you want to set up a custom texture for your hair, see [[Creating hair merged.lsf with custom texture]] | ||
Line 263: | Line 242: | ||
For autosnapping hairs, we can use either CharacterCreationSharedVisuals.lsx or CharacterCreationAppearanceVisuals.lsx. For non autosnapping, use only CharacterCreationAppearanceVisuals.lsx. | For autosnapping hairs, we can use either CharacterCreationSharedVisuals.lsx or CharacterCreationAppearanceVisuals.lsx. For non autosnapping, use only CharacterCreationAppearanceVisuals.lsx. | ||
You can use Padme's mini tool to help create the CharacterCreationAppearanceVisuals.lsx file, as well as its slots. Or, alternatively, use the file in this template to do it manually. | You can use [https://bg3.wiki/wiki/Modding:BG3_Mini_Tool Padme's mini tool] to help create the CharacterCreationAppearanceVisuals.lsx file, as well as its slots. Or, alternatively, use the file in this template to do it manually. | ||
Why would we want to use CharacterCreationAppearanceVisuals (CCAV) vs CharacterCreationSharedVisuals (CCSV)? Well, CCSV is a lot easier to set up, file-wise. However, it is incompatible with other mods that edit the same files. Unless you plan on using Compatibility Framework, we recommend sticking with CCAV for both types of hair. | Why would we want to use CharacterCreationAppearanceVisuals (CCAV) vs CharacterCreationSharedVisuals (CCSV)? Well, CCSV is a lot easier to set up, file-wise. However, it is incompatible with other mods that edit the same files. Unless you plan on using Compatibility Framework, we recommend sticking with CCAV for both types of hair. | ||
Line 269: | Line 248: | ||
'''Important note: CharacterCreationAppearanceVisuals and CharacterCreationSharedVisuals should be .lsx format, not .lsf or .lsf.lsx format. If you use .lsf.lsx format, the multitool will convert to .lsf and then the game will not know how to read them.''' | '''Important note: CharacterCreationAppearanceVisuals and CharacterCreationSharedVisuals should be .lsx format, not .lsf or .lsf.lsx format. If you use .lsf.lsx format, the multitool will convert to .lsf and then the game will not know how to read them.''' | ||
== CharacterCreationAppearanceVisuals == | === CharacterCreationAppearanceVisuals === | ||
<node id="CharacterCreationAppearanceVisual"> | <node id="CharacterCreationAppearanceVisual"> | ||
<attribute id="BodyShape" type="uint8" value="0" /> | <attribute id="BodyShape" type="uint8" value="0" /> | ||
Line 281: | Line 259: | ||
</node> | </node> | ||
Okay, let's break this down into sections: | |||
<attribute id="BodyShape" type="uint8" value="0" /> | <attribute id="BodyShape" type="uint8" value="0" /> | ||
This line defines which body shape the hair is for. | |||
* 0 = Standard | * 0 = Standard | ||
* 1 = Tall Muscular | * 1 = Tall Muscular | ||
* | * For Half-Orcs, even though they use Tall Muscular bodyshape, this value needs to be 0 | ||
<attribute id="BodyType" type="uint8" value="1" /> | <attribute id="BodyType" type="uint8" value="1" /> | ||
Line 294: | Line 273: | ||
<attribute id="RaceUUID" type="guid" value="0eb594cb-8820-4be6-a58d-8be7a1a98fba" /> | <attribute id="RaceUUID" type="guid" value="0eb594cb-8820-4be6-a58d-8be7a1a98fba" /> | ||
The template is currently set up for the race uuid being Human. You will find the other Race UUID's at the bottom of this file on | The template is currently set up for the race uuid being Human. You will find the other Race UUID's at the bottom of this file on Padme's template or alternatively you can check them [[https://bg3.wiki/wiki/Modding:Race UUID|here]]. | ||
<attribute id="SlotName" type="FixedString" value="Hair" /> | <attribute id="SlotName" type="FixedString" value="Hair" /> | ||
This tells the game you are adding the asset to a hair slot in character creation. | This tells the game you are adding the asset to a hair slot in character creation. This is where you would change the designation if you were making a beard for example. | ||
<attribute id="UUID" type="guid" value="d6663db9-f572-4f81-b9a2-fcac96149abe" /> | <attribute id="UUID" type="guid" value="d6663db9-f572-4f81-b9a2-fcac96149abe" /> | ||
This must be a unique uuid | This must be a unique uuid. | ||
<attribute id="VisualResource" type="guid" value="d1f51daa-5fc0-446e-92d0-318c187d2ece" /> | <attribute id="VisualResource" type="guid" value="d1f51daa-5fc0-446e-92d0-318c187d2ece" /> | ||
This must match the ID line in the Hairs _merged file that we created. | |||
==== [https://bg3.wiki/wiki/Modding:BG3_Mini_Tool#Using_Minitool_to_create_your_CharacterCreationAppearanceVisuals (Optional) Using Minitool to create your CharacterCreationAppearanceVisuals] ==== | |||
=== CharacterCreationSharedVisuals === | |||
Remember that you need your hair to be autosnapping to work properly in this section. | Remember that you need your hair to be autosnapping to work properly in this section. | ||
Line 515: | Line 357: | ||
This one from the our sharedvisuals file. When you've finished adding the entries you want to add the races.lsx is ready to go. | This one from the our sharedvisuals file. When you've finished adding the entries you want to add the races.lsx is ready to go. | ||
If you wish to use [[Modding:Compatibility Framework]] see that guide on how to use it as an alternative to Races.lsx. However we suggest you use both in order to not rule out your Mac users from using your mods. | |||
== When to use three or more meshes for autosnapping hairs == | |||
Do you notice your autosnapping hair looks good on default bodies, but doesn't work quite right for the shorter or taller bodyshapes? | |||
This is where you would make several autosnapping hairs. Each variation needs its own VisualBank entry in your merged.lsf file. | |||
So if your hair has issues on different bodyshapes, you can do what Larian did and make several. | |||
*One made around a dwarven head. | |||
** this would be for Gnomes, Halflings and Dwarves | |||
*One made around the default Elf height. | |||
** this would be for Elves, Drow, Humans, Half Elves/Drow, Githyanki and Tieflings | |||
*One for Taller bodyshapes. | |||
** this would be for Strong Elves, Drow, Humans, Half Elves/Drow, Tieflings and Half Orcs | |||
If you still get issues on Tiefling heads then you might want to use Tiefling masc heads as a base for your default and tall height. You can make as many autosnapping variants as you need, but usually three will be enough. | |||
Once you have these set up and have made the visualbank entries, you can then make the additional edits to your CharacterCreationAppearanceVisuals or CharacterCreationSharedVisuals. | |||
=== CharacterCreationAppearanceVisuals === | |||
If using CharacterCreationAppearanceVisuals, change the VisualResourceID to the new ones in the correct slots you made previously for testing the mod, as you should have all the vanilla race and bodyshapes available from your first creation of the file. | |||
=== CharacterCreationSharedVisuals === | |||
If using CharacterCreationSharedVisuals, you want to make new entries with these options. And in races.lsx instead of using Humanoid/Fey/Fiend/Celestial you want to use the race sections of the races the hairs will work on. | |||
* For the Dwarven height, add to Gnomes, Halflings and Dwarves | |||
* For the default height, add to Elves, Drow, Humans, Half Elves/Drow, Githyanki and Tieflings | |||
* For the taller height, add to Strong Elves, Drow, Humans, Half Elves/Drow, Tieflings and Half Orcs | |||
== Troubleshooting == | |||
Here are some common hair issues and how to troubleshoot them. | |||
'''My hair doesn’t show up at all, there’s not even a slot in Character Creation!''' | |||
Check your CharacterCreationAppearanceVisuals or CharacterCreationSharedVisuals, as that is where the CC slots are defined. | |||
'''My hair shows up as a slot, but when I select it, the hair is invisible!''' | |||
Check your hair _merged file, especially the file paths to your SourceFile and Template. Any inconsistency between this and the actual folders will result in the game not finding your mesh, and thus not loading it. Also note that folders must be separated by /, not \. E.g. Mod/Generated/Mod/Hair.GR2 | |||
{{Modding navbox}} | |||
[[Category: | [[Category:Hair modding]] |