Guide:Hair Mod File Setup: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
Line 507: Line 507:
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.


== Troubleshooting ==
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.
Here are some common hair issues and how to troubleshoot them.


== When to use three or more meshes for autosnapping Hairs ==


'''My hair doesn’t show up at all, there’s not even a slot in Character Creation!'''
As this generally comes up once you have tested one hair mesh in game, this is explained under the above sections. So do you notice your hair doesn't work quite right for the shorter bodyshapes? Or maybe you made it for Dwarves and it doesn't look quite right on the taller bodyshapes.


Check your CharacterCreationAppearanceVisuals or CharacterCreationSharedVisuals, as that is where the CC slots are defined.
This is when you would make several autosnapping hairs. Each variation needs its own VisualBank entry in your merged.lsf file.


'''My hair shows up as a slot, but when I select it, the hair is invisible!'''
So if it has issues on different bodyshapes you can do what Larian did and make several.


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
*One made around a dwarven head.
** this would be for Gnomes, Halfling and Dwarves
*One made around the default Elf height we first see when entering character creation.
** this would be for Elves, Drow, Humans, Half Elves/Drow, Githyanki and Tieflings
*One for Taller bodyshapes.
* this would be for Elves, Drow, Humans, Half Elves/Drow, Githyanki, Tieflings and Half Orcs


= Compatibility Framework =
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.
First big thank you to NellsRelo and perseidipity


To use the Compatibility Framework you need to install it alongside your mod. CF however needs to be at the bottom of the load order. So the bottom of the list. If you want to link just this part of the tutorial it has it's own page here [[Modding:Compatibility Framework]]
Once you have these set up and have made the visualbank entries you can then make the additional edits to your CharacterCreationAppearanceVisuals or CharacterCreationSharedVisuals.


== Json ==
=== CharacterCreationAppearanceVisuals ===
So this is considered the easier format to setup for using the Compatibility Framework in order to make your edits to the Races.lsx compatible with other mods. Partially due to reacting easier to multiple sections for defining each race and having multiple values.


You do not need to send anything to be added to the Compatibility Framework mod, just remember to have it at the bottom of your load order and if making a public mod to remind people CF goes to the bottom.
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.


So first you want to make some new folders:
=== CharacterCreationSharedVisuals ===


Modname/Mods/YourShared/ScriptExtender
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.
* So for the Dwarven version you want to add it to Gnomes, Halfling and Dwarves
* For the default height to Elves, Drow, Humans, Half Elves/Drow, Githyanki and Tieflings
* For the taller height the same as above + Half Orcs


In the Script extender folder you want to create a CompatibilityFrameworkConfig.json you can do this by creating a txt file and renaming it and its extension to CompatibilityFrameworkConfig.json
== Troubleshooting ==
Here are some common hair issues and how to troubleshoot them.


Using part of the code example we are given here: but edited.
'''My hair doesn’t show up at all, there’s not even a slot in Character Creation!'''
{
  "FileVersion": 1,
  "Races": [
    {
      "UUID": "Race's UUID",
      "Children": [
        {
          "Type": "Visuals",
          "modGuid": "UUID of required mod (Optional)",
          "Values": ["bdf9b779-002c-4077-b377-8ea7c1faa795", "3e4d5829-7bfd-446a-9e7d-ac8d0948c1e4"],
          "Action": "Insert"
        }
      ]
    }
  ]
}


      "UUID": "Race's UUID",
Check your CharacterCreationAppearanceVisuals or CharacterCreationSharedVisuals, as that is where the CC slots are defined.
In this line we want to change it to the race we are adding to in the Races.lsx file. The most commonly used one is Humanoid for hair/beard mods. Which is 899d275e-9893-490a-9cd5-be856794929f. This will apply it to all races including modded races if they use it as the parent. For others see [[Modding:Race UUID|here in the Races.lsx section]] for example if you want it only added to Humans and Elves your code would look like this.
{
  "FileVersion": 1,
  "Races": [
    {
      "UUID": "0eb594cb-8820-4be6-a58d-8be7a1a98fba", This being the Human races uuid
      "Children": [
        {
          "Type": "Visuals",
          "modGuid": "UUID of required mod (Optional)",
          "Values": ["bdf9b779-002c-4077-b377-8ea7c1faa795"],
          "Action": "Insert"
        }
      ]
    },
    {
      "UUID": "6c038dcb-7eb5-431d-84f8-cecfaf1c0c5a", This being the Elves races uuid
      "Children": [
        {
          "Type": "Visuals",
          "modGuid": "UUID of required mod (Optional)",
          "Values": ["bdf9b779-002c-4077-b377-8ea7c1faa795"],
          "Action": "Insert"
        }
      ]
    }
  ]
}
Now to continue explaining the other lines:
          "Type": "Visuals",
Visuals pertains to assets such as Hair, Beards, Tails, Horns and such. Pretty much the assets we add to SharedVisuals.
          "modGuid": "UUID of required mod (Optional)",
So as this line says it is optional, but personally I add it in. The UUID we add in the meta.
          "Values": ["bdf9b779-002c-4077-b377-8ea7c1faa795"],
This uuid has to match the one you gave for the UUID line in your CharacterCreationSharedVisuals. If you have multiple assets add a , after the final " and then make a new " " with your uuid in between for example from the first example given:
          "Values": ["bdf9b779-002c-4077-b377-8ea7c1faa795", "3e4d5829-7bfd-446a-9e7d-ac8d0948c1e4"],
Now we come to the last line:
          "Action": "Insert"
For the sake of SharedVisual mods we likely wouldn't change this line, however if you want to remove something instead of add something to a section in Races.lsx change Insert to Remove


Congrats you setup your mod for using the Compatibility Framework via json. Just remember always load Compatibility Framework at the bottom of your load order.
'''My hair shows up as a slot, but when I select it, the hair is invisible!'''


== Lua ==
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
This is a possible use of the Compatibility Framework though it is advised to use the json method instead. Both do not require adding anything directly to the framework, they will work alongside it out of the box.
 
So first you want to make some new folders:
 
Modname/Mods/YourShared/ScriptExtender/Lua
 
In the Script extender folder you want to create a Config.json you can do this by creating a text file and just renaming it and its extension Config.json. In the json you want:
{
    "RequiredVersion": 9,
    "ModTable": "YOUR_MOD_NAME_HERE",
    "FeatureFlags": ["Lua"]
}
Where it says YOUR_MOD_NAME_HERE, write the name of your mod.
 
Now in the Lua folder do the same again make a new txt file but this time rename it BootstrapClient.lua
if Ext.Mod.IsModLoaded("67fbbd53-7c7d-4cfa-9409-6d737b4d92a9") then
    local raceChildData = {
      ModName = {
        modGuid = "the UUID you gave in your meta.lsx",
        raceGuid = "899d275e-9893-490a-9cd5-be856794929f",
        children = {
        entry1 = {
            Type = "Visuals",
            Value = "3ae3e4fc-e792-473a-8853-43520dfc1147",
          },
      }
    }
}
    local function OnStatsLoaded()
      Mods.SubclassCompatibilityFramework.Api.InsertRaceChildData(raceChildData)
    end
 
    Ext.Events.StatsLoaded:Subscribe(OnStatsLoaded)
  end
 
        raceGuid = "899d275e-9893-490a-9cd5-be856794929f",
this you want to be the race you're adding your hair too. The one currently in there is humanoid. This will apply it to all races including modded races if they use it as the parent. For others see [[Modding:Race UUID|here]]
            Type = "Visuals",
This line is what you're adding to. Visuals is either Hair or Beards or other assets defined in the SharedVisuals file.
            Value = "3ae3e4fc-e792-473a-8853-43520dfc1147",
This uuid has to match the one you gave for the UUID line in your CharacterCreationSharedVisuals
 
If wanting to create more than one hair copy and paste this section:
        entry1 = {
            Type = "Visuals",
            Value = "3ae3e4fc-e792-473a-8853-43520dfc1147",
          },
Changing entry1 to entry2 and so on. You can also use entrya, entryb as well.
      Mods.SubclassCompatibilityFramework.Api.InsertRaceChildData(raceChildData)
Not fully related to this tutorial but just in case you come up with a use, swap out InsertRaceChildData for RemoveRaceChildData if you want to remove lines from the Races.lsx instead of adding.
 
Congrats you setup your mod for using the Compatibility Framework via lua. Just remember always load Compatibility Framework at the bottom of your load order.


{{Modding navbox}}
{{Modding navbox}}


[[Category:Modding guides]] [[Category:Hair modding]]
[[Category:Modding guides]] [[Category:Hair modding]]
381
edits

Navigation menu