GetLockKeyTag(object)

From NWN Lexicon
Jump to navigationJump to search

Gets the tag of the key that will open the lock on an object

string GetLockKeyTag(
    object oObject
);

Parameters

oObject
The target locked object.


Description

Gets the tag of the key that will open the lock on oObject, a door, placeable or trigger (see remarks on triggers).

If the string is empty "", but GetLockKeyRequired() is TRUE, then there is no key that can open the door (although DM unlock can unlock anything) as keys need to have tags.


Remarks

It would be most useful if you needed to find out if oObject can be unlocked by a person, as GetItemPossessedBy() will work well dynamically with GetLockKeyTag(). Mainly, henchmen might want to use this to know if they can unlock a door in the OnBlocked event.

You can also use a key tag on triggers but they don't functionally have a lock so by default don't check for it, but you can do a custom check in OnAreaTransitionClick for it.


See Also

functions: 

SetLockLockable SetLockKeyTag



 author: GoLeM, editor: Jasperre, Mistress, additional contributor(s): Lilac Soul