asdt123123 Posted July 28 Posted July 28 Leash Framework View File Framework that allows you to attach REAL leashes to NPC's and either have them guide you around, or you guide them. No real limitation, you can make a huge train if you wanted.  I'm releasing this in it's current beta state! I've yet to find any serious bugs, but I do want to gauge the community to see if this mod is worth continuing further or expanding upon.   Important Note This is a FRAMEWORK. NPC's are expected to have AI packages with locomotion. If you try to use it on an NPC who is leaning against a wall, playing an animation, guarding the whiterun gate - this mod ~WILL NOT~ make them follow. Your mod is also expected to equip the leash.  Features Rich Papyrus API for connecting actors together in any order you will Advanced physics system that takes full advantage of HAVOK Easy to use debug menu for testing, or just using the mod freely Zero package interruption, this mod has it's own built-in AI system, pathfinder, and locomotion system. Your mod's packages will never be touched! Full support for the player actor, other actors, etc. No animal support yet, although that wouldn't be difficult Contains two test leashes by @kzrp to mess around with Supports ANY/ALL leashes, they just need a series of bones for this mod to move around! This means that all the chain collars in devious devices are fully compatible!  How to use (Without Papyrus API) Enough the leash to the actor (Or a leash, it can be any leash like from devious devices) Go into the SKSE Mod Menu using `f1`, find this mod. Open `Debug`. Select the leasher, and the leashed. Leasher MUST have that leash equipped, the mod doesn't do it for you - stop being lazy The parent bone is `NPC Spine2 [Spn2]` for the included leash. This can be any parent of the chain bones, even just NPC The `Leash Bone Match` is `Leash1` for the included leash. This is the prefix of the bones (or common name) in your leash Select a minimum distance, like ~200+. Don't go too low or it'll be fucked. `Persistent` means it'll persist with your save. Click `Leash actor` Enjoy (Note: Make sure the collar/leash is equipped to the actor, this mod doesn't auto equip it)  For a funnier experience, go into `Settings` and enable `Forced recovery for NPCs`. This will rag doll the actor once they exceed the distance threshold. Works well!  Known issues/limitations An actor can get stuck obviously. The less bones in the leash, the more fucked it'll be when stretching a long distance  Requirements Skyrim SE/AE (Doubt VR support works, this required a lot of reverse engineering) SKSE Mod Menu Framework (Optional for the mod menu)  Papyrus API Scriptname LeashFramework Hidden ;/ Active leash factions supplied by Leash.esm: - LeashedFaction (form ID 0x000D6A): contains actors that currently have an active leash. - LeasherFaction (form ID 0x000D6B): contains actors that currently hold one or more active leashes. Leash lifecycle mod events: - LeashFramework_OnLeash: sent when a leash is successfully applied, replaced, or restored from a save. - LeashFramework_OnUnleash: sent when a leash is disconnected, removed by UnleashAll, or replaced. Both lifecycle events use the leashed Actor as sender and set numArg to 0.0. strArg describes why the event was sent. OnLeash uses "applied", "replaced", or "loaded". OnUnleash uses "disconnected", "unleashAll", or "replaced". Replacing a leash sends OnUnleash before OnLeash. Internal state cleanup while starting or loading a game does not send OnUnleash. Pull mod events: - LeashFramework_OnActorPulled: sent once when normal direct-locomotion pulling starts. - LeashFramework_OnActorRagdollPulled: sent once when forced ragdoll pulling starts. Register for these events with RegisterForModEvent. Both pull events use the leashed Actor as sender, leave strArg empty, and provide the holder/anchor-to-collar distance at the transition in numArg. A pull event can be sent again only after that pull mode stops and later starts again; it is not sent every frame while pulling remains active. /; ;/ Connects a leash from a holder's right hand to leash bones on another actor. holder: Actor holding the leash. The current attachment bone is NPC R Hand [RHnd]. leashed: Actor wearing the leash mesh. An actor can have only one active leash. parentBone: Exact node name to find on the leashed actor before searching its descendants. leashBoneMatch: Text found anywhere in each ordered leash bone name beneath parentBone. For example, Main_ matches hdtSSEPhysics_AutoRename_Armor_00000004 Main_01 after SMP renames the node. minLength: Distance where active leash pulling stops. Must be zero or greater. maxLength: Maximum holder-to-collar distance. Must be positive and at least minLength. persistent: When true, the leash is saved and restored until explicitly disconnected. Applying another leash to the same leashed actor replaces its current leash. Returns true when the arguments are valid and the leash is accepted. /; Bool Function ApplyLeash(Actor holder, Actor leashed, String parentBone, String leashBoneMatch, Float minLength, Float maxLength, Bool persistent) Global Native ;/ Connects a leash from either hand on a holder to leash bones on another actor and applies the closed-fist grip. rightHand: When true, uses NPC R Hand [RHnd]. When false, uses NPC L Hand [LHnd]. All other arguments and replacement behavior match ApplyLeash. Returns true when the arguments are valid and the leash is accepted. /; Bool Function ApplyLeashToHand(Actor holder, Actor leashed, String parentBone, String leashBoneMatch, Float minLength, Float maxLength, Bool persistent, Bool rightHand = True) Global Native ;/ Connects a leash from an exact bone on a holder to leash bones on another actor. holderBone: Exact node name on the holder. This attachment does not alter the holder's hand pose. offsetX, offsetY, offsetZ: Optional local-space offset from holderBone. The offset follows the bone's translation, rotation, and scale, but does not add an attachment rotation. All other arguments and replacement behavior match ApplyLeash. Returns true when the arguments are valid and the leash is accepted. /; Bool Function ApplyLeashToBone(Actor holder, Actor leashed, String holderBone, String parentBone, String leashBoneMatch, Float minLength, Float maxLength, Bool persistent, Float offsetX = 0.0, Float offsetY = 0.0, Float offsetZ = 0.0) Global Native ;/ Connects a leash mesh equipped by the holder to an exact bone on the leashed actor. The first ordered leash bone remains in its neutral animated pose on the holder. The last ordered leash bone attaches to leashedAttachmentBone. leashParentBone: Exact node name to find on the holder before searching its descendants for leash bones. leashedAttachmentBone: Exact node name on the leashed actor. attachmentOffsetX, attachmentOffsetY, attachmentOffsetZ: Optional local-space offset from leashedAttachmentBone. The offset follows the bone's translation, rotation, and scale, but does not add an attachment rotation. closedHand: Applies the closed-fist pose to the holder. 1 closes the right hand, 2 closes the left hand, and every other value leaves both hands unchanged. All other arguments and replacement behavior match ApplyLeash. Returns true when the arguments are valid and the leash is accepted. /; Bool Function ApplyHolderOwnedLeashToBone(Actor holder, Actor leashed, String leashedAttachmentBone, String leashParentBone, String leashBoneMatch, Float minLength, Float maxLength, Bool persistent, Float attachmentOffsetX = 0.0, Float attachmentOffsetY = 0.0, Float attachmentOffsetZ = 0.0, Int closedHand = 0) Global Native ;/ Connects a holderless leash from a fixed position to leash bones on an actor. anchorCell: Cell containing the world-space position. It must correspond to the supplied coordinates. x, y, z: Fixed world-space coordinates of the leash anchor. All other arguments and replacement behavior match ApplyLeash. Pull distances are measured from the fixed anchor instead of a holder. World-position leashes do not assign LeasherFaction, have no result from GetLeashHolder, and do not use holder teleport recovery. Use DisconnectLeash(None, leashed) to disconnect one. Returns true when the arguments are valid and the leash is accepted. /; Bool Function ApplyLeashAtPosition(Actor leashed, Cell anchorCell, Float x, Float y, Float z, String parentBone, String leashBoneMatch, Float minLength, Float maxLength, Bool persistent) Global Native ;/ Disconnects the leash matching the specific holder and leashed actor. holder: Actor holding the leash. Pass None for a holderless world-position leash. leashed: Actor connected as the leashed endpoint. Returns true when the matching leash was disconnected. /; Bool Function DisconnectLeash(Actor holder, Actor leashed) Global Native ;/ Disconnects every leash where actor is either the holder or the leashed actor. Returns true when at least one leash was disconnected. /; Bool Function UnleashAll(Actor actor) Global Native ;/ Returns true when actor currently has an active leash. /; Bool Function IsLeashed(Actor actor) Global Native ;/ Returns true when actor currently holds at least one active leash. /; Bool Function IsLeashHolder(Actor actor) Global Native ;/ Returns the actor holding leashed's active leash, or None when the leash is holderless or absent. /; Actor Function GetLeashHolder(Actor leashed) Global Native ;/ Returns every actor currently leashed to holder. Returns an empty array when holder has no active leashes. /; Actor[] Function GetLeashedActors(Actor holder) Global Native ;/ Returns the minimum length of leashed's active leash, or -1.0 when leashed has no active leash. /; Float Function GetMinLeashLength(Actor leashed) Global Native ;/ Returns the maximum length of leashed's active leash, or -1.0 when leashed has no active leash. /; Float Function GetMaxLeashLength(Actor leashed) Global Native ;/ Sets the minimum length of leashed's active leash. newLength must be zero or greater and cannot exceed the current maximum length. Returns false when leashed has no active leash or newLength is invalid. /; Bool Function SetMinLeashLength(Actor leashed, Float newLength) Global Native ;/ Sets the maximum length of leashed's active leash. newLength must be positive and cannot be less than the current minimum length. Returns false when leashed has no active leash or newLength is invalid. /; Bool Function SetMaxLeashLength(Actor leashed, Float newLength) Global Native  Future todos: Allow attaching the rope to specific bones rather than just the right hand Add explicit API to disable walking control (For now just set minLength/maxLength to high numbers so it never triggers)  Known issues: Actors can get stuck on objects like doors rarely Some chains may not converge well (Gaps) - increase the solve iterations in the SKSE Mod Menu Actors wont follow you between load doors (Not a problem, lack of a feature)  Source code: https://github.com/asdasdduck/Skyrim-Leash-Framework Submitter asdt123123 Submitted 07/28/26 Category Adult Mods Requirements Regular Edition Compatible Install Instructions 15
BobaBibba Posted July 28 Posted July 28 The leash stays attached to the victim as a static object after freeing them.  I was just thinking about why there wasn't a leash mod a few nights ago, seems like someone was working on one. This has loads of potential, good work as always.
asdt123123 Posted July 28 Author Posted July 28 17 minutes ago, BobaBibba said: The leash stays attached to the victim as a static object after freeing them.  I was just thinking about why there wasn't a leash mod a few nights ago, seems like someone was working on one. This has loads of potential, good work as always.  This is just a framework. It's not designed to handle the equipping/un-equipping that's beyond the scope of the mod. Mods using this framework will do that.Â
Teruke Posted July 29 Posted July 29 Is someone going to use this to make a degenerate mod, like hand holding? 3
Karna5 Posted July 29 Posted July 29 (edited) This is delightful and amazing Bravo! Â p.s. Hmm, I wonder if someday this leash framework will replace the follow mechanism of mods like Prison Alternative or Slaverun or the like where you're supposed to automatically follow guards to a pama furniture or ZAZ furniture. In my game that follow mechanism has at most a 25% chance of success. Usually the auto-avigation walks me into walls. A leash system might be capable of allowing us to continue walking on our own, limited by the bounds of a leash to the guard. Edited July 29 by Karna5
SkyAddiction Posted July 29 Posted July 29 That's been one of the grails of Skyrim modding since before SE existed. That's crazy... 2
Pamatronic Posted July 29 Posted July 29 Oh Boy, this is actually VERY interesting. Mind giving a small explanation on how this works under the hood? 1
Pamatronic Posted July 29 Posted July 29 9 minutes ago, Karna5 said: Hmm, I wonder if someday this leash framework will replace the follow mechanism of mods like Prison Alternative Actually, if this has a "visual only" option (i.e not forcing its own ai packages on actors), this could easily be made into a soft dependency. But if it works in a completely different way to regular ai packages this might be interesting as well. Looking forward to hearing from the author. I would actually be willing to implement this on fairly short notice, so he can gather some more organic feedback. 2
sacredfire Posted July 29 Posted July 29 Are we going to get more leash types? I would love to finally have a good chain lease for a chain gang.
asdt123123 Posted July 29 Author Posted July 29 20 minutes ago, Pamatronic said: Oh Boy, this is actually VERY interesting. Mind giving a small explanation on how this works under the hood?  The rope is essentially a custom physics system that I built into Skyrim's havok engine. So it's similar to SMP physics in many ways, but uses havok instead of Bullet physics since I managed to reverse enough of it to make it viable. Then I built the constraint solver just using XPBD physics. The mesh (rope in this case) stretching is just Skyrim's IK system.  The following was ironically the hardest part. Mods kept overriding my package, and the package broke behaviors I didn't want to break. So I reversed Skyrim's locomotion system (Movement controller) and injected a custom one that overlaps on top. So when you see the NPC's and what not walking, it's purely locomotion - zero package. Making it (In theory) compatible with any/all mods.  I also ended up having to create a pathfinder because Skyrim's kept getting NPC's hung up on every tiny thing. So it uses a simple A* algorithm on the navmesh. However I didn't really bother with improving the smoothing pass or the heuristics so it still need more work.  That also should largely answer your other concern, this mod is indeed purely "visual" in the sense that it is largely stateless. The only state it will manage is the PlayerAI toggle. Although if you want to make it entirely visual, you can just set the min/max to some high number and my locomotion system will never take over.   16 minutes ago, sacredfire said: Are we going to get more leash types? I would love to finally have a good chain lease for a chain gang. You just use whatever leash already exists. All the smp leashes on here will work out of the box. Just go into NifSckope and figure out a common shared name between all the bones, and a parent. The leashes provided in this mod are no different than any other leash.  5
shrtjsrtj Posted July 29 Posted July 29 (edited) Does/can this work on LE? I don't use LE, but some mod authors want their mods to work the same on both versions of Skyrim and it would suck if they couldn't/wouldn't use something as awesome as this because of versioning issues. Edited July 29 by shrtjsrtj
DukeDog Posted July 29 Posted July 29 would it be possible to reverse it to have the player on the leash
Fraying9981 Posted July 29 Posted July 29 (edited) this is awesome. thanks for sharing    3 hours ago, asdt123123 said: Zero package interruption, this mod has it's own built-in AI system, pathfinder, and locomotion system. Your mod's packages will never be touched!  so if packages are not touched, then it's purely aesthetic? and it's up to the player, a 3rd party mod to make sure A follows B (B holds the leash)?  Edit: can't get it to work: tried the debug menu > equip the item, persistent ticked and untick, tweaked the variation slider. neither PC NPC or NPC NPC version works for me   Edited July 29 by Fraying9981
xtro334 Posted July 29 Posted July 29 1 hour ago, DukeDog said: would it be possible to reverse it to have the player on the leash  In the video the PC was leashed to a guard while 2 NPC was leashed to the PC, so it seems to be very versial.
Thoraag Posted July 29 Posted July 29 Super rad! I didn't get the ragdoll/past range effects as a player on a leash, but the visuals were rad and im super excited to see where it goes, and I'm looking forward to implementing it in my own mod!
784472071 Posted July 29 Posted July 29 Significant progress — thank you! Please keep working on and refining this mod no matter what.
zaira Posted July 29 Posted July 29 (edited) 7 hours ago, asdt123123 said: Mods using this framework will do that If it is comparable with the leash in Conan Exiles and the player can be leashed as well I will integrate it into MariaEden asap. I have an invisible leash system (actually based on Vanilla Escort Package) there already and a lot of quests are using it, integrating yours shouldn't be a big deal. Â Interesting would be if the leash holder can ride a mount - because in MEP the master will buy a horse and escort the player while riding. Edited July 29 by zaira 1
HereBeTentacles Posted July 29 Posted July 29 Its peak, I'm afraid.  The leash gets a little weird when it's pulled taught, there's a weird bend in it near the player:  Spoiler  I know it's probably done like that to avoid some odd clipping but I feel like the bend could be a bit higher up. I saw you talking about that earlier with kzrp so maybe it already got fixed or it's a known problem. Either way not a big deal.  Otherwise it works great, whether used as just a visual or with the actual pulling enabled.  Any chance we could tether the leash to an object? Like a hook on the wall or something of that sort? Can always just use an invisible inanimate npc to do it but just being able to pass a static object would be neat.
zaira Posted July 29 Posted July 29 I looked into the code - as I am not an expert in meshes and bones area, I have no idea what to pass into the bone parameters... Some examples would be helpful
zaira Posted July 29 Posted July 29 7 minutes ago, HereBeTentacles said: Like a hook on the wall That would be great! 1
HereBeTentacles Posted July 29 Posted July 29 1 minute ago, zaira said: I looked into the code - as I am not an expert in meshes and bones area, I have no idea what to pass into the bone parameters... Some examples would be helpful  If you are using the included leash then the values are listed under the How to use (Without Papyrus API) header.  For reference here's what I did, you can see the bone values here:  Spoiler
tamai Posted July 29 Posted July 29 7 hours ago, Teruke said: Is someone going to use this to make a degenerate mod, like hand holding?  i want this so bad 😠1
HereBeTentacles Posted July 29 Posted July 29 Also works with the chain collar from DDNG:  Spoiler   There are some gaps in the chain though which I think is more a problem with the chain mesh and not the mod, as the chain on the collar is split into multiple nodes instead of a single one. The chain also deforms a lot when it's pulled taught but that could probably be mitigated by fine tuning the length settings. 1
zaira Posted July 29 Posted July 29 This mod is again (like PPA) a game changer, kind of milestone for NSFW mods - cudos... 1
Dowser Posted July 29 Posted July 29 (edited) I wonder how bad things would break if the rope used Movable Chains.... Would a C api be possible? Edited July 29 by Dowser
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now