Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Any script for a door? ( how a door is supposed to behave)

Krigore Harbinger
Registered User
Join date: 11 Oct 2005
Posts: 5
10-16-2005 20:04
I've tried a few scripts for opening doors but theyre not doing what i wanted. I want cabinet opening doors but all these scripts make it so it rotates in the middle and anyway i try to change it it just pulls it back again....anyone know what i'm getting at? A door, like the way a real door behaves..anyone have a script for that?
Aliasi Stonebender
Return of Catbread
Join date: 30 Jan 2005
Posts: 1,858
10-16-2005 20:55
From: Krigore Harbinger
I've tried a few scripts for opening doors but theyre not doing what i wanted. I want cabinet opening doors but all these scripts make it so it rotates in the middle and anyway i try to change it it just pulls it back again....anyone know what i'm getting at? A door, like the way a real door behaves..anyone have a script for that?


No, absolutely nobody has a script like that. In all the time Second Life has existed, nobody has ever wanted a normal door. :D


Okay, seriously. The way those door scripts behave is actually correct. the reason you are getting the results you do is because all objects rotate based on the center of their root prim. In the case of a door, if it's a single box prim by itself, the center is... in the center.

How do you get around this? one of two ways. One is to add a second "hinge" prim to the door. (most of the example doors you see go this route). make the hinge, place it in the corner - make it long but narrow, so a bit sticks out the bottom and top but it doesn't poke out otherwise. then select the door and hinge, making sure to select the hinge last, and link them. now the root prim is the hinge, and the door will rotate on it.

The second way involves clever use of the "cut" parameters on the edit box. By cutting a box in such a way that it "appears" the center (where the axis lines show up) is actually on the edge, you create a door that is only one prim and will appear to rotate correctly.
_____________________
Red Mary says, softly, “How a man grows aggressive when his enemy displays propriety. He thinks: I will use this good behavior to enforce my advantage over her. Is it any wonder people hold good behavior in such disregard?”
Anything Surplus Home to the "Nuke the Crap Out of..." series of games and other stuff
Krigore Harbinger
Registered User
Join date: 11 Oct 2005
Posts: 5
10-16-2005 22:46
ahah! ... ive always wondered what hinge was used for :) thx a bunch
Bertha Horton
Fat w/ Ice Cream
Join date: 19 Sep 2005
Posts: 835
10-16-2005 23:01
From: Aliasi Stonebender
The second way involves clever use of the "cut" parameters on the edit box. By cutting a box in such a way that it "appears" the center (where the axis lines show up) is actually on the edge, you create a door that is only one prim and will appear to rotate correctly.
Ah, glad to see I'm not the only one who figured that out. It works really well if you have to use a lot of prims for the building but still need a lot of doors. The only problem with it is the door cannot be wider than 5m (not much of a problem).
Phoenix Psaltery
Ninja Wizard
Join date: 25 Feb 2005
Posts: 2,599
10-17-2005 08:21
From: Aliasi Stonebender
Okay, seriously. The way those door scripts behave is actually correct. the reason you are getting the results you do is because all objects rotate based on the center of their root prim. In the case of a door, if it's a single box prim by itself, the center is... in the center.

How do you get around this? one of two ways. One is to add a second "hinge" prim to the door. (most of the example doors you see go this route). make the hinge, place it in the corner - make it long but narrow, so a bit sticks out the bottom and top but it doesn't poke out otherwise. then select the door and hinge, making sure to select the hinge last, and link them. now the root prim is the hinge, and the door will rotate on it.

The second way involves clever use of the "cut" parameters on the edit box. By cutting a box in such a way that it "appears" the center (where the axis lines show up) is actually on the edge, you create a door that is only one prim and will appear to rotate correctly.


The other way to do this is to make the door texture using an alpha channel so that the portion of the prim that is beyond the pivot point is transparent.

P2
_____________________
:cool:
Aliasi Stonebender
Return of Catbread
Join date: 30 Jan 2005
Posts: 1,858
10-17-2005 13:40
From: Phoenix Psaltery
The other way to do this is to make the door texture using an alpha channel so that the portion of the prim that is beyond the pivot point is transparent.

P2


Yeah, but then you run the risk of alpha-layer mixups, plus a larger texture (since it will have to include an alpha layer). As well as the risk of people running into the invisible half of the door.

Still, there's places and times for every technique, so it's another to add to the toolbox.
_____________________
Red Mary says, softly, “How a man grows aggressive when his enemy displays propriety. He thinks: I will use this good behavior to enforce my advantage over her. Is it any wonder people hold good behavior in such disregard?”
Anything Surplus Home to the "Nuke the Crap Out of..." series of games and other stuff
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
10-18-2005 11:34
From: Bertha Horton
Ah, glad to see I'm not the only one who figured that out. It works really well if you have to use a lot of prims for the building but still need a lot of doors. The only problem with it is the door cannot be wider than 5m (not much of a problem).



The real trick here...however...is turning the box into a sphere...cutting it...and then turning it back into a box. That way you don't end up with the weird corner-cuts the boxes usually have.
Bertha Horton
Fat w/ Ice Cream
Join date: 19 Sep 2005
Posts: 835
10-18-2005 15:27
From: Kenn Nilsson
The real trick here...however...is turning the box into a sphere...cutting it...and then turning it back into a box. That way you don't end up with the weird corner-cuts the boxes usually have.
Actually, I never need to transform the box into a sphere. I just use cuts of either 0.125 and 0.625, or 0.375 and 0.875, depending on the orientation. One has to type it in the boxes instead of clicking on the arrow buttons, but it works for me.