Anyway to detect if player is lockpicking?
Posted: 18 Jun 2021, 22:33
Hi there, Morrowind modding newb here. I'm trying to make a mod to add an equipable key that will unlock and relock a door associated with it. The easiest I've found to do this so far is create a new lockpick and change the mesh to that of the key. The lockpick has the animation and partial functionality I'm looking for, but right now I've got a script on the load door that is supposed to check for right key and then do the locking/unlocking etc, but can't find a way to actually detect if player is making a lockpick attempt (Something like HitAttemptOnMe, but for a door/container). I've been googling and digging through the Scripting for Dummies guide but haven't found anything.
Here's my current script: a makeshift attempt that achieves basically the same functionality using OnActivate, which I'd prefer to not use so the player can actually "use" the key and have the animation.
Not sure if what I want is possible until the big dehardcoding but I am new to this so wanted to see if anyone knew and hear your thoughts!
Cheers!
VonCookies
Here's my current script: a makeshift attempt that achieves basically the same functionality using OnActivate, which I'd prefer to not use so the player can actually "use" the key and have the animation.
Code: Select all
if (OnActivate == 1)
set hasKey to (player->HasItemEquipped "key_vorar_equip")
if hasKey == 1
if(GetLocked == 0)
Lock 35
PlaySound3D, "Open Lock Fail"
else
Unlock
PlaySound3D, "Open Lock"
endif
else
Activate
endif
endif
Cheers!
VonCookies