Editing
GetLockLevel - ObjectReference
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
[[Category:Scripting]] [[Category:Papyrus]] '''Member of:''' [[ObjectReference Script]] 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. == Syntax == <syntaxhighlight lang="papyrus"> int Function GetLockLevel() native </syntaxhighlight> == Parameters == None. == Return Value == The level of the lock attached to this object. If there is no lock, it will return 0 - very easy. Otherwise, lock level values are: * 0–1 = Novice * 2–25 = Apprentice * 26–50 = Adept * 51–75 = Expert * 76–254 = Master * 255 = Requires Key == Examples == <syntaxhighlight lang="papyrus"> ; Is the lock very easy? if (WeakChestProperty.GetLockLevel() == 0) Debug.Trace("Lock is very easy") endIf </syntaxhighlight> This function fetches the lock level for a given lock in a much more robust way, making scripting locked objects significantly easier. <syntaxhighlight lang="papyrus"> ;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 endfunction </syntaxhighlight> == See Also == *[[ObjectReference Script]] *[[Locking and Unlocking Doors]] tutorial. *[[IsLocked - ObjectReference]] *[[Lock - ObjectReference]] *[[LockDoors (Procedure)]] *[[SetLockLevel - ObjectReference]] *[[UnlockDoors (Procedure)]] *[[UnlockOwnedDoorsInCell - Actor]] *[[GetLocked]] console command. *[[GetLockLevel]] console command. *[[Lock]] console command. *[[Unlock]] console command.
Summary:
Please note that all contributions to the CreationKit Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see
CreationKit:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Landing page
Tutorials
Game Systems
Editor Reference
Scripting Reference
Recent changes
Help
Tools
What links here
Related changes
Special pages
Page information
Page values