Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

door help

Billybob Street
Registered User
Join date: 18 Aug 2004
Posts: 26
03-04-2006 11:38
i need a door script that slids in from the side and has a lock and unlock feature.

thanks
Yeti Freeloader
Registered User
Join date: 6 Dec 2005
Posts: 13
03-04-2006 12:06
I'd modify the open source door script found here http://secondlife.com/badgeo/wakka.php?wakka=LibraryDoor

If you want more functions there is a modification of that script on SLeX at http://www.slexchange.com/modules.php?name=Marketplace&file=item&ItemID=27466

you'd make the same changes.

To modify change the door open function to read

CODE

vector temp = llGetScale();
vector temp2 = ZERO_VECTOR;
temp2.x = temp.x; //change the .z to whichever global direction you wish to slide to
llSetPos(llGetPos() + temp2);


close function to read the same but the llSetPos call is
CODE

llSetPos(llGetPos() - temp2);


for a quick and dirty method.

Note: That modification only works if you set the door to a global axis, if you want to have a different rotation . . . then it gets a bit more complicated as you have to figure out rotation, etc, but is completely doable, I just can't do it in the 30 sec I have avail to me to reply ;)
Kayla Stonecutter
Scripting Oncalupen
Join date: 9 Sep 2005
Posts: 224
03-05-2006 14:57
I have a lockable sliding door for sale, both on SLX and inworld. It can be setup at any rotation, and can move in any of the eight major directions (North, NorthEast, East, SouthEast, etc). The door prim it comes in is mod, or you can move the script and settings notecard into an existing door.

Available on SLX and inworld at Bruin (84,54,108).
_____________________
Thili Playfair
Registered User
Join date: 18 Aug 2004
Posts: 2,417
03-05-2006 15:10
Not exactly a good one, but still useable, you have to change
vector gOpenOffset = <0.7, 0.0, 0.0>;
vector gCloseOffset = <-0.7, 0.0, 0.0>;
how you want it tho ( x , y , z )

CODE

integer gSteps = 7;
vector gOpenOffset = <0.7, 0.0, 0.0>;
vector gCloseOffset = <-0.7, 0.0, 0.0>;

default
{
state_entry()
{
state closed;
}
}

state closed
{

touch_start(integer total_number)
{

integer i;
vector basepos = llGetPos();

for (i=0; i <= gSteps; i++)
{
llSetPos(basepos + i*gOpenOffset);
//llSleep(0.05);
}

state open;
}
}

state open
{
touch_start(integer num)
{
integer i;
vector basepos = llGetPos();

for (i=0; i <= gSteps; i++)
{
llSetPos(basepos + i*gCloseOffset);
// llSleep(0.1);
}

state closed;
}
}