VAR g_DoorLeft, g_DoorRight; /******************************************************************** * OnCreate() * Called when the door is first loaded into the level * TimS Oct 9 2002 ********************************************************************/ OnCreate() { g_DoorLeft = -1; g_DoorRight = -1; } /*******************************************************************/ /******************************************************************** * OnBeginScript() * Called when the door frame has been loaded, so attach the actual * doors to the frame * TimS Oct 9 2002 ********************************************************************/ OnBeginScript() { g_DoorLeft = DOOR_AddDoor( THIS, "KBDoorL.OBL", 0.0, 0.0, 0.0 ); g_DoorRight = DOOR_AddDoor( THIS, "KBDoorR.OBL", 0.0, 0.0, 0.0 ); } /*******************************************************************/ /******************************************************************** * OnHitBoundingSphere() * Called when the specified bounding sphere has been hit by something * TimS Oct 9 2002 ********************************************************************/ OnHitBoundingSphere( sphereID, hitType ) { // Hit the Open Door switch? if ( sphereID == 1 ) { DOOR_Open( THIS ); } } /*******************************************************************/ /******************************************************************** * OpenDoor() * Called by the game engine when the door wants to open. So, start * moving the actual door objects. * TimS Oct 9 2002 ********************************************************************/ OpenDoor() { DOOR_MoveDoor( THIS, g_DoorLeft, 100.0, 0.0, 0.0, 5.0 ); DOOR_MoveDoor( THIS, g_DoorRight, -100.0, 0.0, 0.0, 5.0 ); } /*******************************************************************/ /******************************************************************** * CloseDoor() * Called by the game engine when the door wants to close. So, start * moving the actual door objects. * TimS Oct 9 2002 ********************************************************************/ CloseDoor() { DOOR_MoveDoor( THIS, g_DoorLeft, 0.0, 0.0, 0.0, 5.0 ); DOOR_MoveDoor( THIS, g_DoorRight, 0.0, 0.0, 0.0, 5.0 ); } /*******************************************************************/