Difference between revisions of "ActionOpenDoor"

From NWN Lexicon
Jump to: navigation, search
(Remarks)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
+
{{DISPLAYTITLE:ActionOpenDoor(object)}}
 
 
 
 
 
 
=ActionOpenDoor(object)=
 
 
 
 
An action that will cause a creature to open a door.
 
An action that will cause a creature to open a door.
 
 
<nwscript>
 
<nwscript>
 
void ActionOpenDoor(
 
void ActionOpenDoor(
Line 13: Line 7:
 
</nwscript>
 
</nwscript>
  
====Parameters====
+
===Parameters===
 +
;oDoor
 +
:The door that will be opened.
  
''oDoor''
+
===Description===
 +
Cause the action subject to open oDoor. If the subject of an ActionOpenDoor is the door, either through AssignCommand or in a door's script, then the door will open itself. However, if ActionOpenDoor is used in the script of a creature, that action will cause the creature to move to the door and open it, as long as it is not locked.
  
The door that will be opened.
+
===Remarks===
 +
[[DoDoorAction]](oDoor, [[Door action|DOOR_ACTION_OPEN]]) can be used as an alternative to add the action on top of any actions currently running, and is recommended for a creature's [[OnBlocked]] event.
  
<br />
+
When the door is already opened, the [[OnOpen]] event is still fired.
  
====Description====
+
===Known Bugs===
 +
This action isn't always instant in some multiplayer modules and might be delayed. As an alternative, you can use [[PlayAnimation]] to open door which is always instant (not an action).
  
Cause the action subject to open oDoor. <br /><br /> If the subject of an ActionOpenDoor is the door, through AssignCommand or in a door's script, then the door will open itself. <br /><br /> However, if ActionOpenDoor is used in the script of a creature, that action will cause the creature to move to the door and open it as long as it is not locked.
+
The toolset bug that made it impossible to create doors initially open no longer exists, and thus there's no need for the ActionOpenDoor workaround noted here previously.
  
<br /><br />
+
===Version===
 
 
====Remarks====
 
 
 
DoDoorAction(oDoor, DOOR_ACTION_OPEN) can be used as an alternative to add the action on top of any actions currently running, and is recommended for a creatures OnBlocked event.
 
 
 
When the door is already opened, the OnOpen event is still fired.
 
 
 
<br />
 
 
 
====Known Bugs====
 
 
 
The toolset bug that made it impossible to create doors initially open does no longer exist, and thus there’s no need for the ActionOpenDoor workaround noted here previously.
 
 
 
<br />
 
 
 
====Version====
 
  
 
1.30
 
1.30
  
====Example====
+
===Example===
 
 
 
<nwscript>
 
<nwscript>
 
// This script is for the OnEnter event for an area.
 
// This script is for the OnEnter event for an area.
 
// The script will command a door tagged "OPEN_DOOR"
 
// The script will command a door tagged "OPEN_DOOR"
 
// to open itself.
 
// to open itself.
 
 
void main
 
void main
 
{
 
{
 
     // Initialize objects.
 
     // Initialize objects.
 
     object oDoor = GetObjectByTag("OPEN_DOOR");
 
     object oDoor = GetObjectByTag("OPEN_DOOR");
 +
 
     // Tell door to open itself.
 
     // Tell door to open itself.
 
     AssignCommand(oDoor, ActionOpenDoor(oDoor));
 
     AssignCommand(oDoor, ActionOpenDoor(oDoor));
Line 61: Line 43:
 
</nwscript>
 
</nwscript>
  
====See Also====
+
===See Also===
  
 
{| class="seealso"
 
{| class="seealso"
 
| width="1px" align="right" valign="top" | <font color="gray">functions: </font>
 
| width="1px" align="right" valign="top" | <font color="gray">functions: </font>
|
+
| [[DoDoorAction]], [[SetLocked]]
[[ SetLocked  | SetLocked ]]
 
 
|-
 
|-
|}
+
| width="1px" align="right" valign="top" | <font color="gray">events: </font>
 +
| [[OnOpen]]
 +
|}<br />
 +
----
  
<br />
+
<font color="gray">author: Tom Cassiotis, editor: Jasperre, additional contributor(s): Drake Coker, Lilac Soul, Jasperre</font>
----
 
<font color="gray">  author: Tom Cassiotis, editor: Jasperre, additional contributor(s): Drake Coker, Lilac Soul, Jasperre</font><br />  <br />
 
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:Action_on_Object_Functions]]
 
[[Category:Action_on_Object_Functions]]

Latest revision as of 05:38, 24 December 2017

An action that will cause a creature to open a door.

void ActionOpenDoor(
    object oDoor
);

Parameters

oDoor
The door that will be opened.

Description

Cause the action subject to open oDoor. If the subject of an ActionOpenDoor is the door, either through AssignCommand or in a door's script, then the door will open itself. However, if ActionOpenDoor is used in the script of a creature, that action will cause the creature to move to the door and open it, as long as it is not locked.

Remarks

DoDoorAction(oDoor, DOOR_ACTION_OPEN) can be used as an alternative to add the action on top of any actions currently running, and is recommended for a creature's OnBlocked event.

When the door is already opened, the OnOpen event is still fired.

Known Bugs

This action isn't always instant in some multiplayer modules and might be delayed. As an alternative, you can use PlayAnimation to open door which is always instant (not an action).

The toolset bug that made it impossible to create doors initially open no longer exists, and thus there's no need for the ActionOpenDoor workaround noted here previously.

Version

1.30

Example

// This script is for the OnEnter event for an area.
// The script will command a door tagged "OPEN_DOOR"
// to open itself.
void main
{
     // Initialize objects.
     object oDoor = GetObjectByTag("OPEN_DOOR");
 
     // Tell door to open itself.
     AssignCommand(oDoor, ActionOpenDoor(oDoor));
}

See Also

functions:  DoDoorAction, SetLocked
events:  OnOpen


author: Tom Cassiotis, editor: Jasperre, additional contributor(s): Drake Coker, Lilac Soul, Jasperre