Jump to content

Need help with a Oven Door script


LouiseDeBlois
 Share

You are about to reply to a thread that has been inactive for 3939 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hi there, I am looking for a oven door script, I have used a smooth rotation door script, but the door when clicked rotates clockwise, and not towards me. In short, I want the oven door to well... open like a oven door and not a normal hinged door you find on houses. If that makes sense..

 

                  Oven

|                                         |
|                                         |
|                                         |                                      
|                                         |
|                                         |
|                                         |
|     (_____________)   |    ()()()()()()()()()()()()()()() <---- Oven door.

 

I have used this script: http://wiki.secondlife.com/wiki/Smooth_Rotating_Door

Link to comment
Share on other sites

Hm,,,, what about this script? This one seems to work better as it does not do a weird movement after it is clicked.

 

/*//( v7-D Simple Hinge Action )--//*/
/*//-- Works At ANY Angle --//*/

/*//-- NOTES:
works in ANY single prim door, linked or un-linked
works in multi-prim doors NOT linked to a larger structure
Never needs reset (even after moving/rotating)
//*/

/*//-- REQUIREMENTS:
Root should either be a cylinder (to represent a hinge) or half cut prim;
I suggest Box, pathcut start=.125, end=.625
//*/

/*//-- CAVEAT:
Single prim doors are limited to 5m width
Treats current position as closed when reset
//*/

/*//-- USERS MODIFY HERE v --//*/
integer gIntSwing = 90;
/*//-- use -# to reverse the direction of swing, eg. -90; --//*/
rotation gRotSwing;

default{
state_entry(){
gRotSwing = llEuler2Rot( <0.0, 0.0, (float)gIntSwing * DEG_TO_RAD> );
}

touch_end( integer vIntNul ){
llSetLocalRot( (gRotSwing = (ZERO_ROTATION / gRotSwing)) * llGetLocalRot() );
}
}

/*//-- IF Redistributing as-is:
Please leave script full permissions & include all comments so that others may learn and use
//*/

Link to comment
Share on other sites

That script of Void Singer's is probably the best door script in SL.  Simple, easy to use, and versatile.  To make it work for you, all you have to do is change one line.

Replace gRotSwing = llEuler2Rot( <0.0, 0.0, (float)gIntSwing * DEG_TO_RAD> );

with gRotSwing = llEuler2Rot( <0.0,  (float)gIntSwing * DEG_TO_RAD,0.0> );

It's probably easiest if you cut and paste instead of trusting yourself to type it correctly and not omit punctuation.  :smileywink:

Please read Void's note at the top of the script about using a cut prim for the door.  That's because the script will rotate around the center of the prim, not its edge.  As written, that's the Z-axis (vertical).  If you want the door to rotate around the Y-axis, using the modification I just gave you, you'll have to cut the door the other way.  Do that by using your SLICE function in the Build/Edit tool.  Set SLICE B to 0.5 to cut off the bottom part of the door and put the hinge in the right place.

Good luck.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3939 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...