Kharos Posted June 2, 2024 Posted June 2, 2024 (edited) On 6/1/2024 at 3:19 PM, EgoBallistic said: This is to handle the case where sometimes unloaded NPCs will reload with their default outfit equipped. Depending on the base outfit, this could lead to cases like a naked tied-up NPC respawning with their leg armor equipped. It wasn't a super common occurrence but at the time I was trying to squash every annoying engine behavior. You could always modify HandleOnItemEquipped and remove the "akActor != KZEB_API.PlayerRef ||" part of the condition. @EgoBallistic Bug report: When I call KZEB_API.UnequipDevice(..), this does NOT result in a call to DisableDevice(). So the device stays "enabled"; and when I then use EquipDevice(..) to equip a vanilla item to the NPC, the device will unequip that vanilla item and re-equip itself 😞. [Edit] I just realized that this could also be the source of the few times where my player suddenly ended up wearing a device that I removed from an NPC (delayed events + device staying active when I moved it to my inventory). [Edited propsal] Also I have a proposal: While I can put special keywords on custom items and then add them to KZEB_NoRemoveKeywords to exclude them from the removal logic, this will not work for vanilla items. Can I instead put a special keyword on the NPC? I realize that I could instead temporarily set GlobalUnlock and then clear it again when I am done, but modifying global state like that has the disadvantage that it will cause issues on parallel event handlers to multiple NPCs. Edited June 2, 2024 by Kharos
stickpin Posted June 2, 2024 Posted June 2, 2024 (edited) Short version - would you be opposed to adding some notification events to help out mod authors? Detailed Thoughts First of all very nice mod. Everything is looking good and working well. I've been playing with it for a couple of weeks now, both as a player and as a beginning mod author. I added support for this to a mod I created for myself to handle equipping devices from DD and this, basically a mix of features inspired by the various old equipping mods. I have several ideas and suggestions for your mod if you are interested in general feedback. The last couple of days I've been trying to expand on the equip/unequip mechanism and make it more complex with things like letting the player equip unlocked (prompt after they equip from inventory) and escape cooldowns for various types of attempts. I want to track the specific device object instance as the script may have changed properties from the base object. That is one thing I love about your system and I use it to create quest devices, without needing to make new forms, via the permanent keyword and such. Trying to get the object reference after the fact I've learned is not an easy thing in the game. Many times it's even impossible, such as if the item was added to the player's inventory. I spent many frustrating hours trying to research and experiment with that. Unless I missed something you basically have to store the reference at time of creation or have the script attached to it internally feed itself to other functions. Since I didn't create the reference (such as an item equipped from inventory) I can't act on every possible device instance, just the ones I created and only until the player removes them. I see you have a tracked items RefCollectionAlias in the API and I initially tried to use that but I didn't have much luck. It seemed inconsistent as to when things were added or removed from it. I also had trouble finding the specific device I was after. For example, if I equipped a device that was already in my inventory, say a Yoke, it would not always modify the tracked items. Furthermore the API PlayerHandRestraints, which contained the Yoke, was not in the tracked item. I might have made some mistakes or been approaching things wrong but I don't think so. I have an alternate idea and wanted to know if you'd be opposed to having some custom event notifications in the mod. What I'm thinking is that when the script for the object reference equips or unequips the device it would send a custom event containing itself. Because it sends itself any property changes for that specific instance would come along too. Then mod authors, like myself, could subscribe to the event and take whatever action they wished, such as storing the object reference for later reference. That would both make things more flexible and move the burden off your mod and onto others who want to track things. This could look like: Spoiler ; Adustmens to KZEB:KZEB_API ; Added Custom Event Definition CustomEvent DeviceWasUnequipped CustomEvent DeviceWasEquipped ; Added Functions Function NotifyDeviceWasEquipped(KZEB:KZEB_BondageDeviceScript akDevice, Actor akActor) Var[] kargs = new Var[2] kargs[0] = akDevice kargs[1] = akActor SendCustomEvent("DeviceWasEquipped", kargs) EndFunction Function NotifyDeviceWasUnequipped(KZEB:KZEB_BondageDeviceScript akDevice, Actor akActor) Var[] kargs = new Var[2] kargs[0] = akDevice kargs[1] = akActor SendCustomEvent("DeviceWasUnequipped", kargs) EndFunction ; Adjustments to KZEB:KZEB_BondageDeviceScript ; Picked the two obvious ones but not sure about the other handlers, like for Actor.X events. Event OnEquipped(Actor akActor) ... KZEB_API.NotifyDeviceWasEquipped(Self, akActor) ... EndEvent Event OnUnequipped(Actor akActor) ... KZEB_API.NotifyDeviceWasUnequipped(Self, akActor) EndEvent ; Example by mod authors, such as my script: Event KZEB:KZEB_API.DeviceWasEquipped(KZEB:KZEB_API sender, Var[] args) KZEB:KZEB_BondageDeviceScript device = args[0] as KZEB:KZEB_BondageDeviceScript if (!device) return endif Actor target = args[1] as Actor if (target != PlayerRef) return endif Debug.Trace("Was Equipped Event") EndEvent Event KZEB:KZEB_API.DeviceWasUnequipped(KZEB:KZEB_API sender, Var[] args) KZEB:KZEB_BondageDeviceScript device = args[0] as KZEB:KZEB_BondageDeviceScript if (!device) return endif Actor target = args[1] as Actor if (target != PlayerRef) return endif Debug.Trace("Was Unequipped Event") EndEvent If you like the idea, and even the code, you are welcome to run with it as you see fit. If not let me know and I'll avoid using something like this in my mod. Thanks and again, great work on the mod. Edited June 2, 2024 by stickpin Fixed type.
wssb2024 Posted June 3, 2024 Posted June 3, 2024 On 6/2/2024 at 12:03 AM, JB. said. Look at this, this is exactly what I was looking for! Please tell me it's still in development!🤩
Ichabod Posted June 4, 2024 Posted June 4, 2024 Love this mod. The struggle animations are superb. Can't imagine playing FO without this now. One minor issue I noticed is if you escape from just struggling, it removes the arm restraints so you can access the pipboy. After that the struggle option is lost and you cannot struggle/untie your leg restraints or gag without a suitable key/blade. Makes sense for metal restraints but it would be nice if tape/rope should be just removable with free hands and a bit of time or more struggling. Thank you again for this work of art. 2
EgoBallistic Posted June 4, 2024 Author Posted June 4, 2024 On 6/2/2024 at 11:18 AM, Kharos said: Bug report: When I call KZEB_API.UnequipDevice(..), this does NOT result in a call to DisableDevice(). So the device stays "enabled"; and when I then use EquipDevice(..) to equip a vanilla item to the NPC, the device will unequip that vanilla item and re-equip itself I didn't make devices DisableDevice() themselves on unequip due to the performance hit re-enabling a device causes (it has to drop() itself, add itself to the tracked items list to become persistent, etc). But devices that are unequipped unregister themselves for events from the wearer so they shouldn't react to new items being equipped. I wonder if this isn't a timing issue. Calling UnequipDevice() and then immediately calling EquipItem() with a new armor could cause issues if the new item gets equipped before the unequip handler finishes. The OnUnequipped handler does a couple of things before calling UnregisterForAllEvents(), I'll move it before those and see if that helps. 1
nasgektw Posted June 4, 2024 Posted June 4, 2024 I'm working on a new quest mod and I would like to use this... Is it possible to make the items only escapable by script? (Eg: metal or amputation) 1
Kharos Posted June 4, 2024 Posted June 4, 2024 (edited) 6 hours ago, EgoBallistic said: I didn't make devices DisableDevice() themselves on unequip due to the performance hit re-enabling a device causes (it has to drop() itself, add itself to the tracked items list to become persistent, etc). But devices that are unequipped unregister themselves for events from the wearer so they shouldn't react to new items being equipped. I wonder if this isn't a timing issue. Calling UnequipDevice() and then immediately calling EquipItem() with a new armor could cause issues if the new item gets equipped before the unequip handler finishes. The OnUnequipped handler does a couple of things before calling UnregisterForAllEvents(), I'll move it before those and see if that helps. You are right, I just retested with another NPC and it works (CQF KZEB_MainQuest UnequipDevice <npc> <device>, then waited 10 seconds, then CF "Actor.EquipItem" <armor>, and it equips the armor keeping the device unequipped. I apologize for the bad bug report 😞. On the other hand I have another NPC (the one that I tested with before making the bug report) and with that NPC the same steps result in the armor being unequipped and the device being re-equipped. Something is clearly broken with events of that NPC; upon looking closer I can see that the face keeps the "gagged" expression even after the UnequipDevice call 😖. [Edit] I just realized that I have been using EquipDevice with an armor id to equip a device that is already in the NPC inventory - which is wrong, it will instead equip a new copy of the device. She had 8 instances of the same gag; after removing 7 of them, the strange behavior stopped. So most probably some event handling went bad with the large number of copies of the same device. Edited June 4, 2024 by Kharos 1
stickpin Posted June 4, 2024 Posted June 4, 2024 1 hour ago, nasgektw said: I'm working on a new quest mod and I would like to use this... Is it possible to make the items only escapable by script? (Eg: metal or amputation) I do something similar in my mod for a quest with this sample code: ObjectReference ref = Api.CreateDevice(PlayerRef, deviceBase, bInitiallyDisabled = true) KZEB:KZEB_BondageDeviceScript script = ref as KZEB:KZEB_BondageDeviceScript script.OnlyKeyUnlocks = true script.UnlockDeviceKeyword = myQuestKey script.AddKeyword(Api.KZEB_Difficulty_Permanent) Api.EquipDevice(PlayerRef, script) Sorry for the abnormal naming convention, too many years programming in C# to change my habits and mental space. The three key parts are the "script.X" bits. Those will help prevent the built in KFT system from removing the devices by aborting struggles and forcing the percent escape change to 0%. Use whatever keyword you'd like to mark the device as belonging to your mod. I've only testing it on a quest which runs when starting the game (in the vault) so there was no Pip-Boy or player ability to unequip. I have another quest after leaving the vault but I've not fully tested that yet. From reading the source script I think for things that restrict the hands, like a Yoke, it will be fine. For others that allow user unequip I'm not sure it would block that action. 1
roflmaones Posted June 5, 2024 Posted June 5, 2024 i am so sad that my 7 year savegame use cbbe and no fg... ;( 1
swearee Posted June 5, 2024 Posted June 5, 2024 (edited) Excellent mod. If there was one comment on potential enhancements, and it's a minor one at that, here are some considerations on item slots for maximum compatibility with other similarly themed mods: Since the breast bondage items change the shape of breasts, they will cause with any piercing mods using body gen to disappear or clip. Would be great if there was a way to "capture" the body gen adjustments of the breast bondage items so they can equipped at the same time as piercings Most shoes from other mods use the same slot as the torso bindings (i.e. tape, rope, mitten bounds, etc.). So it's hard to avoid being barefoot with a bound torso in the current item slot configuration. Understand that the bindings sometimes need to change the shape of the body, so it may be unavoidable to use that item slot, but if there is an alternative, would be great to explore. But regardless, great work. Edited June 5, 2024 by swearee
BlueYellowGreenRed Posted June 6, 2024 Posted June 6, 2024 Hello. Wondering if someone can help me. Recently got a new PC and unfortunately needed to reinstall FO4 again. I've had to downgrade to the old build which works fine, however I'm having some issues with Kziitd toolset crashing my game on start up, The Beth logo flashes then CTD. When I uninstall Kziitd the game starts up like normal? I have all dependencies for it, no issues flag up on vortex. I've tried disabling all non important mods and just running them and the toolset.. but still crashes.. Any help or advice would be appreciated. I have the crash log attached. Having the same issue with Zazout4. Also load order is a work in progress still sorting it out crash-2024-06-06-15-28-41.log.txt
axel9fr Posted June 6, 2024 Posted June 6, 2024 (edited) Hi ! I use your mod with Wastland of Depravity mod list. It really immersive... but maybe a few much. How can I remove BDSM gear (glove) witohout Struggle (because after 1 hour to do it PC does't free). So I have try to go to diamont city to talk some freindly NPC to free my PC but... no option. I know it's not cover by your mod, but maybe there are some mod to add some help to be free ? I will be annoyed to cheat... Edited June 6, 2024 by axel9fr
valcon767 Posted June 7, 2024 Posted June 7, 2024 10 hours ago, axel9fr said: Hi ! I use your mod with Wastland of Depravity mod list. It really immersive... but maybe a few much. How can I remove BDSM gear (glove) witohout Struggle (because after 1 hour to do it PC does't free). So I have try to go to diamont city to talk some freindly NPC to free my PC but... no option. I know it's not cover by your mod, but maybe there are some mod to add some help to be free ? I will be annoyed to cheat... hmm - you might want to try this mod https://www.loverslab.com/files/file/17448-dd-armorbench-unlocker/ version 1.08 can unlock KFT stuff and depending on settings you might feel it is a "cheat" but it is adjustable (MCM) there are more mods that can do it also, but i prefer the unlocker because first you have to find an armor bench, then pay as well to unlock stuff. with the pricing being adjustable you can set that part to taste, but it still takes some effort to use due to having to find an armor bench (yes i know they can be found in a fair amount of locations, but still feels better than just using an MCM or "remove this now" dialogue.
axel9fr Posted June 7, 2024 Posted June 7, 2024 Is there nothing else working with harassment or with ally ? For example ask to Canigou to help you ?
kziitd Posted June 7, 2024 Posted June 7, 2024 39 minutes ago, axel9fr said: Is there nothing else working with harassment or with ally ? For example ask to Canigou to help you ? The author has not yet updated for the latest KFT, so the companion's help function is currently invalid, but generally NPCs will help you.
stickpin Posted June 7, 2024 Posted June 7, 2024 On 6/2/2024 at 3:24 PM, stickpin said: Short version - would you be opposed to adding some notification events to help out mod authors? Detailed Thoughts First of all very nice mod. Everything is looking good and working well. ... No thoughts on my post and question from earlier @EgoBallistic? I realize it was a little long so maybe you haven't had time to consider it or just missed it in passing. I'm thinking of release my mod in the near future and without this event notification I'll have to remove one of the features. Or, if you would be okay with it, I can have it install modified KFT scripts with just those lines of code changed as I described in the post. Then a player could choose to add in the ability when they install the mod. I don't want to step on or modify your work though if you don't want that. Thanks for any thoughts or insights you have.
EgoBallistic Posted June 7, 2024 Author Posted June 7, 2024 1 hour ago, stickpin said: No thoughts on my post and question from earlier @EgoBallistic? I realize it was a little long so maybe you haven't had time to consider it or just missed it in passing. I'm thinking of release my mod in the near future and without this event notification I'll have to remove one of the features. Or, if you would be okay with it, I can have it install modified KFT scripts with just those lines of code changed as I described in the post. Then a player could choose to add in the ability when they install the mod. I don't want to step on or modify your work though if you don't want that. I've had a very strange and busy week, I meant to come back and answer your original post. I like the idea of adding the equip/unequip events, I'll add that feature this weekend and update the mod. 1
stickpin Posted June 7, 2024 Posted June 7, 2024 1 hour ago, EgoBallistic said: I've had a very strange and busy week, I meant to come back and answer your original post. I like the idea of adding the equip/unequip events, I'll add that feature this weekend and update the mod. Thank you very much. No worries on the delay. I understand people have lives and other things to do as well as creating or working on mods. 2
thc.delta9 Posted June 7, 2024 Posted June 7, 2024 Hey! It's a real gem of a mod! I love every bit of it. I can't imagine playing my FO4 without it, soo huuuuge thanks! One question, so after AAF Violate my gal was equipped with the gag. And now when I try to remove it, it just keeps reequipping itself, tried to drop the gag on the floor or to put in the container, but the new gag appears in my inventory and keeps reequipping itself on my gal. Sorry, I tried to read thru all posts to find a solution, but couldn't find one. Could you please tell me how to tackle this problem? Thanks a lot! P.S. With global unlock the problem goes away, but as soon as I turn it off, the "demon" gag returns and reequips itself o_O Thanks again for such a wonderful mod for all us pervy-pervs out there XD
EgoBallistic Posted June 8, 2024 Author Posted June 8, 2024 15 hours ago, thc.delta9 said: P.S. With global unlock the problem goes away, but as soon as I turn it off, the "demon" gag returns and reequips itself o_O That is very strange. Are you running the latest version of KFT? There was a bug in an earlier version that caused this to happen. If all else fails, go to a settlement that you own, drop the gag on the ground, then go into workshop mode and destroy the gag. That will remove it from the game entirely and it should no longer try to reequip itself.
EgoBallistic Posted June 8, 2024 Author Posted June 8, 2024 On 6/6/2024 at 11:31 AM, BlueYellowGreenRed said: Hello. Wondering if someone can help me. Recently got a new PC and unfortunately needed to reinstall FO4 again. I've had to downgrade to the old build which works fine, however I'm having some issues with Kziitd toolset crashing my game on start up, The Beth logo flashes then CTD. When I uninstall Kziitd the game starts up like normal? I have all dependencies for it, no issues flag up on vortex. I've tried disabling all non important mods and just running them and the toolset.. but still crashes.. You are getting the "Fallout4.exe+1B938F0" crash, which is the Windows 11 + Vortex issue. It seems to be a file access issue in the Meshes\AnimationData folder. I have no idea how to fix it or what actually causes it. Everyone who has reported this problem says it went away when they switched from Vortex to MO2.
vaultbait Posted June 8, 2024 Posted June 8, 2024 1 hour ago, EgoBallistic said: You are getting the "Fallout4.exe+1B938F0" crash, which is the Windows 11 + Vortex issue. It seems to be a file access issue in the Meshes\AnimationData folder. I have no idea how to fix it or what actually causes it. Everyone who has reported this problem says it went away when they switched from Vortex to MO2. But also there are plenty of us using Vortex on Windows 11, so it could be a Vortex-specific setting that differs between installations I suppose. Might be related to using Move Deployment instead of Hardlink Deployment or maybe one of the symlink elevation settings, or whether the game files are on a different drive from the staging tree. 1
BlueYellowGreenRed Posted June 8, 2024 Posted June 8, 2024 3 hours ago, vaultbait said: But also there are plenty of us using Vortex on Windows 11, so it could be a Vortex-specific setting that differs between installations I suppose. Might be related to using Move Deployment instead of Hardlink Deployment or maybe one of the symlink elevation settings, or whether the game files are on a different drive from the staging tree. I've changed to Move deployment and ill see if that will do anything. I doubt its an issue with different hard drives, I have everything on a 4T SSD. Ill look into the symlink. If that dont work, MO2 it is I guess..
BlueYellowGreenRed Posted June 9, 2024 Posted June 9, 2024 20 hours ago, EgoBallistic said: You are getting the "Fallout4.exe+1B938F0" crash, which is the Windows 11 + Vortex issue. It seems to be a file access issue in the Meshes\AnimationData folder. I have no idea how to fix it or what actually causes it. Everyone who has reported this problem says it went away when they switched from Vortex to MO2. I switched to MO2, works flawlessly. Wasted so much time trying to sort it out with vortex. I just needed someone to tell me to switch to MO2 aha 1
EgoBallistic Posted June 9, 2024 Author Posted June 9, 2024 New Version KFT 1.0 Beta 2.4 Uploaded Added DeviceEquipped and DeviceUnequipped custom events for mod authors, sent by devices when equipped or unequipped. See this post for API documentation and examples. 10
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