Guide:Hair Mod File Setup: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
Line 249: Line 249:


You can use my 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 my 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.
=== CharacterCreationAppearanceVisuals ===


=== CharacterCreationSharedVisuals ===
=== CharacterCreationSharedVisuals ===
Line 257: Line 259:
                     <attribute id="DisplayName" type="TranslatedString" handle="h163f3e2e9f634634a5e41553265771e4" version="1" />
                     <attribute id="DisplayName" type="TranslatedString" handle="h163f3e2e9f634634a5e41553265771e4" version="1" />
                     <attribute id="SlotName" type="FixedString" value="Hair"/>
                     <attribute id="SlotName" type="FixedString" value="Hair"/>
                     <attribute id="UUID" type="guid" value="449e617f-8356-46e5-b740-9e4b18200441"/>
                     <attribute id="UUID" type="guid" value="3ae3e4fc-e792-473a-8853-43520dfc1147"/>
                     <attribute id="VisualResource" type="guid" value="fa926de0-feae-4218-806e-3d037b9d83d3"/>
                     <attribute id="VisualResource" type="guid" value="fa926de0-feae-4218-806e-3d037b9d83d3"/>
                 </node>
                 </node>
Line 271: Line 273:
If making a Beard you can change this value from Hair to Beard otherwise keep it the same.
If making a Beard you can change this value from Hair to Beard otherwise keep it the same.


                     <attribute id="UUID" type="guid" value="449e617f-8356-46e5-b740-9e4b18200441"/>
                     <attribute id="UUID" type="guid" value="3ae3e4fc-e792-473a-8853-43520dfc1147"/>


You want this uuid to be unique. We will be copying it to our Races.lsx soon
You want this uuid to be unique. We will be copying it to our Races.lsx soon
Line 280: Line 282:


Congrats this file is now ready. Copy and paste the section if you want to make more than one hair and follow the same principles.
Congrats this file is now ready. Copy and paste the section if you want to make more than one hair and follow the same principles.
=== Races.lsx ===
So this file is what we need to edit alongside CharacterCreationSharedVisuals in order for our hair to appear as a slot in character creation. When made via this your hair will appear at the bottom of the hairs in character creation.
However this file is sadly incompatible with other mods editing the same sections we need to edit. This can be resolved either by opting into my [https://www.nexusmods.com/baldursgate3/mods/353 Patches for Races.lsx] mod or by using the Compatibility Framework instead of the Races.lsx file.
=== Compatibility Framework ===
To use the [https://www.nexusmods.com/baldursgate3/mods/1933 Compatibility Framework] you need to install it alongside your mod. CF however needs to be at the bottom of the load order.
So first you want to make some new folders:
Modname/Mods/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 I have written 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
Congrats you setup your mod for using the Compatibility Framework. Just remember always load Compatibility Framework at the bottom of your load order.
381
edits

Navigation menu