Jump to content

Recommended Posts

Just uploaded 0.3 beta 4. This contains a rather experimental and somewhat upgly workaround for NPCs with stuck "weapon drawn" animations (this happens sometimes and I have not been able to find out why). The workaround involves forcing them into bleedout; this will reset their animation state.

As written above this is rather experimental. It may trigger too often, even in situations where the weapon drawn animation is not stuck. Version 0.3 beta 3 is still available, so if it does cause problems you can always go back to the old version.

 

I will be away for the next about two weeks, without a computer. I am looking forward to feedback when I return :).

PS: This will not fix situations with quests (like the one in the Museum of Witchcraft). These are probably caused by quest scene packages overriding the bound hands packages. I may be able to fix that, but I am still considering if I actually should. A generic override on scene packages might break quests.

Link to comment
  • 2 weeks later...

@Kharos

 

Sorry to ask without reading, but I'm at work on my phone, so it's problematic, lol, to go through the thread. But, question. Is there an API in your mod, to apply handcuffs, the way DDs can be applied in external mods? I'm keen to add support for this mod into RSE II and if you have an API, that's awesome. If not, would you like one made?

Link to comment

Follow up.

 

To users of the mod:

 

Can some of you low level highlight how this mod works? Theres a lot of scripting to go through to get an overview.

 

Like, are the cuffs equipped after events in the mod or does it just have handcuffs laying around that you can equip on people? When you equip them on NPCs, what do those NPCs do? It looks like in the source code that they could follow you around or such. Does it allow you to say enslave an NPC and send them to a settlement or something, like Just Business does? How does the player get bound in the cuffs? There is only one quest in the mod, to house the scripting, so I am not sure how the player gets knackered up in these things.

 

Basically, I want to know how to use this mod and its functions, to equip handcuffs on the player as an outcome of combat surrender in RSE II.

 

So yes, if someone can tell me in detailed strokes how this mod functions, that would be awesome and save me a lot of time. Appreciate all insights! :)

Link to comment
23 minutes ago, Flashy (JoeR) said:

Can some of you low level highlight how this mod works? Theres a lot of scripting to go through to get an overview. 

The handcuffs do pretty much all of the things you stated - there are keywords that cause actors to use follow packages etc.  But by itself the mod doesn't force restraints on you; you have to put them on yourself or others to make use of them.

 

As far as integrating the mod with another mod, you have to write up your own routines.  The scripts you want are attached to the handcuffs themselves - the various types of handcuffs all have extensions of the RestraintBase script on them, and the function you need is ForceEquip().  You have to call it on an ObjectReference, so you will need to place it in the world to get its RefID, then move it into the actor's inventory, and finally call the functions on it.

 

Here is a slightly modified version of the function I used in AAF Violate.  This will equip either a regular handcuffs or hinged handcuffs on an actor:

Function RandomRH(Actor akActor)
	If Game.IsPluginInstalled("RealHandcuffs.esp")
		Armor Handcuffs
		If (Utility.RandomInt(1,100) > 20)
			HandCuffs = Game.GetFormFromFile(0x00000802, "RealHandcuffs.esp") as Armor ; regular handcuffs
		Else
			HandCuffs = Game.GetFormFromFile(0x0000085C, "RealHandcuffs.esp") as Armor ; hinged
		EndIf
		ObjectReference hcRef = akActor.PlaceAtMe(akFormToPlace = HandCuffs, abInitiallyDisabled = true)
		akActor.AddItem(hcRef, 1, True)
		
		ScriptObject rhRefScript = hcRef.CastAs("RealHandcuffs:RestraintBase")
		var[] rhArgs = new var[2]
		rhArgs[0] = false
		rhArgs[1] = true
		rhRefScript.CallFunction("ForceEquip", rhArgs)
	EndIf
EndFunction

This is completely standalone, no script dependency at all.

 

Here are the routines I use to take all handcuff keys away from an actor, and to give one key to an actor:

Function RemoveRHKeys(Actor akActor, Actor akTaker = None)
	Keyword RH_Key = Game.GetFormFromFile(0x0000085F, "RealHandcuffs.esp") as Keyword
	akActor.RemoveItem(RH_Key, -1, true, akTaker)
EndFunction

Function GiveRHKeys(Actor akActor)
	MiscObject RH_HandcuffsKey = Game.GetFormFromFile(0x00000813, "RealHandcuffs.esp") as MiscObject
	akActor.AddItem(RH_HandcuffsKey, 1, True)
EndFunction

Likewise without dependencies.

 

I haven't yet looked into using the follow / enslavement type features of this mod.  I will say that it works brilliantly in animations, and it is very effective at restraining the player so it doesn't break when you use furniture.

Link to comment
2 minutes ago, EgoBallistic said:

The handcuffs do pretty much all of the things you stated - there are keywords that cause actors to use follow packages etc.  But by itself the mod doesn't force restraints on you; you have to put them on yourself or others to make use of them.

 

As far as integrating the mod with another mod, you have to write up your own routines.  The scripts you want are attached to the handcuffs themselves - the scripts are all extensions of the RestraintBase class, and the function you need is ForceEquip.  Here is a slightly modified version of the function I used in AAF Violate.  This will equip either a regular handcuffs or hinged handcuffs on an actor:


Function RandomRH(Actor akActor)
	If Game.IsPluginInstalled("RealHandcuffs.esp")
		Armor Handcuffs
		If (Utility.RandomInt(1,100) > 20)
			HandCuffs = Game.GetFormFromFile(0x00000802, "RealHandcuffs.esp") as Armor ; regular handcuffs
		Else
			HandCuffs = Game.GetFormFromFile(0x0000085C, "RealHandcuffs.esp") as Armor ; hinged
		EndIf
		ObjectReference hcRef = akActor.PlaceAtMe(akFormToPlace = HandCuffs, abInitiallyDisabled = true)
		akActor.AddItem(hcRef, 1, True)
		
		ScriptObject rhRefScript = hcRef.CastAs("RealHandcuffs:RestraintBase")
		var[] rhArgs = new var[2]
		rhArgs[0] = false
		rhArgs[1] = true
		rhRefScript.CallFunction("ForceEquip", rhArgs)
	EndIf
EndFunction

This is completely standalone, no script dependency at all.

 

Here are the routines I use to take all handcuff keys away from an actor, and to give one key to an actor:


Function RemoveRHKeys(Actor akActor, Actor akTaker = None)
	Keyword RH_Key = Game.GetFormFromFile(0x0000085F, "RealHandcuffs.esp") as Keyword
	akActor.RemoveItem(RH_Key, -1, true, akTaker)
EndFunction

Function GiveRHKeys(Actor akActor)
	MiscObject RH_HandcuffsKey = Game.GetFormFromFile(0x00000813, "RealHandcuffs.esp") as MiscObject
	akActor.AddItem(RH_HandcuffsKey, 1, True)
EndFunction

Likewise without dependencies.

 

I haven't yet looked into using the follow / enslavement type features of this mod.  I will say that it works brilliantly in animations, and it is very effective at restraining the player so it doesn't break when you use furniture.

This is incredible! Thanks @EgoBallistic! Truly appreciate this amazing amount of info and detail and source scripting for reference! :) You sir, are a good man.

 

And this is utterly brilliant because it mirrors the DD functions I am using - equip and steal keys. Bloody brilliant indeed!

Link to comment

Thanks for doing techsupport while I was away @EgoBallistic :cool:, I really appreciate it!

 

@Flashy (JoeR) if you want to handle keys, RestraintBase has a function Form Function GetKeyObject(), it will return the form for the key that unlocks the handcuffs so you don't have to hardcode that (edit: might be intersting for you too @EgoBallistic). Please note that it can return Nothing in some cases (e.g. with time-locked handcuffs that don't have a key).

 

All script sources are included in the zip and I added comments, though there are lots of scripts. The interesting api for you is probably in Library and in RestraintBase. To get a library instance, you will need to get the main quest and cast it (0x000F99). The handcuffs are instances of RestraintBase.

 

Final question for both of you, would it help if I created a factory api that can be used to spawn handcuffs with various options (high security lock vs normal lock, etc)?

Link to comment
3 hours ago, Kharos said:

Final question for both of you, would it help if I created a factory api that can be used to spawn handcuffs with various options (high security lock vs normal lock, etc)?

That would be great.  This would minimize the amount of hard-coding required, like I did with the regular vs hinged ones.  It would be best if the function signature used only vanilla types (i.e. takes bools and ints, returns an ObjectReference) so that it can be invoked with CallFunction().

 

I have to say I really appreciate how well commented and self-documenting your code is.  Like you said, there are a lot of scripts, but it's all very well laid out and intuitive.

Link to comment
14 minutes ago, EgoBallistic said:

That would be great.  This would minimize the amount of hard-coding required, like I did with the regular vs hinged ones.  It would be best if the function signature used only vanilla types (i.e. takes bools and ints, returns an ObjectReference) so that it can be invoked with CallFunction().

 

I have to say I really appreciate how well commented and self-documenting your code is.  Like you said, there are a lot of scripts, but it's all very well laid out and intuitive.

The natural return type would be RealHandcuffs:RestraintBase. This extends ObjectReference, so I assume it would be fine too?

Link to comment
12 minutes ago, Kharos said:

The natural return type would be RealHandcuffs:RestraintBase. This extends ObjectReference, so I assume it would be fine too?

I think so.  Though in my code I referred to the cuffs object as an ObjectReference and used CastAs() on it when I needed to call ForceEquip().  The reason I jump through all those hoops is to avoid any dependencies on the script.  This allows my script to be compiled without your source available, if necessary, and avoids Papyrus errors if someone is using my mod without yours installed.

 

The other possibility of course is for the function to take an Actor reference and to handle the equipping internally.

Link to comment
On 5/24/2019 at 9:13 AM, Flashy (JoeR) said:

Can some of you low level highlight how this mod works?

On 5/24/2019 at 9:35 AM, EgoBallistic said:

I haven't yet looked into using the follow / enslavement type features of this mod.  I will say that it works brilliantly in animations, and it is very effective at restraining the player so it doesn't break when you use furniture.

 

Well the former is well covered, and Kharos can fill you in on the how, but the short-version that I know, is AI package overrides. Works pretty damn well, only had one or two instances of it 'breaking'/failing. Works more reliably than DD from my experience, especially on followers/companions.
 

On 5/24/2019 at 9:35 AM, EgoBallistic said:

I will say that it works brilliantly in animations, and it is very effective at restraining the player so it doesn't break when you use furniture. 

Best damn part, in my opinion.

Link to comment

Just uploaded a new beta version. There are no new features, it contains a small number of incremental compatibility improvements.
 

The one item of note is that I added a new script ThirdPartyHelpers on RH_MainQuest (0x000F99) for other modders that want to use RealHandcuffs as a (soft) dependency. I tried to anticipate what other modders might want to do and write the functions such that they can be used in a fire-and-forget way using CallFunction / CallFunctionNoWait, but my crystal ball is sometimes a bit foggy, so I am ready to take suggestions.

Link to comment

Uploaded a new beta version (0.3 beta 6). This changes the handling of bound followers / player teammates in combat. In my tests it fixes a issue where bound followers / player teammates would sometimes draw their weapon when combat ended (this happened especially with Just Business slaves in my case).

 

In addition I renamed ThirdPartyHelpers to ThirdPartyApi and added two functions to query the version. Other mods that use Real Handcuffs as a soft dependency should switch to using this api (@EgoBallistic). I will try to keep this api as stable as possible to prevent breaking these mods, even when I make large changes to existing code.

Link to comment

Hi @Kharos.  So @WandererZero and I were testing a new build of Violate and discovered something awkward.  It turns out that you can hit [tab] and bring up the handcuffs menu during dialogue scenes and, more importantly, during AAF animations.  If this is timed right (or badly depending on your perspective) you can cause AAF events not to fire, which can really hose things up.

 

I added a check for Target.IsInScene() and Target.HasKeyword(AAF_ActorBusy) to the OnKeyDown handler and that traps most, but not quite all, of it.  I think those would be good to add in any case, though.

 

But, a mechanism for third party mods to prevent the tab activation altogether would be useful, even if it's just another keyword.  Would you consider adding this - or is there another way to handle this that I might have missed?

Link to comment
16 hours ago, EgoBallistic said:

Hi @Kharos.  So @WandererZero and I were testing a new build of Violate and discovered something awkward.  It turns out that you can hit [tab] and bring up the handcuffs menu during dialogue scenes and, more importantly, during AAF animations.  If this is timed right (or badly depending on your perspective) you can cause AAF events not to fire, which can really hose things up.

 

I added a check for Target.IsInScene() and Target.HasKeyword(AAF_ActorBusy) to the OnKeyDown handler and that traps most, but not quite all, of it.  I think those would be good to add in any case, though.

 

But, a mechanism for third party mods to prevent the tab activation altogether would be useful, even if it's just another keyword.  Would you consider adding this - or is there another way to handle this that I might have missed?

There is no way to handle it at the moment - I did just not consider it. It does make sense that this happens though. I am using InputEnableLayer to forbid player actions like opening pipboy. This works very well, but it means that I will have to do my own key handling. My code does not have any checks at all at the moment [Edit: Not true, it checks if a menu is open, but clearly that is not enough].

 

I will add a way for other mods to temporarily disable the hotkeys - I still need to decide what's the best way to do that. I will also add compatibility code to catch some of the situations. Thanks for reporting the issue.

Link to comment

@EgoBallistic I tried to fix some of these issues in 0.3 beta 7:

  • Prevent hotkeys from triggering when the player is in dialogue with a NPC.
  • Prevent hotkeys from triggering when the player is in a AAF animation.
  • Add compatibility keyword to prevent player (not character, the human playing the game) from equipping/unequipping restraints.

The keyword has multiple ways of working:

- put it on a restraint to prevent the player from equipping or unequipping that restraint to/from any actor, works both for the sole survivor and for NPCs

- put it on a actor to prevent the player from equipping or unequipping any restraint on that actor, again works both for the sole survivor and for NPCs


One of the effects of putting it on the player is that it prevents the popup that normally shows when pressing tab. The ThirdPartyApi script now has two helper functions for adding/resetting the keyword. The other option is to put it on a reference alias and put the player into the reference alias; this is safer and simpler, but it requires a hard dependency.

Link to comment
3 minutes ago, Kharos said:

Prevent hotkeys from triggering when the player is in a AAF animation.

I'd look at preventing a hotkey trigger when ANY actor is in an AAF animation. 

 

The bug actually occured while a companion was being violated, and my PC was waiting for the next one and the next PC violation had not started yet. Just some extra info. ;)

Link to comment
8 minutes ago, WandererZero said:

I'd look at preventing a hotkey trigger when ANY actor is in an AAF animation. 

That is much harder (though not completely impossible), I would have to listen to AAF events and track when scenes are started and ended. It may also be too much.

 

I am assuming that Violate is taking steps to prevent the player from running away while companions are being violated. How is that done?

Link to comment
17 minutes ago, Kharos said:

That is much harder (though not completely impossible), I would have to listen to AAF events and track when scenes are started and ended. It may also be too much.

Yeah, no worries. Just laying the issues out, so they're known. :cool:

Link to comment
15 hours ago, Kharos said:

That is much harder (though not completely impossible), I would have to listen to AAF events and track when scenes are started and ended. It may also be too much.

For my purposes, the keyword on the player does the job.  I set it at the start of the violation encounter and remove it at the end.  So in the meantime the player can't use the tab menu from Real Handcuffs no matter who is in an animation.

15 hours ago, Kharos said:

I am assuming that Violate is taking steps to prevent the player from running away while companions are being violated. How is that done? 

Nothing special, I just disable movement and other controls via InputEnableLayer.DisablePlayerControls().  Other than changing the camera direction, the player is unable to move their character at all for the duration of the violation encounter.

Link to comment
5 hours ago, EgoBallistic said:

Nothing special, I just disable movement and other controls via InputEnableLayer.DisablePlayerControls().  Other than changing the camera direction, the player is unable to move their character at all for the duration of the violation encounter.

Ok. As far as I know I cannot detect this, so you will have to handle it in your mod using the keyword (as you said you will).

Link to comment

Am I the only one who has a problem with the third-person camera? It act as if my character was with the arm broken (because the camera vibrates slightly) and the camera in the third person can approach so much that it seems exactly like the first person view.

 

And when my character walks or runs, the camera moves too far away. I have tried disabling a POV mod i have, but it has not worked. I leave some captures. Without hancuffs. Handcuffed Running handcuffed.

Spoiler


 

2019-06-02.png

2019-06-02 (2).png

2019-06-02 (3).png

 

 

Link to comment

I really like this more than the DD side of things. I always felt weird devices were immersion breaking, but this is spot on. Loving how it is working with Violate (I have PC handcuffed at the beginning because well, that makes sense). Only request, would be to try and let the PC submit to a non hostile to help her out of the handcuffs if possible, or some other way besides only being able to wiggle out. Really looking forward to seeing how this develops though. Reminds me of Sexlab Submit on the Skyrim side of things.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use