I was playin arround with some movin doors.
Didn't wanna use doors but a closset with 2 draws.
Some strange thing happend ,both draws work fine, except when
i close the last one ,the upper wil fall in the lower draw????
Script im using is.(from this forum.from Rysidian Rubio,ty so much)
Slightly modified by me ,kept the sound away.
script:
//Sliding Door Script
//by Rysidian Rubio
//Edited by Gene Jacobs - Thanks Rysidian for original script
//Please feel free to redistribute but DO NOT SELL this script.
//place your door where you want it to be closed, and then put this script into it.
//******Feel free to change the variables between here...
//Globals
float distance = 0.5;
//this is the total distance you want the door to open in metres.
integer direction = -2;
//use 1 to move along the x axis
//-1 to move in the opposite direction.
//2 to move along the y axis
//-2 to move the opposite direction.
//any other number will make the door inoperable.
float close_time = 0;
//time in seconds before the door automatically closes.
//use 0 to disable auto closing.
//******And here.
vector start_pos;
//this is to eliminate prim drift caused by the distance being a float.
open()
{
//function opens the door in 10 steps to simulate smooth movement.
//Gene - I changed to 2 to make it quicker and smother for me
integer i = 2;
integer j;
vector step;
//Gene - I added the sound and speak options below
//Gene - Sound and Speak above
if (direction == 1)
{
step = <
distance/i),0,0>;}
else if (direction == 2)
{
step = <0,(distance/i),0>;
}
else if (direction == -1)
{
step = <
distance/i),0,0>;}
else if (direction == -2)
{
step = <0,-(distance/i),0>;
}
for (j= 0; j < i; j++)
{
llSetPos(llGetPos() + step);
}
}
close()
{
//function closes the door in 10 steps to simulate smooth movement.
//Gene - I changed to 2 to make it quicker and smother for me
integer i = 2;
integer j;
vector step;
//Gene - I added the sound and speak options below
//Gene - Sound and Speak above
if (direction == 1)
{
step = <
distance/i),0,0>;}
else if (direction == 2)
{
step = <0,(distance/i),0>;
}
else if (direction == -1)
{
step = <
distance/i),0,0>;}
else if (direction == -2)
{
step = <0,-(distance/i),0>;
}
for (j = 0; j < i; j++)
{
llSetPos(llGetPos() - step);
}
llSetPos(start_pos);
}
default
{
state_entry()
{
start_pos = llGetPos();
state Closed;
}
}
state Opened
{
state_entry()
{
llSetTimerEvent(close_time);
}
touch_start(integer num_detected)
{
llSetTimerEvent(0);
close();
state Closed;
}
timer()
{
llSetTimerEvent(0);
close();
state Closed;
}
}
state Closed
{
state_entry()
{
llSetTimerEvent(0);
}
touch_start(integer num_detected)
{
open();
state Opened;
}
}
pic01 both closed
02- bottom open
03- both open
04- bottom closed ,upper close good ,but drops down???
05-afterwards
Pics will follow as soon as possible ,forum will not allow my pics to upload
grts Melissa