GetLockKeyTag

From NWN Lexicon
Jump to navigationJump to search



GetLockKeyTag(object)

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.

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

This function was previously noted as broken inasmuch as it returned an int rather than a string. This is certainly fixed now, and returns a string that is the tag of the key required to open oObject.

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 On Blocked event.


Version

1.30

See Also

functions: 

SetLockLockable



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