Difference between revisions of "SetLocked"

From NWN Lexicon
Jump to: navigation, search
(Created page with " =SetLocked(object, int)= Locks or unlocks a door or placeable. void  SetLocked(      object  oTarget,      int  b...")
 
Line 7: Line 7:
 
Locks or unlocks a door or placeable.
 
Locks or unlocks a door or placeable.
  
 +
<nwscript>
 
  [[void | void ]] SetLocked(
 
  [[void | void ]] SetLocked(
 
      [[object | object ]] oTarget,
 
      [[object | object ]] oTarget,
 
      [[int | int ]] bLocked
 
      [[int | int ]] bLocked
 
  );
 
  );
 +
</nwscript>
  
 
====Parameters====
 
====Parameters====
Line 42: Line 44:
 
====Example====
 
====Example====
  
<font color="#007f00">// Unlocked an object with the tag DOOR_TAG
+
<nwscript>
  </font><font color="#0000ff">void</font> main()
+
// Unlocked an object with the tag DOOR_TAG
 +
  void main()
 
  {
 
  {
     <font color="#0000ff">object</font> oDoor = GetObjectByTag(<font color="#00007f">"DOOR_TAG"</font>);
+
     object oDoor = GetObjectByTag("DOOR_TAG");
     SetLocked(oDoor, <font color="#0000ff">FALSE</font>);
+
     SetLocked(oDoor, FALSE);
 
  }
 
  }
 +
</nwscript>
  
 
====See Also====
 
====See Also====

Revision as of 21:59, 25 August 2012



SetLocked(object, int)

Locks or unlocks a door or placeable.

 [[void | void ]] SetLocked(
     [[object | object ]] oTarget,
     [[int | 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.

You can lock an open door. If you do, it will be locked once it closes.


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