Jump to content

Turn the skeleton Key into an actual KEY


Swordsguy2010

Recommended Posts

Going through the thieves guild quest atm, i acquired the Skeleton key and after trying to use it, its used like ..a lockpick :/ ... i find it rather stupid that you use the KEY, the Skeleton key, which are KEYS that you can open any lock with.... as a mere LOCKPICK!...smh that is completely stupid, its a KEY not a lockpick, it should just be used ..as a universal KEY.


You walk up to any locked door( actual doors with things behind them, not decor doors that open to nothing) and click on it and Bamb its unlocked like you had the key for it and through the door you go. thats how it really should work imo. because its a KEY. thats akin to (irl) using your house front door key as a lock pick to open your front door instead of just you know sticking the key in and turning it you know? it's retarded. could someone PLEASE fix this?

Edited by Swordsguy2010
Link to comment
Share on other sites

  • 2 months later...

Unfortunately, locked doors have their own unique key. The doors would not be able to recognize the Skeleton Key. That said, perhaps some additional coding along with some stuff from my key ring mod as well as SKSE, locked doors could be opened without going through the lock screen. What would really happen is a check for the Skeleton Key and if present, add the real key to the player inventory, open the door, then remove the real key from the player's inventory.

 

*digs into the files*

 

The following function returns the key if any for the passed in locked object.

 

 

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

Notification statements are present for purposes of ensuring that it indeed works as well as feedback for when this function was used in conjunction with the key ring. You may not need them or may wish to change what they say.

 

 

  • In the standalone key ring mod, I used some slightly unreliable code to interrupt the activation of the locked object by starting a quest that would grab the closest locked object. Problems arose if two or more such objects were nearby.
  • In the released version of inventory management system, the key ring simply requires the cross hair to be pointed at the door. More reliable but the event OnCrosshairRefChange is triggered every time the crosshair points at something new. Thus extensive conditioning was required and it still performed unnecessary processing.
  • In the unreleased version of inventory management system (which was/is waiting for SKSE64 to not be in alpha), the player would be required to manually point at the door and press a designated hotkey.

 

At any rate, how you get the locked object to pass into the function is up to you.

 

So, to do what I mentioned earlier...

Obtain your locked object and pass it into the following function. Don't forget to include the GetLockedObjKey function higher up in this post.

 

 

Function SkeletonKeyOpensLikeAKey(ObjectReference ObjRef)
  Form TheKey = GetLockedObjKey(ObjRef) 
  Actor PlayerRef = Game.GetPlayer() ; <-- remove this line if defined at a higher level on the script.
  If (TheKey != None) && (PlayerRef.GetItemCount(SkeletonKey) >= 1)
    PlayerRef.AddItem(TheKey)
    ObjRef.Activate(PlayerRef)
    Utility.Wait(0.25)
    ;following is a precautionary 'loop' for fringe cases
    While (Utility.IsInMenuMode() || (UI.IsMenuOpen("Dialogue Menu")))
      Utility.wait(0.25)
    EndWhile
    PlayerRef.RemoveItem(TheKey,1,true)
  EndIf
EndFunction

 

 

 

FYI - Posting of this information in a public location means that you've got my permission to use these snippets of code. No need to ask. :smile:

Link to comment
Share on other sites

  • Recently Browsing   0 members

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