0 of 0

File information

Last updated

Original upload

Created by

hoshinocomet

Uploaded by

hoshinocomet

Virus scan

Safe to use

About this mod

Ever wanted to have things like tassels and banners on your weapon move? This tutorial is for you.

Requirements
Permissions and credits
Avaliable to download in PDF format in the files section as well!

Update 12 October 2022: After some more testing, I discovered I was mistaken that you do not need to use scripts for smp on weapons. Apologies for those that have downloaded the first version of the tutorial, it has now been updated to reflect that change.

This guide assumes that you have added custom weapons into Skyrim before, as well as a basic understanding of how HDT-SMP and Creation Kit works. If you don’t, please refer to this very helpful guide by denRubi (for HDT-SMP).

Treota also has a useful written walkthrough for the same topic.

You will also need Faster-HDT-SMP (or regular HDT-SMP) and Notepad++ installed. The process of putting physics on weapons is similar to what is done on outfits/hair, but with some differences.

This tutorial will instruct on having SMP on weapons at alltimes when sheathed/drawn with the use of a simple script.

In summary, there are three main components we need in order to make things work.

  • Weapon nif – that is paint weighted just like any other SMP armor/outfits.
  • Dummy nif - An empty armor nif file that has the ni string xml attached to it.
  • HDT-SMP Script. The script “equips” the empty armor to activate the SMP weights in the main weapon.

I have included the dummy nif and the smp script in editable .psc and compiled .pex format in the files section to download.

By default, the smp script name is called _HDTSw. (See the Troubleshooting section on how to rename and recompile the script safely - its not just renaming the script file!)

Examples of such weapons: Rally to me-War Banners and HDT Bloodborne Lantern. They utilize custom scripts in some form (e.g. using an empty armor .nif file with NiString xml that will activate the physics in main weapon) but the underlying principle behind applying physics to weapons is the same.

(Please note that this tutorial will not cover more advanced weapon SMP. An example of complex weapon SMP that needs scripts would be Caenavon’s Calamity Queller spear, since the smp stops when sheathed and smp resumes when unsheathed.)

TLDR, the process is as follows.

1. Weigh weapon mesh, export as nif. In NifSkope convert skinning node of skinned parts to NiSkinInstance.

2. Create Armor and ArmorAddon form for Dummy Nif.

3. Write smp XML and link it to Dummy Nif in Nifskope.

4. Create Weapon and 1stPerson Weapon form for Weapon Nif.

5. Link SMP script to Weapon form.


Step 1 - Outfit Studio


-We will be using a sword with a tassel as an example of a custom weapon for this tutorial. Ensure that the tassel mesh is separate from the main sword mesh in OS. Name the tassel part Tassel_SMP.

- In Outfit Studio, we create a Root Bone called TasselRootThis won’t have any weights.

-Make a static bone called Tassel_0 and have its parent be TasselRoot. Weight paint this bone - it will be the bone that anchors the smp part of the weapon in place.

-Make as much SMP bones as needed afterwards (e.g. Tassel_1,Tassel_2, etc.) and weight paint them as well, these will be the parts that will dangle.

-Save your progress and export the weighted .nif.

Step 2- Writing Your HDT-SMP .xml file

Feel free to refer or copy the below template as reference. Edit the bone names and settings for your own weapon as required. You know the drill, declare your static and SMP bones correctly, do your constraint groups correctly.

<?xml version="1.0" encoding="UTF-8"?>
<system xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="description.xsd">
<!-- Static bones that do not have SMP physics must go here, or your mesh will sink into the ground -->
<bone name="tassel_0"/>
<bone name="tassel_1"/>

<!-- bone-default script goes here -->

<bone-default>
<mass>0.5</mass>
<inertia x="20" y="20" z="20" />
<centerOfMassTransform>
<basis x="0" y="0" z="0" w="1" />
<origin x="0" y="0" z="0" />
</centerOfMassTransform>
<linearDamping>0.65</linearDamping>
<angularDamping>0.65</angularDamping>
<friction>0.2</friction>
<restitution>0</restitution>
<gravity-factor>1</gravity-factor>
</bone-default>


<!--SMP affected bones go here-->

<bone-default>
<margin-multiplier>0.2</margin-multiplier>
</bone-default>


<bone name="tassel_2"/>
<bone name="tassel_3"/>
<bone name="tassel_4"/>

<!--generic-constraint script goes here,lowerlimit only accepts negative, upperlimit positive numbers -->
<generic-constraint-default>
<frameInB>
<basis x="0" y="0" z="0" w="1" />
<origin x="0" y="0" z="0" />
</frameInB>
<useLinearReferenceFrameA>false</useLinearReferenceFrameA>
<linearLowerLimit x="0" y="0" z="0" />
<linearUpperLimit x="0" y="0" z="0" />
<angularLowerLimit x="-1" y="-1" z="-1" />
<angularUpperLimit x="1" y="1" z="1" />
<linearStiffness x="0" y="0" z="0" />
<angularStiffness x="0" y="0" z="0" />
<linearDamping x="2" y="2" z="2" />
<angularDamping x="0" y="0" z="0" />
<linearEquilibrium x="0" y="0" z="0" />
<angularEquilibrium x="0" y="0" z="0" />
</generic-constraint-default>


   <constraint-group>
<generic-constraint bodyA="tassel_1" bodyB ="tassel_0"></generic-constraint>
<generic-constraint bodyA="tassel_2" bodyB ="tassel_1"></generic-constraint>
<generic-constraint bodyA="tassel_3" bodyB ="tassel_2"></generic-constraint>
<generic-constraint bodyA="tassel_4" bodyB ="tassel_3"></generic-constraint>
   </constraint-group>



</system>


Step 3- Nifskope

-Locate the BSTriShape of the tassel mesh (Tassel_SMP)

-Select BSDismemberSkinInstance, right click, Block, convert, NiS, NiSkinInstance.



-Save the file and open up the HDT_Dummy.nif file. (Note: Ideally, you would want to rename this file to something like HDT_Tassel.nif, something that represents the moving part of the weapon.)-Create a NiStringExtraData block for HDT-SMP and link up your custom .xml file to it.
-Save the nif.

Step 4 - CreationKit (Armor and Armoraddon forms)

-Create an ArmorAddon entry for your dummy nif and assign it an ID.

-Under Biped Model, find your Dummy nif file and assign it to both male and female.

-Next, make an Armor entry for your dummy nif and assign it an ID. Remember this ID.

-Check off the "Playable" mark.

-Under the “Models” box on the bottom, assign it the ID of your ArmorAddon created earlier.





Step 5 - Creation Kit (Weapon and 1stPersonWeapon forms)

-Feel free to skip this part if you already have your customweapon entries made.

-Create your 1stPersonWeapon entry for your custom weapon.

-Assign it a custom ID that is easily searchable, e.g. 1stWeaponSwordWithTassel. Use an existing weapon in Skyrim to start modifying it, such as the Avakiri katana.



-Select OK. When prompted to create a new form, select yes.

-Next, create your Weapon entry for your custom weapon. Use an existing weapon in Skyrim to start modifying it.

-Change its ID to something easily searchable (e.g. SwordWithTassel).

-Its Name can be what you wish.

-Under Model beneath Art and Sound, change the Model link to that of your custom weapon nif.

-Under Model beneath 1st Person Mode (Object), select the custom ID of your customweapon’s 1stPersonWeapon entry.

-Select OK. When prompted to create a new form, select yes.



Step 6 – Attaching the HDT Weapon Script

-While still having your Weapon window open , navigate to the papyrus scripts section on thebottom right hand corner, and select “Add”. Locate the name of your HDT Weapon script (by default _HDTSw) and click OK. 



-Highlight the script by clicking once over it and go to Properties. Select “Edit Value” and pick the ID of your Armor entry created earlier. Click OK, save the.esp and exit CK.



Step 7 – Testing In-Game

-Going into Skyrim, if you have your custom weapon equipped before doing this tutorial, un-equip and re-equip it once, and the physics should activate.

-Adjust the XML parameters if needed, and see the changes in-game by going into the in-game console and typing (without quotation marks) “smp reset”.

This concludes the tutorial.
 
Troubleshooting

Q: The physics on my weapon are not working.

A: Remove and re-equip the weapon, or get a new one viaadditemmenu, or try smp reset console command.

Q: The physics parts on my weapon are dangling/behaving weirdly.

A: Double check the weights on your weapon in Outfit Studio,and also try to play around with the parameters in the .xml file, in particular mass/inertia, linear/angular lower/upperlimits (Reminder that lower limits are always negative numbers,and upper limit positive numbers).

Q: I am reusing the HDT Weapon script for future projects and wish to avoid overlapping conflicts in my mod manager. How do I rename the script safely?

A: First of all, do not just rename the .pex file or .psc file, that will cause the script to not work. Follow the below steps carefully.

-Open up _HDTSw.psc in Notepad ++.

-Replace "_HDTSw" (without quotation marks) with anything you wish. (Make use of Notepad++ search and replace function to make things easier)

-Replace "SomeArmor" (without quotation marks) with anything you wish, but different from the name you replaced _HDTSw with earlier. (This represents the Property Name of the script seen in CK)

-Save the .psc file. Rename the psc file to the EXACT SAME NAME you replaced “_HDTSw” with earlier. THIS IS IMPORTANT!

-Open up Creation Kit and go to the Compile Scripts option. Locate your .psc script from the dropdown menu (if it doesn't show up, try placing the .psc file into overwrite\scripts\Source and reboot CK) and then compile it.

-Find the newly compiled .pex file and shift it to your mod directory.
 
Credits

-Chaos, full_inu, and Kreis for answering my questions during many troubleshooting attempts.

-Xing and Dint999 for providing insight into the weapon SMP process and sending me the HDT weapon scripts used.

-DenRubi and Treota for their visual and written guides on HDT-SMP.

-The many contributors for Faster HDT-SMP: hydrogensaysHDT,aers, Karonar1, alandtse, HsanMartin, DaydreamingDay,

romanicles, igloomod,SesamePaste,alandtse, HsanMartin, geniusty, skullgirls, idaan300.
  翻译: