Converting Skyrim Outfits to Blade & Sorcery NPCs
People are sleeping on modding this game. Here's how you can bring your favorite Skyrim stuff over to play with.
What you need:
- The latest Blender - https://www.blender.org/download/
- The NIF plugin for it - https://github.com/niftools/blender_niftools_addon
- A skeleton to work off of. I'm using this one - https://www.nexusmods.com/skyrim/mods/98111
- A texture editor of some sort. In this tutorial I'll be using chaiNNer to do my texture conversion - https://github.com/chaiNNer-org/chaiNNer
- and a little bit of Krita for editing -https://krita.org/en/
- The BaS SDK - https://github.com/KospY/BasSDK/
- Unity Hub - https://unity.com/unity-hub
- My BaS NPC script for Unity - https://www.nexusmods.com/bladeandsorcery/mods/9146
- An outfit mod you want to make into an enemy or avatar. You can certainly bring over weapons as well, but the offical wiki covers how to make those already.
Install all that mess. Open up the skeleton file, and import all the pieces you want to make into an NPC. Here I'll be using an older mod I made myself, plus the body pieces and skin textures it requires.
Note that multiple armatures come in while doing this, since each NIF contains the bones that mesh requires. What I'm going to do is rename the full one to "Rig" (important for the Unity script later) and attach everything to that skeleton, making sure to apply all transforms as I go.
You want your model to be human scale in Blender and facing the negative Y.
I'm also gonig to lift up my character and move the toe bones down, since she's wearing heels. In Skyrim this had to be corrected via a mod at runtime, but here we want to adjust the skeleton.
It's very important to rotate the head bone so it points up, not forward.
While we're adjusting the skeleton, we need to make sure we have bones for every part of the unity humanoid, even if we're not using them. And in fact, as of this writing we should make sure not to skin anything to the eye bones. There's a bug with them on custom NPCs that causes the face to collapse, so for now we're just going to make sure our head is fully rigged to the head and jaw bones. For the skeleton I'm using in this tutorial, I have to add two eye bones and a jaw bone.
We also need to sanitize the bone roll of the skeleton to match what BaS expects. Turn on bone axes in Viewport Display for the armature, then roll the bones so the Z axis is forward for everything. Roll the hands, hips, spine, and head bones 180 degrees.
One of the things BaS lets us do is assign material types per mesh or with an ID map. ID maps are more performant (More individual meshes = more draw calls) but for a quick and easy way to separate materials, you can split them up in Blender.
Next up, we need to convert the textures from Skyrim's format to one the BaS shader likes. The BaS shader takes a base color, a normal map, and then a mask texture that's split up like this:
- Red: Metallic
- Green: Occlusion strength
- Blue: Emission mask
- Alpha: Smoothness
In Skyrim the metallic map is in the alpha channel of the normal map, so I'm going to use chaiNNer to extract that and put it in the new texture, along with a 50% occlusion strength, black emission mask, and as a quick kludge for the purposes of this conversion, reuse the metal map as my smoothness map. For a high quality result, go ahead and make a proper smoothness map.
It's also important to convert everything from Skyrim's DDS settings to PNG, otherwise they import into Unity upside down. Just Unity things I guess.
Skyrim skin base color textures are very dark due to the shader they use, so I take them into Krita and adjust the color curves until they're the tone I want.
Before we export double check that your mesh is scaled correctly, facing negative Y, and has all its transforms applied. Then export with these settings:
Pay close attention to the axis settings here. If they aren't exported like that, all your bones will be rotated wrong and you'll have a bad day. If your model comes out looking like jelly, this is probably what you skipped.
Open up Unity Hub, load the BaS SDK, and make yourself a new folder to work in. Import all your textures and FBX file. On the model, make sure Read/Write is set (or dismemberment will glitch out) and set up your humanoid rig. You'll need to assign some of those dummy bones like the eyes.
Set up your materials. Make them ThunderRoad/Lit. Use the textures we converted in chaiNNer. Set the occlusion slider to .5. For anything that's going to get damage decals, enable Reveal Layers and auto-fill them.
Make a material to use to fill in cut body parts as well. If you don't have anything appropriately gory on hand, just a flat red standard material works.
Once that's all set up, drop your character into an empty scene. Unpack the prefab completely. Drop the NPC helper script onto its root. Type in a name and assign the cut fill material in the script component. Click on the little menu dots in the upper right of the component and select Create BAS NPC.
If it worked, examining the character should give you something like this:
Under the Mesh group, click on each part and if it needs to show damage, give it a Reveal Decal component. If it's something other than flesh, give it a Mesh Part component and set the mesh and physic material. Note that the material does affect gameplay! Set your armor mesh to Metal and it's going to deflect blows.
With that done, open up the ragdoll parts and examine each one. Underneath each part is a collider group. Adjust these colliders to fit your model as best you can. Duplicate or add more to the group as needed. You can assign physic materials to the colliders as well, if you want them to override the underlying mesh settings.
If you have colliders that greatly intersect, click on the ragdoll part, and drag the other offending ragdoll part into the Ignored Parts list. If your character is jittering when ragdolling in game, it's probably because you need to do this.
With all those edits done, drag the character from the hierarchy to the asset browser to make a prefab. Make that prefab addressable, make an addressable group for your mod, set the folder name and manifest info, then use the ThunderRoad SDK menu to build the bundle. Export it and you should now have a mod folder under \Steam\steamapps\common\Blade & Sorcery\BladeAndSorcery_Data\StreamingAssets\Mods\
Open up your Steam folder and find Blade & Sorcery\BladeAndSorcery_Data\StreamingAssets\Default\bas.jsondb. Extract this somewhere safe with your favorite archive program. Into your mod folder, copy Creature_HumanFemale.json and rename it something relevant to your mod. Open it up, and change the id to the name you gave the character when you ran the script, and set prefabaAddress to the address you gave it after you were done. There are some things you can tweak in here, but that's all you need to do to get it working for now.
It is currently vital that you set the pooling maximum to 0. If you allow it to pool your NPCs and they are dismembered, they will respawn with invisible parts. I've reached out to WF about this bug already.
Make a new file named something like CreatureTable_MyNPC and add this:
{ "$type": "ThunderRoad.CreatureTable, ThunderRoad", "id": "DemoGirlTable", "saveFolder": "bas", "version": 1, "description": null, "linkedToGenderRatio": false, "minMaxDifficulty": { "x": 0, "y": 3 }, "drops": [ { "$type": "ThunderRoad.CreatureTable+Drop, ThunderRoad", "reference": "Creature", "referenceID": "DemoGirl", "overrideFaction": false, "factionID": 0, "overrideContainer": false, "overrideContainerID": "", "overrideBrain": false, "overrideBrainID": "", "probabilityWeights": [85, 85, 85, 85, 85] } ] }
And another file named Wave_MyNPC:
{ "$type": "ThunderRoad.WaveData, ThunderRoad", "id": "DemoGirl3", "sensitiveContent": "None", "sensitiveFilterBehaviour": "Discard", "version": 2, "category": "Mixi", "localizationId": "DemoGirl3", "title": "DemoGirl 1v3", "description": "Bwee!", "loopBehavior": "LoopSeamless", "totalMaxAlive": 3, "alwaysAvailable": false, "waveSelectors": ["Arena", "Ruins", "Market", "Canyon", "Citadel"], "playerHealthMultiplier": 1.0, "enemiesHealthMultiplier": 1.0, "factions": [ { "$type": "ThunderRoad.WaveData+WaveFaction, ThunderRoad", "factionID": 3, "factionHealthMultiplier": 1.0, "factionMaxAlive": 3 } ], "groups": [ { "$type": "ThunderRoad.WaveData+Group, ThunderRoad", "reference": "Table", "referenceID": "DemoGirlTable", "overrideFaction": false, "factionID": 0, "overrideContainer": false, "overrideContainerID": "", "overrideBrain": false, "overrideBrainID": "", "overrideMaxMelee": true, "overrideMaxMeleeCount": 2, "groupHealthMultiplier": 1.0, "minMaxCount": { "x": 20, "y": 20 }, "spawnPointIndex": -1, "prereqGroupIndex": -1, "prereqMaxRemainingAlive": 0 } ] }
Save all that and run the game. Now in the spawn book, there should be a new category with your new NPC wave in it.
Go and enjoy some perfectly normal mediaeval fantasy combat.
Edited by mxwqtkl
new pictures
1
0 Comments
Recommended Comments
There are no comments to display.