Guide:Hair Mod File Setup: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 29: Line 29:


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 just link to the game hair instead.
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 just link to the game hair instead.
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]]


You can choose for your hairs to be autosnapping or non autosnapping.
You can choose for your hairs to be autosnapping or non autosnapping.
Line 45: Line 43:


You may have downloaded the tutorial and 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.
You may have downloaded the tutorial and 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.
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]]


== Localization/English/custom_name_here.loca.xml ==
== Localization/English/custom_name_here.loca.xml ==


Let's start with the loca.xml. This is the file that tells your game what text to display for your hair--aka the name of the hair in Character Creation. If this file is broken or doesn't exist, your hair will show up as "Not Found".
After you've sorted your meta.lsx, let's start with the loca.xml. This is the file that tells your game what text to display for your hair--aka the name of the hair in Character Creation. If this file is broken or doesn't exist, your hair will show up as "Not Found".


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.
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.
Line 72: Line 72:
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.


=== Using mini tool to create/edit the .loca ===
=== (Optional) Using mini tool to create/edit the .loca ===


So currently you have to open the localization editor via the CharacterCreationAppearanceVisuals buttons, and find the open localization button in there. For the next update it will be on the main page due to many types of mods needing it.
If you don't want to edit the .loca manually, you can use Padme's mini tool to do it for you! So currently you have to open the localization editor via the CharacterCreationAppearanceVisuals buttons, and find the open localization button in there. For the next update it will be on the main page due to many types of mods needing it.


This is what it looks like once open:
This is what it looks like once open:
Line 98: Line 98:
== Hair _merged.lsf ==
== Hair _merged.lsf ==


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.
 
You can find the _merged file at: Public\Autosnapping_Template\Content\Assets\Characters\[PAK]_Hair\_merged.lsf.lsx.


Public\Autosnapping_Template\Content\Assets\Characters\[PAK]_Hair\_merged.lsf.lsx this is where you will find our file in the Template
Here's an example _merged file:


         <region id="VisualBank">
         <region id="VisualBank">
Line 146: Line 150:
                         </node>
                         </node>


Let's go through the lines we want to change. Alternatively you can copy this whole section from the hair you used as a base/edit for your hair. Most hairs can be found in the file below, however if you can't find it there please use index search of multitool
Let's go through the lines we want to change. Alternatively, you can copy this whole section from the hair you used as a base/edit for your hair. Most hairs can be found in the file below, however if you can't find it there please use index search of multitool.


location to vanilla hairs merged when unpacked with Multitool. Multitool\UnpackedData\Shared\Public\Shared\Content\Assets\Characters\[PAK]_Hair
Vanilla hairs _merged when unpacked with Multitool. Multitool\UnpackedData\Shared\Public\Shared\Content\Assets\Characters\[PAK]_Hair


If you copied that whole section from the hair you used you can probably skip a few steps here but I will still go through them. If I skip a line this means you can keep that at the vanilla value.
If you copied that whole section from the hair you used, you can probably skip a few steps here, but we will still go through them. If a line is skipped, this means you can keep that at the vanilla value and you don't need to change anything.


                     <attribute id="BoundsMax" type="fvec3" value="0.1584038 1.846514 0.167948" />
                     <attribute id="BoundsMax" type="fvec3" value="0.1584038 1.846514 0.167948" />
Line 159: Line 163:
                     <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 multitool to generate a new uuid or an extension/plugin for your program. Such as those mentioned in the tools section of this page.
You want this line to have a unique UUID. Either use multitool to generate a new uuid, or use an extension/plugin for your code editing program. You will not need to repeat this UUID anywhere else.


                     <attribute id="Name" type="LSString" value="AT_Hair01" />
                     <attribute id="Name" type="LSString" value="AT_Hair01" />


You can give this any name you want in the value section. This is just an internal name.
You can give this any name you want in the value section. This is just an internal name. For sanity's sake, it might be best to name this after your loca.xml.


                     <attribute id="NeedsSkeletonRemap" type="bool" value="True" />
                     <attribute id="NeedsSkeletonRemap" type="bool" value="True" />


This line is what tells the game whether the asset in this case hair is autosnapping or not.
This line is what tells the game whether the hair is autosnapping or not.
* True = Autosnapping
* True = Autosnapping
* False = Non Autosnapping
* False = Non Autosnapping
Line 173: Line 177:
                     <attribute id="ScalpMaterialId" type="FixedString" value="55534266-4ce2-39d1-d2dd-04a8ec90e841" />
                     <attribute id="ScalpMaterialId" type="FixedString" value="55534266-4ce2-39d1-d2dd-04a8ec90e841" />


This line determines the scalp material your hair uses. Best to use the one your base hair used but feel free to play around to find the right one. (as of 24.11.23 some hairs in the game files don't have a scalp ID, larian is aware of this bug)
This line determines the scalp material your hair uses. It's basically what your hair would look like if it was cut extremely short. It's often best to use the one your base hair used, but feel free to play around to find the right one. (as of 24.11.23 some hairs in the game files don't have a scalp ID, larian is aware of this bug) You can use this spreadsheet to find the scalp IDs of most vanilla hairs: https://docs.google.com/spreadsheets/d/16cQUxQ7FrGVmIPy5929qae4cCQls4ZWuBX_w08zvv5M/edit


                     <attribute id="SkeletonResource" type="FixedString" value="78d8b5f0-726c-232f-a357-3d05c4b3b859" />
                     <attribute id="SkeletonResource" type="FixedString" value="78d8b5f0-726c-232f-a357-3d05c4b3b859" />
Line 211: Line 215:
                         </node>
                         </node>


This section defines the material for the parts that make up our mesh in the GR2. So if you have 3 mesh parts you want 3 of these sections. But you want this part
This section defines the material for the parts that make up our mesh in the GR2. So if you have 3 mesh parts, you want 3 of these sections.


                             <attribute id="MaterialID" type="FixedString" value="89b063ff-7bf3-44a8-7e7d-41b29d0dd469" />
                             <attribute id="MaterialID" type="FixedString" value="89b063ff-7bf3-44a8-7e7d-41b29d0dd469" />


The value here matching to the MaterialID so same line from the hair you used for that part. If they 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.


However when making a new section make sure to also update "_Mesh.0" by increasing the number by 1.
However when making a new section make sure to also update "_Mesh.0" by increasing the number by 1.
Line 232: Line 236:
                         </node>
                         </node>


In blender when you assigned the export order here:
In Blender, when you assigned the export order here:


[[File:Exportorder.webp]]
[[File:Exportorder.webp]]


Where this says 1 that in our merged is that first block so .0
Where this says 1, that in our merged is that first block so .0
* .0 = Export Order 1
* .0 = Export Order 1
* .1 = Export Order 2
* .1 = Export Order 2
Line 251: Line 255:
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]]


Congrats we have finished setting up this file!
Congrats, we have finished setting up this file!


== Character Creation Folder ==
== Character Creation Folder ==