NWNWiki
NWNWiki
3,718
pages
m (cross ref linking)
m (+category, +wikify)
Line 1: Line 1:
Closing a [[door]] automatically is quite simple. However there is one thing to keep in mind. Closing doors can become very annoying to the players. I suggest only closing doors that are [[area]] [[transition]]s or lead into a large area. Also you will want to make the delay before it closes reasonable. This way [[PC]]s aren’t constantly opening the same door so they can fight a creature that is on the other side.
+
Closing a [[door]] automatically is quite simple. However there is one thing to keep in mind. Closing doors can become very annoying to the [[player]]s. I suggest only closing doors that are [[area]] [[transition]]s or lead into a large area. Also you will want to make the delay before it closes reasonable. This way [[PC]]s aren’t constantly opening the same door so they can fight a creature that is on the other side.
   
 
Add this script to the doors OnOpen script handle. Change the number 15.0f to whatever. This is the delay in seconds before the door closes. OBJECT_SELF represents the object that the script is attached to. In this case, the door.
 
Add this script to the doors OnOpen script handle. Change the number 15.0f to whatever. This is the delay in seconds before the door closes. OBJECT_SELF represents the object that the script is attached to. In this case, the door.
Line 13: Line 13:
 
// End
 
// End
 
</pre>
 
</pre>
  +
  +
[[Category:Script directory:Doors and Levers]]

Revision as of 16:15, 30 June 2007

Closing a door automatically is quite simple. However there is one thing to keep in mind. Closing doors can become very annoying to the players. I suggest only closing doors that are area transitions or lead into a large area. Also you will want to make the delay before it closes reasonable. This way PCs aren’t constantly opening the same door so they can fight a creature that is on the other side.

Add this script to the doors OnOpen script handle. Change the number 15.0f to whatever. This is the delay in seconds before the door closes. OBJECT_SELF represents the object that the script is attached to. In this case, the door.


/////////////////////////////////////////////////////////
// Auto-Close Door
/////////////////////////////////////////////////////////
void main()
{
	DelayCommand(15.0f,ActionCloseDoor(OBJECT_SELF));
}
// End