Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Open/close door question

Bhati Latte
Registered User
Join date: 28 Nov 2007
Posts: 29
01-05-2008 13:31
Hello all and happy New Year!

I made a door using one free door script for opening and closing. But I encountered a few problems:

1.When the door opens (/closes) it pivots around the center of the door. How do I correct this so it pivots at one end?
2.This particular script I have opens the door and stays open. What code I need to add or change in order the door to close after few seconds? (now obviously I don’t have any scripting experience, so I may need help with that.)

I thank you all for your suggestions.

BL
Nika Talaj
now you see her ...
Join date: 2 Jan 2007
Posts: 5,449
01-05-2008 13:40
The solution is to cut away half of the prim so that it LOOKS like the door is opening on its edge. Try a path cut of .250, .500.

With respect to closing, you need to add a timer instead of the door closing when touched. Post the script?
Okiphia Anatine
Okiphia Rayna
Join date: 22 Nov 2007
Posts: 454
01-05-2008 13:48
A second method would be to add a second prim, a 'hinge' prim.

Also, a super-simple, no frills script would be (I might have the axes for rotation off)

CODE

default
{
state_entry()
{
// Un-comment the next line for debugging purposes, to test if script is running
//llSay(0, "Working");
}
touch_start(integer number)
{
llSetRot(llEuler2Rot<0,0,PI_BY_TWO>));
llStartTimerEvent(10);
}
timer()
{
llSetRot(llEuler2Rot<0,0,0>));
llResetScript;
}
}



Untested script, should work, if not then oops =/

Wrote it just now off the top of my head.. there are much better door scripts out there, but this one should work. It opens on touch, and closes after 10 seconds.
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
01-05-2008 13:51
From: Nika Talaj
Try a path cut of .250, .500.
That will make a triangular wedge. ;)

Use any two values of .125, .375, .625 or .875. (except the first and last together, that will result in 3/4 of the box, when you want 1/2, to hinge on the middle of one edge, or 1/4, to hinge on one corner.)
Bhati Latte
Registered User
Join date: 28 Nov 2007
Posts: 29
01-05-2008 13:53
Thank you guys for your help i will try bothe methods
Bhati Latte
Registered User
Join date: 28 Nov 2007
Posts: 29
01-05-2008 13:56
From: Deanna Trollop
That will make a triangular wedge. ;)

Use any two values of .125, .375, .625 or .875. (except the first and last together, that will result in 3/4 of the box, when you want 1/2, to hinge on the middle of one edge, or 1/4, to hinge on one corner.)


Im not sure i understand what u mean
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
01-05-2008 14:13
To make a half box, which will rotate about the middle of one side, use these values for Path Cut Begin and End:

.125 .625
or
.375 .875


To make a quarter box, which will rotate about one corner, use these values:

.125 .375
or
.375 .625
or
.625 .875
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-05-2008 16:03
and that is why I added comments on cuts to my super simple door script...
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -