Description
Wiki Description
Returns the level of the lock attached to this object. This number can be anything from 0-255, with different values representing lock difficulties (Novice–Expert). If there is no lock, it will return 0 - very easy.
Documentation Comment
Get the level of the lock on this object
Caveats
Examples
; Is the lock very easy?
if (WeakChestProperty.GetLockLevel() == 0)
Debug.Trace("Lock is very easy")
endIf;sanitizes lock level
;0 = unlocked, 1 = novice, 2 = apprentice, 3 = adept, 4 = expert, 5 = master, 6 = key
int function SanitizeLockLevel(ObjectReference lock)
int level = lock.GetLockLevel()
if !lock.IsLocked()
return 0
endif
if level == 0 || level == 1 ;novice
return 1
elseif level >= 2 && level <= 25 ;Apprentice
return 2
elseif level >= 26 && level <= 50 ;Adept
return 3
elseif level >= 51 && level <= 75 ;Expert
return 4
elseif level >= 76 && level <= 254 ;Master
return 5
else
return 6
endif
endfunctionAuto-Generated Example
int returnedValue = myObjectReference__toCallFunctionOn.GetLockLevel()Related Pages
- Locking and Unlocking Doors tutorial.
- ObjectReference.IsLocked()
- ObjectReference.Lock(...)
- LockDoors (Procedure)
- ObjectReference.SetLockLevel(...)
- UnlockDoors (Procedure)
- Actor.UnLockOwnedDoorsInCell()
- GetLocked console command.
- GetLockLevel console command.
- Lock console command.
- Unlock console command.
