Coola Posted November 22, 2006 Share Posted November 22, 2006 Hey, im just looking for a script that will make a door open. Thanks in advance! Link to comment Share on other sites More sharing options...
Tupac Amaru Posted November 22, 2006 Share Posted November 22, 2006 In TSL, there are two premade scripts that can used in dialogues: a_open_door will open and unlock a door, and a_lock_door will close and lock a door. The string parameter must be the tag of the door. The parameter P1 is an optional delay. They should not be used if there are several doors with the same tag in a module, though. To write your own scripts, the command ActionOpenDoor opens a door. Assign it to the door object. If the door is locked then it needs to be unlocked as well. This can be done with SetLocked. It needs two parameters: the object for the door and a boolean (FALSE to unlock, TRUE to lock the door). This script opens and unlocks a door: void main() { object oDoor = GetObjectByTag("doortag"); SetLocked(oDoor, FALSE); AssignCommand(oDoor, ActionOpenDoor(oDoor)); } This one closes and locks the door: void main() { object oDoor = GetObjectByTag("doortag"); SetLocked(oDoor, TRUE); AssignCommand(oDoor, ActionCloseDoor(oDoor)); } Link to comment Share on other sites More sharing options...
Coola Posted November 23, 2006 Author Share Posted November 23, 2006 Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.