Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Altering Door Swing

Aleksie Solvang
nani?
Join date: 21 Oct 2004
Posts: 113
02-07-2005 11:21
I'm trying to add shutters to my cottage and I had them all ready and I realized that a normal door script wont work, because it only swings 90 degrees, where as I need something that will swing 180 - from the wall of the cottage, to the front of the window - is there a way I can alter the normal door script to allow this? or does anyone have one that already does this?
thanks
Reitsuki Kojima
Witchhunter
Join date: 27 Jan 2004
Posts: 5,328
02-07-2005 13:17
(reposted from another thread)

You can't, unfortunatly, change the axis around which a prim rotates...

With two exceptions. Cylinders and Cubes both have some limited ability to do this, with a lot of tweaking the Cut or Dimple parameters.

Make a cube with a beginning cut of .375 and an end cut of .875. You will get a cube that rotates around one side.
Aleksie Solvang
nani?
Join date: 21 Oct 2004
Posts: 113
02-07-2005 14:37
ah -_- that sucks - alright, thanks! :)
Damanios Thetan
looking in
Join date: 6 Mar 2004
Posts: 992
02-08-2005 02:53
It's actually quite easy. In this case the axis problem is no issue. Either use cut prims like Reitsuki suggested, or link your shutters to a cylinder axis. (They're 2 prims apiece then, and you can't link them to the cottage anymore, so i suggest using the cut prims method)

If you use the 'basic' 1 prim door script, that is commonly used in SL (I believe it's made Ezhar Fairlight, but i'm not sure). Just double PI as a rotation, instead of PI_BY_TWO.
So:
CODE


rotation rot = llGetRot();
rotation delta = llEuler2Rot(<0,0,PI>);
llSetRot(rot + delta);




(TIP: If you want to link the door to the cottage later, change the llSetRot in the script to llSetLocalRot)
Siobhan Taylor
Nemesis
Join date: 13 Aug 2003
Posts: 5,476
02-08-2005 03:07
From: Aleksie Solvang
I'm trying to add shutters to my cottage and I had them all ready and I realized that a normal door script wont work, because it only swings 90 degrees, where as I need something that will swing 180 - from the wall of the cottage, to the front of the window - is there a way I can alter the normal door script to allow this? or does anyone have one that already does this?
thanks


Actually, the basic door script has the amount of swing coded in. All you need to do is find the right bit and change the amount of rotation. You can alter the axis to make a drawbridge or a loft-ladder too.
_____________________
http://siobhantaylor.wordpress.com/