TheWanderer001 Posted May 21, 2021 Share Posted May 21, 2021 Hi everyone... okay I've released my Ultimate Bag of Holding mod :) I'm writting a (very) short quest to add to it's backstory... If I can ever get it to work :( It already has a few extras...such as removing the stolen flag, selling items, and creating lock picks... an auto store and retrieve function... all working ;) So what am I here for ? I'm after any ideas for added features that a thief type character might find useful...I'll concider anything that is possible within the limits of the scripting and game engine :D If no one has any new ideas that's okay...I can't think of anything either :D Link to comment Share on other sites More sharing options...
IsharaMeradin Posted May 21, 2021 Share Posted May 21, 2021 Well... I suppose you could do what one of my mods does. Store keys so that the player can have a go at picking the lock instead of being forced to use the key if present. Mine goes a step further and if the player wants to use the key, they can use a user selected key bind to search for the key associated with the locked object that the cross hair is pointing at. If the key is found, transfers it and uses it, otherwise brings up the lockpicking screen. NOTE: auto storing keys is possible but I ran across mod added quests that would give a key in dialog and then require the key to be present in order to continue the dialog. Thus rather than breaking other mod quests, I do not auto store keys. I did toy with the idea of storing poisons and auto applying poisons to weapons. I got something that would work but I never incorporated it as I felt that applying poisons should be more of a case by case basis as to what type should be used. Link to comment Share on other sites More sharing options...
TheWanderer001 Posted May 21, 2021 Author Share Posted May 21, 2021 I don't auto store keys either but they can be manually added... I do have a auto retrieve all keys though... just in case :DI like the idea of finding the right key for a lock though... but couldn't find out how to do it... Is that the code in your Keyring mod? As for auto poisoning I'm with you on that one. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted May 21, 2021 Share Posted May 21, 2021 There is code for it in the keyring mod. That mod starts and stops a quest and fills aliases with nearby locked objects. It does the job but can easily miss out on the intended target. I revamped it to be done better and without issue in the inventory management system mod. I'll break it down for you if you'd like: Inside the OnKeyDown event, I get and store the crosshair target Event OnKeyDown(Int KeyCode) If KeyCode == abim_IMS_ModActKeyGV.GetValue() Ref = Game.GetCurrentCrosshairRef() EndIf EndEvent Inside the OnKeyUp event (I use hold time for a certain feature) after making sure it is safe to process the key press, I ensure that the target is a lockable object and then do the work ElseIf (((Ref.GetBaseObject().GetType() == 29) && (Ref.GetOpenState() == 3)) || (Ref.GetBaseObject().GetType() == 28)) LockedObjectPrep(Ref) The "work" is handled by these two functions: Function LockedObjectPrep(ObjectReference ObjRef) Form TheKey = GetLockedObjKey(ObjRef) If TheKey != None && (PlayerRef.GetItemCount(abim_IMS_KeyRingItem) >= 1) (abim_IMS_ModContainers.GetAt(7) as ObjectReference).RemoveItem(TheKey,1,true,PlayerRef) ObjRef.Activate(PlayerRef) Utility.Wait(0.25) While (Utility.IsInMenuMode() || (UI.IsMenuOpen("Dialogue Menu"))) Utility.wait(0.25) EndWhile PlayerRef.RemoveItem(TheKey,1,true,(abim_IMS_ModContainers.GetAt(7) as ObjectReference)) EndIf EndFunction Form Function GetLockedObjKey(ObjectReference LockedObj) If LockedObj If LockedObj.IsLocked() Key LockedObjKey = LockedObj.GetKey() If LockedObjKey Debug.Notification("Found "+LockedObjKey.GetName()) Return LockedObjKey as Form Else Debug.Notification("Key not found") Return None EndIf EndIf EndIf EndFunction Obviously, you'd need to make some changes for it to work with your mod. I can say that this is the one "system" in my inventory management mod that has not needed to have any work done to improve it in anyway. It works and works well. And it most definitely requires SKSE. Link to comment Share on other sites More sharing options...
TheWanderer001 Posted May 21, 2021 Author Share Posted May 21, 2021 My mod needs SKSE already so not a problem there :) Thanks :) Now to see if I can intregate into my mod :unsure: Link to comment Share on other sites More sharing options...
TheWanderer001 Posted May 21, 2021 Author Share Posted May 21, 2021 (edited) I've looked through the code and I think I follow it but... a real knob question :D Where do I put hte OnKeyUp and OnKeyDown events ? I've never tried to use either before... [EDIT]It's okay I think I have another way to action this... :) Edited May 21, 2021 by TheWanderer001 Link to comment Share on other sites More sharing options...
TheWanderer001 Posted May 21, 2021 Author Share Posted May 21, 2021 (edited) I'm calling this from a menu choice on the bag... ObjectReference Ref = None Function KeyRing() Ref = Game.GetCurrentCrosshairRef() If (((Ref.GetBaseObject().GetType() == 29) && (Ref.GetOpenState() == 3)) || (Ref.GetBaseObject().GetType() == 28)) If Ref.IsLocked() Key LockedObjKey = Ref.GetKey() ;Debug.Notification(".." +LockedObjKey.GetName()) Form TheKey = LockedObjKey as form If TheKey == None Debug.Notification("No key found...") Else If TWBHChestREF.GetItemCount(TheKey) > 0 TWBHChestREF.RemoveItem(TheKey,1,true,PlayerRef) Ref.Activate(PlayerRef) Utility.Wait(0.25) While (Utility.IsInMenuMode() || (UI.IsMenuOpen("Dialogue Menu"))) Utility.wait(0.25) EndWhile PlayerRef.RemoveItem(TheKey,1,true,TWBHChestREF) Endif EndIf Else Debug.Notification("No key needed...") EndIf EndIf EndFunction A quick test on one lock worked great :smile:Don't know if there is a better way to code it though ? Edited May 21, 2021 by TheWanderer001 Link to comment Share on other sites More sharing options...
IsharaMeradin Posted May 21, 2021 Share Posted May 21, 2021 I'm sure it is fine. You just need to let users know to make sure that the object itself is under the crosshair and close enough that the activation prompt appears. There are some scenarios where the camera might change causing the crosshair to no longer point at the correct object. Depending upon timing, it may not run as intended. I found this more to be an issue with animated furniture such as some of the workstations which is why I ended up storing the crosshair target in a variable rather than checking the crosshair target at each step. Link to comment Share on other sites More sharing options...
TheWanderer001 Posted May 21, 2021 Author Share Posted May 21, 2021 In my scenerio the player would have too be in sneak mode to activate the bags keys option... so hopfully that won't be a problem :) I'll come back and report if I find any problems Once again... Thank you so much for your help. Link to comment Share on other sites More sharing options...
TheWanderer001 Posted May 21, 2021 Author Share Posted May 21, 2021 I've implemented that great idea from IsHara :thumbsup: But if anyone has any other ideas I'm still interested in hearing them. :) Link to comment Share on other sites More sharing options...
Recommended Posts