Lockable
Part of openmw.types
Usage:
local Lockable = require('openmw.types').Lockable
Type types
| types.Lockable |
#Lockable functions |
Type Lockable
| Lockable.getKeyRecord(object) |
Returns the key record of a lockable object(door, container) |
| Lockable.getLockLevel(object) |
Returns the lock level of a lockable object(door, container). |
| Lockable.getTrapSpell(object) |
Returns the trap spell of a lockable object(door, container) |
| Lockable.isLocked(object) |
Returns true if the lockable object is locked, and false if it is not. |
| Lockable.lock(object, lockLevel) |
Sets the lock level level of a lockable object(door, container);Locks if not already locked; Must be used in a global script. |
| Lockable.setKeyRecord(object, miscOrId) |
Sets the key of a lockable object(door, container); removes it if empty string is provided. |
| Lockable.setTrapSpell(object, spellOrId) |
Sets the trap spell of a lockable object(door, container); removes it if empty string is provided. |
| Lockable.unlock(object) |
Unlocks the lockable object. |
Type types
Field(s)
- #Lockable types.Lockable
-
#Lockable functions
Type Lockable
Field(s)
- Lockable.getKeyRecord(object)
-
Returns the key record of a lockable object(door, container)
Parameter
-
openmw.core#GameObject object:
Return value
-
- Lockable.getLockLevel(object)
-
Returns the lock level of a lockable object(door, container).
Does not determine if an object is locked or not, if an object is locked while this is set above 0, this value will be used if no other value is specified.
Parameter
-
openmw.core#GameObject object:
Return value
#number:
-
- Lockable.getTrapSpell(object)
-
Returns the trap spell of a lockable object(door, container)
Parameter
-
openmw.core#GameObject object:
Return value
-
- Lockable.isLocked(object)
-
Returns true if the lockable object is locked, and false if it is not.
Parameter
-
openmw.core#GameObject object:
Return value
#boolean:
-
- Lockable.lock(object, lockLevel)
-
Sets the lock level level of a lockable object(door, container);Locks if not already locked; Must be used in a global script.
Parameters
-
openmw.core#GameObject object: -
#number lockLevel: Level to lock the object at. Optional, if not specified, then 1 will be used, or the previous level if it was locked before.
-
- Lockable.setKeyRecord(object, miscOrId)
-
Sets the key of a lockable object(door, container); removes it if empty string is provided.
Must be used in a global script.
Parameters
-
openmw.core#GameObject object: -
#any miscOrId: #MiscellaneousRecord or string misc item id Record ID of the key to use.
-
- Lockable.setTrapSpell(object, spellOrId)
-
Sets the trap spell of a lockable object(door, container); removes it if empty string is provided.
Must be used in a global script.
Parameters
-
openmw.core#GameObject object: -
#any spellOrId: openmw.core#Spell or string spell id Record ID for the trap to use
-
- Lockable.unlock(object)
-
Unlocks the lockable object.
Does not change the lock level, it can be kept for future use.
Parameter
-
openmw.core#GameObject object:
-