Difference between revisions of "SetLocked"

From NWN Lexicon
Jump to: navigation, search
(Remarks)
m
Line 1: Line 1:
 
 
 
 
 
=SetLocked(object, int)=
 
=SetLocked(object, int)=
  
Line 23: Line 19:
  
 
TRUE to lock, FALSE to unlock.
 
TRUE to lock, FALSE to unlock.
 
<br />
 
  
 
====Description====
 
====Description====
  
Used by objects or creatures to set the locked status of an object or placeable without checking the Open Locks skill. <br /><br /> Note that DM Force Lock does the same thing as this. You can actually lock doors which cannot be normally re-locked, but it is not recommended.
+
Used by objects or creatures to set the locked status of an object or placeable without checking the Open Locks skill.
  
<br /><br />
+
Note that DM Force Lock does the same thing as this. You can actually lock doors which cannot be normally re-locked, but it is not recommended.
  
 
====Remarks====
 
====Remarks====
  
Alternatively, ActionLockObject and ActionUnlockObject can be used by creatures so appropriate skill checks are made. Make sure, as well, that your door has the 're-lockable' box checked. <br /><br /> You can lock an open door. If you do, it will be locked once it closes.
+
Alternatively, ActionLockObject and ActionUnlockObject can be used by creatures so appropriate skill checks are made. Make sure, as well, that your door has the 're-lockable' box checked.  
 +
 
 +
Of course, you can also lock an open door.
  
 
When the object is already (un)locked, the On(Un)locked event is still fired.
 
When the object is already (un)locked, the On(Un)locked event is still fired.
 
<br />
 
  
 
====Version====
 
====Version====
Line 64: Line 58:
 
|}
 
|}
  
<br />
 
 
----
 
----
<font color="gray">  author: Tom Cassiotis, editor: Jasperre</font><br />  <br />
+
<font color="gray">  author: Tom Cassiotis, editor: Jasperre</font>
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:Get_Data_from_Object_Functions]]
 
[[Category:Get_Data_from_Object_Functions]]

Revision as of 02:01, 9 May 2014

SetLocked(object, int)

Locks or unlocks a door or placeable.

void SetLocked(
    object oTarget,
    int bLocked
);

Parameters

oTarget

The door or placeable to lock

bLocked

TRUE to lock, FALSE to unlock.

Description

Used by objects or creatures to set the locked status of an object or placeable without checking the Open Locks skill.

Note that DM Force Lock does the same thing as this. You can actually lock doors which cannot be normally re-locked, but it is not recommended.

Remarks

Alternatively, ActionLockObject and ActionUnlockObject can be used by creatures so appropriate skill checks are made. Make sure, as well, that your door has the 're-lockable' box checked.

Of course, you can also lock an open door.

When the object is already (un)locked, the On(Un)locked event is still fired.

Version

1.61

Example

// Unlocked an object with the tag DOOR_TAG
void main()
{
    object oDoor = GetObjectByTag("DOOR_TAG");
    SetLocked(oDoor, FALSE);
}

See Also

functions: 

GetLastUnlocked


 author: Tom Cassiotis, editor: Jasperre