DMH-Online

Dungeon Masters Helper · Est. 2005

Levers Scripts

NWN Script: lever001.htm

Author Sticky: Post Working Scripts Here
Jay Watamaniuk
Community Manager
Posted: Friday, 21 June 05:35PM
1. Script Name: Opening A Door With A Lever
Script Creator: Brenon Holmes (BioWare)

2. What it does: Opens a door with a lever.

3. Notes: This script allows you to open a door (Door1) with a lever.

Notes: Brennon: I should probably note, that you actually have to set up the lever to play the activate and de-activate animations... like so:


NWScript:
void main()
{
  object oDoor = GetObjectByTag("Door1");
  if ( GetLocalInt( OBJECT_SELF, "m_bActivated" ) == TRUE )
  {
    SetLocalInt( OBJECT_SELF, "m_bActivated", FALSE );
    PlayAnimation( ANIMATION_PLACEABLE_DEACTIVATE );
    AssignCommand (oDoor, ActionCloseDoor (oDoor));
  }
  else
  {
    SetLocalInt( OBJECT_SELF, "m_bActivated", TRUE );
    PlayAnimation( ANIMATION_PLACEABLE_ACTIVATE );
    AssignCommand (oDoor, ActionOpenDoor (oDoor));
  }
}



EDIT: altered script so that it actually opened/closed the door... beforehand, the script showed merely how to activate/deactivate the lever, itself

Version 1.0

⌂ All Scripts Next → 👁 Category List

All Levers Scripts

📄 lever001 📄 lever002 📄 lever003 📄 lever004 📄 lever005 📄 lever_puzzle 📄 open_multiple_doors 📄 rusted_lever 📄 spawn_MOB