My map is like the movie "Cube." I have many rooms, each having 4 ways out. (6 technically, but I'm working with the 4 walls at the moment to keep things simple). When the player approaches one door, it will open, as well as the corresponding door in the next room. Before the doors move up (open), they each move a few units toward each other, and to my knowledge have to be controlled with separate scripts for that reason. Here is the script I currently have for 1 set of doors:
Code: Select all
main()
{
thread cube1();
}
cube1()
{
xm_cube1trigger = getent("trig1a", "targetname");
xm_cube1doora = getent("door1a", "targetname");
xm_cube1doora_2 = getent("door1a_2", "targetname"); //The corresponding door in the adjacent room
while(1)
{
xm_cube1trigger waittill ("trigger", user);
xm_cube1doora moveX(-16,1.5,0.5,0.5);
xm_cube1doora_2 moveX(16,1.5,0.5,0.5);
xm_cube1doora_2 waittill("movedone");
xm_cube1doora moveZ(128,2);
xm_cube1doora_2 moveZ(128,2);
xm_cube1doora_2 waittill("movedone");
wait(8);
xm_cube1doora moveZ(-128,2);
xm_cube1doora_2 moveZ(-128,2);
xm_cube1doora_2 waittill("movedone");
xm_cube1doora moveX(16,1.5,0.5,0.5);
xm_cube1doora_2 moveX(-16,1.5,0.5,0.5);
xm_cube1doora_2 waittill("movedone");
}
}