Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

problem with doors

psimagus Hax
Registered User
Join date: 3 Jul 2007
Posts: 73
10-22-2007 07:25
hi, I'm having a weird problem with a couple of cabinet doors, I wondered if anyone could point me towards a solution with:

I'm using the "// Basic Door Script // Original Script By Unknown // Modifications made by Zanlew Wu 01-Apr-2003" freebie script, and the doors open and close fine while they're unlinked, but as soon as I link them to the cabinet and click to open, they rotate not only around the Z axis, but around the X axis, so that they are upside down when opened. It wouldn't be a problem with rectangular, plain-textured doors, but these are painted half-arch doors, so the effect is dramatically unwelcome! :(

Any suggestions would be more than gratefully received! I've been tearing my hair out tweaking the script in an attempt to fix it, but usually that just breaks it (I'm still rather new to LLScript :))

I have a couple of copies of the cabinet with linked, and unlinked doors, at http://slurl.com/secondlife/Goremoor/39/54/118 for anyone who's interested/needs to see what I mean.
_____________________
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
10-23-2007 04:16
EDIT:
the problem you describe sounds like the root prim that is being linked to has been rotated, either unrotate it, or even better try this

box --> pathcut start=.125, end=.625

x= .5 of door width
y=door thickness
z=door height

script
CODE

rotation vgRotDoorSwing;

default{
state_entry(){
//-- 90deg on z axis, change to x or y for lids
vgRotDoorSwing = llEuler2Rot( <.0, .0, 90.0> * DEG_TO_RAD );
state vsClosed;
}
}

state vsClosed{
touch_start( integer vIntTouched ){
state vsOpened;
}

state_exit(){
//-- / rotates clockwise
llSetLocalRot( llGetLocalRot() / vgRotDoorSwing );
}
}

state vsOpened{
touch_start( integer vIntTouched ){
state vsClosed;
}

state_exit(){
//-- * rotates counter-clockwise
llSetLocalRot( llGetLocalRot() * vgRotDoorSwing );
}
}


cut door prim, set in place, drop in 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...
| -
Jeza May
Owner of Jade Innovations
Join date: 16 Oct 2006
Posts: 317
10-23-2007 05:11
With the script I use, the door has to be linked before you set it up.. Also it is not to be linked to the root prim, or be the root prim.. If you can't get that one working, IM me in world, I have a very easy to use door script that is open source..

Jez
_____________________