Jump to content

Recommended Posts

Posted (edited)
48 minutes ago, naaitsab said:

 

Nearly got the nickname right ;)  but yeah the second option with checking the results array is far better. I'm guessing it might be due to the fact that the collar is not always on the player if in menu's etc if I recall the code correctly. To prevent modding/unequipping it. Any teasers for the new mod? :P 

If you want to reverse it, you could also trigger the explosion on the collar if the cuffs are removed by tampering. I'm not sure if you need to apply the "bomb" modification first before that can be triggered. Otherwise it might only trigger a shock.

 

Also something to check if the event is persistent between saves. Some types are not and need to be registered everytime you load a game. Another thing that can cause headaches with troubleshooting.

 

 

I uploaded some pics a month ago, which is when I started to resume the mod. It's a quest mod where the player is captured by raiders and forced to do quests for them. 

 

 

This shit is the one I'm most proud to do for myself. Using a combination of distance events and timers.    ??

 

Spoiler

 

 

 

 

 

Btw, the event is registered whenever you start the game. The collar should not come out for the duration of the mod. It's working well. 

Edited by JB.
Posted
1 hour ago, JB. said:

 

 

I uploaded some pics a month ago, which is when I started to resume the mod. It's a quest mod where the player is captured by raiders and forced to do quests for them. 

 

 

This shit is the one I'm most proud to do for myself. Using a combination of distance events and timers.    ??

 

  Reveal hidden contents

 

 

Btw, the event is registered whenever you start the game. The collar should not come out for the duration of the mod. It's working well. 

Nice looking good, see you put the template code to good use. Can't wait to give it a try ?

Posted (edited)

Hy.

 

I working on my mod, where you can switch between two resources, or scedule settlers to switch resources overtime.

It wokrs pretty well, but I want it to work with this mod too. When I call the assign command to the prisoner mat, it will assign perfectly, but I can't unassign the settler from it,

it shows both furniture assigend in the workshop editor.

Anyone can tell me how to unassign a settler from this mod's furnitures by papyrus sript?

 

I checked the code of this mod, but I just can't figure out which founction I should call for it.

 

I already tried this codes but none of it worked:

function unassign(ObjectReference settler)
	WorkshopNPCScript worker = settler as WorkshopNPCScript
	WorkshopParent.UnassignActor(worker)
endfunction
function unassign(ObjectReference settler)
	ObjectReference[] currentWorkerAssignedObjects = myWorkshop.GetWorkshopOwnedObjects(worker)
	int i = 0
	While i < currentWorkerAssignedObjects.Length
		
		WorkshopObjectScript theObject = currentWorkerAssignedObjects[i] as WorkshopObjectScript
		If theObject && !theObject.IsBed()
			Debug.Notification("unassingfromobject:" + currentWorkerAssignedObjects[i].GetDisplayName() )
			theObject.AssignActor(none)
			;WorkshopParent.UnassignActorFromObject(worker,theObject ,true)
		EndIf
		i += 1
	EndWhile
endfunction
Edited by innocentinner
Posted (edited)
On 9/8/2022 at 4:55 AM, JB. said:

This works perfectly. 

 

Event RealHandcuffs:Library.OnRestraintUnapplied(RealHandcuffs:Library akSender, Var[] akArgs)
  Actor player = PlayerREF


If _CS_Enslaved.GetValueInt() == 1
    If ((akArgs[0] as Actor) == PlayerREF) &&    (akArgs[1] as int  ==  4)
		Debug.MessageBox("Collar removed without permission. Proceeding to kill the user.")
		Utility.Wait(1)
		PlayerREF.Kill()
	EndIf
EndIf

 

 

@Kharos In case you are interested in including it in your main post, I use you handcuffs intensively in my mod Nuka Ride. I don't use the collar for plot reasons, but that will change soon in my next mod.  This would not be possible without the help of naitsaab who provided me with a template. 

 

 

 

 

I am somewhat confused... akArgs[1] should be an object reference to the restraint that was unappplied, I don't see why `akArgs[1] as int == 4` is working?
I would have expected something like:
 

Actor akActor = akArgs[0] as Actor
ObjectReference akRestraint = akArgs[1] as ObjectReference
If (akActor == PlayerRef && akRestraint.HasKeyword(RH_RestraintTypeCollar))
    ; show message then kill the player
EndIf

 

The second check is to prevent killing the player when they escape from handcuffs. This would require you to add RH_RestraintTypeCollar as a property of the script.

Edited by Kharos
Posted
10 hours ago, innocentinner said:

Hy.

 

I working on my mod, where you can switch between two resources, or scedule settlers to switch resources overtime.

It wokrs pretty well, but I want it to work with this mod too. When I call the assign command to the prisoner mat, it will assign perfectly, but I can't unassign the settler from it,

it shows both furniture assigend in the workshop editor.

Anyone can tell me how to unassign a settler from this mod's furnitures by papyrus sript?

 

I checked the code of this mod, but I just can't figure out which founction I should call for it.

 

I already tried this codes but none of it worked:

function unassign(ObjectReference settler)
	WorkshopNPCScript worker = settler as WorkshopNPCScript
	WorkshopParent.UnassignActor(worker)
endfunction
function unassign(ObjectReference settler)
	ObjectReference[] currentWorkerAssignedObjects = myWorkshop.GetWorkshopOwnedObjects(worker)
	int i = 0
	While i < currentWorkerAssignedObjects.Length
		
		WorkshopObjectScript theObject = currentWorkerAssignedObjects[i] as WorkshopObjectScript
		If theObject && !theObject.IsBed()
			Debug.Notification("unassingfromobject:" + currentWorkerAssignedObjects[i].GetDisplayName() )
			theObject.AssignActor(none)
			;WorkshopParent.UnassignActorFromObject(worker,theObject ,true)
		EndIf
		i += 1
	EndWhile
endfunction

 

Hmm, the AssignActor(none) should work in theory, not sure why it does not. The prisoner mat has logic that prevents the game from automatically re-assigning the settler to something else, maybe that code is interfering?

 

You can try to cast the workshop object to RealHandcuffs:PrisonerMat and call `Unregister(worker)` to tell the prisoner mat that it should release the worker:

RealHandcuffs:PrisonerMat pMat = (theObject as ObjectReference) as RealHandcuffs:PrisonerMat
If (pMat)
    pMat.Unregister(worker) ; special handling for prisoner mats
EndIf


 

Posted
50 minutes ago, Kharos said:

 

I am somewhat confused... akArgs[1] should be an object reference to the restraint that was unappplied, I don't see why `akArgs[1] as int == 4` is working?
I would have expected something like:
 

Actor akActor = akArgs[0] as Actor
ObjectReference akRestraint = akArgs[1] as ObjectReference
If (akActor == PlayerRef && akRestraint.HasKeyword(RH_RestraintTypeCollar))
    ; show message then kill the player
EndIf

 

The second check is to prevent killing the player when they escape from handcuffs. This would require you to add RH_RestraintTypeCollar as a property of the script.

Maybe casting the objectreference as a int makes the script engine spasm? Of it's just default behavior to go into the if loop if the condition is borked. Would the RH_RestraintTypeCollar keyword also cover the dummy collar? 

Posted
1 hour ago, naaitsab said:

Maybe casting the objectreference as a int makes the script engine spasm? Of it's just default behavior to go into the if loop if the condition is borked. Would the RH_RestraintTypeCollar keyword also cover the dummy collar? 

 

My best guess is that casting to int will fail and always be false, but I don't know without trying it out.

 

You should never get a dummy collar in this event. The event is triggered when an actor is freed from a restraint, and you will always get the real restraint here. That being said, the dummy collar has the RH_RestraintTypeCollar keyword, too. I set it up like that on purpose to allow detecting that an actor is wearing a collar by using the WornHasKeyword condition function, for example in dialogs.

Posted
1 hour ago, Kharos said:

 

My best guess is that casting to int will fail and always be false, but I don't know without trying it out.

 

You should never get a dummy collar in this event. The event is triggered when an actor is freed from a restraint, and you will always get the real restraint here. That being said, the dummy collar has the RH_RestraintTypeCollar keyword, too. I set it up like that on purpose to allow detecting that an actor is wearing a collar by using the WornHasKeyword condition function, for example in dialogs.

The check was made against the keyword RH_ma_shockcollar I guess that caused the issue. As the restrainttype is indeed the better choice for checks in code/dialogue.

Posted
1 hour ago, naaitsab said:

The check was made against the keyword RH_ma_shockcollar I guess that caused the issue. As the restrainttype is indeed the better choice for checks in code/dialogue.

 

The RH_ma_* keywords are for the crafting system, they tell the game if a mod is compatible with an item - you can see that if you look at the keyword type, it is "Mod Association". I did not put them on the dummy items because these cannot be used for crafting. In theory you should not use these keywords in conditions, they might change if the crafting system changes  - in practice this will never happen.

 

I created RH_RestraintType* keywords to tag the restraints with their "type", these should indeed be preferred for condition checks:

  • RH_RestraintTypeCollar
  • RH_RestraintTypeHandcuffs
  • RH_RestraintTypeBracelet (for broken handcuffs)
Posted
9 hours ago, Kharos said:

 

Hmm, the AssignActor(none) should work in theory, not sure why it does not. The prisoner mat has logic that prevents the game from automatically re-assigning the settler to something else, maybe that code is interfering?

 

You can try to cast the workshop object to RealHandcuffs:PrisonerMat and call `Unregister(worker)` to tell the prisoner mat that it should release the worker:

RealHandcuffs:PrisonerMat pMat = (theObject as ObjectReference) as RealHandcuffs:PrisonerMat
If (pMat)
    pMat.Unregister(worker) ; special handling for prisoner mats
EndIf


 

This is perfect, thank you. Now it works flawlesly with the prisoner mats too.

Posted

I love this mod and it is always in my load order for Fallout. I would love to have it available to use with Skyrim.

Posted
48 minutes ago, Andrei S said:

I seem to be uable to wear handcuffs with any clothes, if i put on the handcuffs armor stays on but all clothes unequips, is this normal behaviour?

No it's not normal, unless you have some weird outfits. RH uses slot 54-Unnamed, or 37-L Arm, 38-R Arm if you use the Devious Devices patch.

Posted
2 hours ago, izzyknows said:

No it's not normal, unless you have some weird outfits. RH uses slot 54-Unnamed, or 37-L Arm, 38-R Arm if you use the Devious Devices patch.

It happened with vanila outfits too, but i solved it by reinstalling the mod and choosing to keep original slot instead of DD ones, now everytnig is working as it should, which is a bit strange because i can use DDs hand restraints with clothes just fine

 

Posted
1 hour ago, Andrei S said:

It happened with vanila outfits too, but i solved it by reinstalling the mod and choosing to keep original slot instead of DD ones, now everytnig is working as it should, which is a bit strange because i can use DDs hand restraints with clothes just fine

 

Something didn't install correctly the first time. I use the DD compatibility patch (RealHandcuffs_DD_Compatibility.esp) with no issues. Almost sounds like the patch didn't install and the game got its panties in a bunch.

Posted
1 hour ago, Andrei S said:

It happened with vanila outfits too, but i solved it by reinstalling the mod and choosing to keep original slot instead of DD ones, now everytnig is working as it should, which is a bit strange because i can use DDs hand restraints with clothes just fine

 

 

Many vanilla outfits cover the underarmor arm slots, unless you use patches like AWKCR/AE which remove those.

Posted (edited)

i'm sorry if this has already been addressed...i am having a problem...my followers will not remove their hands from behind their backs even though they don't have handcuffs on them...and every time i fast travel wherever i end up i am handcuffed...i'm also using violate mod if this helps...i'm wondering if the violate mod is causing the problem? any help would be greatly appreciated

Edited by Balboa2151
Posted (edited)
7 hours ago, Balboa2151 said:

i'm sorry if this has already been addressed...i am having a problem...my followers will not remove their hands from behind their backs even though they don't have handcuffs on them...and every time i fast travel wherever i end up i am handcuffed...i'm also using violate mod if this helps...i'm wondering if the violate mod is causing the problem? any help would be greatly appreciated

 

Please open the MCM -> Real Handcuffs -> Debug, there should be a section that says 14 (Name of your character) (sex of your character), below that it should tell you whether the mod thinks that you are currently wearing restraints or not. Then exit MCM and go close to your follower (close enough that you get the talk prompt). Then do the same, now it should tell you whether the mod thinks that your follower is wearing restraints or not.

If you think that it is caused by violate then you may need to ask in the thread for violate.

Edited by Kharos
Posted

Not sure what to do but whenever I install this mod, my frames instantly drop. I can disable the mod and everything works again. Its just really buggy. Does anyone have any idea where to start looking? 

Posted

I'll load a saved game and get an "error" message that handcuffs have been removed from an NPC from time to time. also it seems regular cuffs are incompatible with some clothing options. If you apply them, they NPC goes nude. Just FYI

Posted
3 hours ago, Sasha L. Cohen said:

I'll load a saved game and get an "error" message that handcuffs have been removed from an NPC from time to time. also it seems regular cuffs are incompatible with some clothing options. If you apply them, they NPC goes nude. Just FYI

 

If you enable the Devious Devices compatibility option in the FOMOD installer menu, then the cuffs will use a different slot which doesn't conflict with underarmor.

Posted
On 10/2/2022 at 7:51 PM, vaultbait said:

 

If you enable the Devious Devices compatibility option in the FOMOD installer menu, then the cuffs will use a different slot which doesn't conflict with underarmor.

 

That actually depends on what other mods you have. The DD compatibility option works well if you have Armorsmith Extended. Without it the DD slots will conflict with a lot of clothing and you are probably better off with the "standard" slot.

Posted
13 minutes ago, Kharos said:

That actually depends on what other mods you have. The DD compatibility option works well if you have Armorsmith Extended. Without it the DD slots will conflict with a lot of clothing and you are probably better off with the "standard" slot.

 

Oh, indeed it appears to be the other way around from what I thought.  Seems handcuffs occupy the "unarmed" slot (54) normally, but switch to the underarmor arm slots (37/38) with the DD compat patch. Also because that patch applies keywords from DD, it requires DD's plugin (so only usable if you have that installed anyway).

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...