Refrigerators
|
|
Cocoanut Koala
Coco's Cottages
Join date: 7 Feb 2005
Posts: 7,903
|
10-10-2006 21:36
I need a refrigerator to have two doors, both linked TO the refrigerator, which open out. When I link doors to the refrigerators, they goofed up - because doors don't like to be linked!
So - how can I make my two-door refrigerator work right?
Thanks in advance,
coco
|
|
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
|
10-10-2006 22:13
Are your doors a single prim apiece?
_____________________
-
So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.
I can be found on the web by searching for "SuezanneC Baskerville", or go to
http://www.google.com/profiles/suezanne
-
http://lindenlab.tribe.net/ created on 11/19/03.
Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard, Robin, and Ryan
-
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
10-11-2006 04:48
You could Rez the doors from within the fridge when you rez it? But why cant you have them linked?
|
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
10-11-2006 06:07
I suspect use of a hinge script, rather than a cut prim and a rotation script.
|
|
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
|
10-11-2006 06:23
Use a vehicle door script. A rectangular prim is cut in half, so it's "center" is along one edge".. then the "touch to rotate" script" is added, but rather than using the world axis, it must use the relative object axis This is the door script I use on my refigerator. The door is hinged on the left side. A simple rotation of the prim and textures will enable you to rotate it on the right. I used a "freezer top, fridge bottom arrangement, so I just re-used and squished the door prim and script shown below.
// Modified by SignpostMarv Martin. // improved door script by Ezhar Fairlight // features: automatic closing, workaround for rotating out of position, // doesn't mess up when moved, adjustable direction (inwards/outwards) // updated for SL 1.1 damped rotations, small bugfix
// ********** USER SETTINGS HERE ********** float TIMER_CLOSE = 20.0; // automatically close the door after this many seconds, // set to 0 to disable
integer DIRECTION = 1; // direction door opens in. Either 1 (outwards) or -1 (inwards); // ********** END OF USER SETTINGS **********
integer DOOR_OPEN = 1; integer DOOR_CLOSE = 2;
vector mypos; // door position (objects move a tiny amount // away from their position each time they are rotated, // thus we need to workaround this by resetting // the position after rotating) door(integer what) { rotation rot; rotation delta; llSetTimerEvent(0); // kill any running timers if ( what == DOOR_OPEN ) { llTriggerSound("Door opend2", 1); rot = llGetLocalRot(); delta = llEuler2Rot(<DIRECTION * PI_BY_TWO * 1.5, 0, 0>); rot = delta * rot; // rotate by -45 degree llSetLocalRot(rot); } else if ( what == DOOR_CLOSE) { rot = llGetLocalRot(); delta = llEuler2Rot(<-DIRECTION * PI_BY_TWO * 1.5, 0, 0>); // rotate by 45 degree rot = delta * rot; llSetLocalRot(rot); llTriggerSound("Door opend2", .5); } }
default { // is closed on_rez(integer start_param) { // reset, so we store the new position llResetScript(); } changed(integer change) { if(change && CHANGED_OWNER) { llResetScript(); } } state_entry() { mypos = llGetPos(); // remember where we're supposed to be } touch_start(integer total_number) { door(DOOR_OPEN); state is_open; } moving_end() { // done moving me around, store new position mypos = llGetPos(); } }
state is_open { state_entry() { llSetTimerEvent(TIMER_CLOSE); } touch_start(integer num) { door(DOOR_CLOSE); llSetPos(mypos); // workaround for tiny movements during rotation state default; } timer() { // it's time to close the door door(DOOR_CLOSE); llSetPos(mypos); // workaround for tiny movements during rotation state default; } moving_start() { // close door when door is being moved door(DOOR_CLOSE); state default; } }
_____________________
 ● Inworld Store: http://slurl.eclectic-randomness.com ● Website: http://www.eclectic-randomness.com ● Twitter: @WinterVentura
|
|
Cocoanut Koala
Coco's Cottages
Join date: 7 Feb 2005
Posts: 7,903
|
10-12-2006 11:20
Thanks, y'all!
OK, so last night I worked on the refrigerator (which consists of a freezer compartment, a regular compartment, and the doors to each, plus a base). I tried various scripts, including the one above (which caused the door to swing on a very odd axis), making sure not to link either of the doors last. I got the refrigerator to work - until I moved the refrigerator. Once I move it, the doors don't work right anymore (or even necessarily wrong in a logically predictable fashion). What's up with that? coco
|
|
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
|
10-12-2006 11:45
From: Cocoanut Koala I got the refrigerator to work - until I moved the refrigerator. Once I move it, the doors don't work right anymore (or even necessarily wrong in a logically predictable fashion). What's up with that? Some scripts don't take into account the orientation of item in world, so as soon as you rotate the object, all hell breaks loose. If you still need help with it drop me IM in world, may have something for you ^^;
|
|
Vares Solvang
It's all Relative
Join date: 26 Jan 2005
Posts: 2,235
|
10-13-2006 11:51
At the Phase 5 HQ - Airfield (Caldbeck 221,200,40) There is a freebie box with some really useful rotation scripts that I am pretty sure will totally solve your problem. (It's a square prim with a radiation symbol on it. Those Landmark coords should put you right next to it.) They are a pain in the butt to set up, but once it's set they work wonderfully. There really isn't much in the way of instructions with them though, so I will give you a quick how-to to save you some think time. Get your object all set up for how it should be when closed. Make sure the doors are not the root prim. Now, in the folder you will be given there is a script called “ChildPrim WhereAmI? HowAmIRotated?”. This is the script that gives you all the position and rotation data that you need to put into the actual movement scripts. There are two scripts called “Wings (Local rotate and move)” and “Wings (Local rotate only)”. Choose which will be the right one for you, with the fridge it will prob be the local rotate only I would imagine. Put it in each door. Then, drop the “ChildPrim” script into one of the doors. It will tell you the current rotation of the door and then delete itself. Open the Wings script and put that rotation info into the “Closed Position” fields at the top of the script. Now, manually rotate the door to what you want to be the open position. Repeat the process of dropping the ChildPrim script in and then putting the rotation information into the “Open Position” fields of the Wings script. Repeat this whole procedure with the other door. Now just put the Voice Command script into the root prim, and if you put all the numbers in right your fridge should work perfectly. One note though, the two different Wings scripts listen for different command words from the Voice Command script, so make sure they are both using the same words. (That one took me a few frustrating minutes to figure out!) The scripts are set up to be voice activated, but the Voice Command script can easily be converted to touch activated in just a few mins. These are freebie scripts but I won't post them here or give them out because I believe the people at Phase 5 use them as a “get people in the store” sort of thing. Besides, there are some other cool freebies there so it's worth the trip, and I own one of their choppers and they are good quality so are worth a look too. (Although if you are having problems with converting it, I will give you my touch activated “Voice command” script.) Coco, I am pretty sure you won't have any probs but if you do, give me an IM and I will help you get it set up.  Edit: Oh, I just looked, they aren't freebies but cost 25 lindens. They are deff worth the price (you get full perms).
|
|
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
|
10-13-2006 12:29
From: Vares Solvang At the Phase 5 HQ - Airfield (Caldbeck 221,200,40) There is a freebie box with some really useful rotation scripts that I am pretty sure will totally solve your problem. (It's a square prim with a radiation symbol on it. Those Landmark coords should put you right next to it.) They are a pain in the butt to set up, but once it's set they work wonderfully. There really isn't much in the way of instructions with them though, so I will give you a quick how-to to save you some think time. Get your object all set up for how it should be when closed. Make sure the doors are not the root prim. Now, in the folder you will be given there is a script called “ChildPrim WhereAmI? HowAmIRotated?”. This is the script that gives you all the position and rotation data that you need to put into the actual movement scripts. There are two scripts called “Wings (Local rotate and move)” and “Wings (Local rotate only)”. Choose which will be the right one for you, with the fridge it will prob be the local rotate only I would imagine. Put it in each door. Then, drop the “ChildPrim” script into one of the doors. It will tell you the current rotation of the door and then delete itself. Open the Wings script and put that rotation info into the “Closed Position” fields at the top of the script. Now, manually rotate the door to what you want to be the open position. Repeat the process of dropping the ChildPrim script in and then putting the rotation information into the “Open Position” fields of the Wings script. Repeat this whole procedure with the other door. Now just put the Voice Command script into the root prim, and if you put all the numbers in right your fridge should work perfectly. One note though, the two different Wings scripts listen for different command words from the Voice Command script, so make sure they are both using the same words. (That one took me a few frustrating minutes to figure out!) The scripts are set up to be voice activated, but the Voice Command script can easily be converted to touch activated in just a few mins. These are freebie scripts but I won't post them here or give them out because I believe the people at Phase 5 use them as a “get people in the store” sort of thing. Besides, there are some other cool freebies there so it's worth the trip, and I own one of their choppers and they are good quality so are worth a look too. (Although if you are having problems with converting it, I will give you my touch activated “Voice command” script.) Coco, I am pretty sure you won't have any probs but if you do, give me an IM and I will help you get it set up. Edit: Oh, I just looked, they aren't freebies but cost 25 lindens. They are deff worth the price (you get full perms). I really need to clean that package up. I did a pathetic job on it. It needs examples for touch-to-open, more comments in the code, and a notecard explaining the idea behind "ChildPrim WhereAmIHowAmIRotated".
|
|
Vares Solvang
It's all Relative
Join date: 26 Jan 2005
Posts: 2,235
|
10-13-2006 12:41
From: Jillian Callahan I really need to clean that package up. I did a pathetic job on it. It needs examples for touch-to-open, more comments in the code, and a notecard explaining the idea behind "ChildPrim WhereAmIHowAmIRotated". Hey, don't get me wrong! It's a great set of scripts and I love them. Thank you for making them available. However, when I first got them I didn't know enough about scripting to figure out how to use them. I've sinced learned more about LSL and it's pretty obvious to me now. Feel free to cut and paste my little explaination into a notecard if you want (edited however you like of course). Again, thank you very much for these scripts. Rotations can drive a person nuts!
|
|
Cocoanut Koala
Coco's Cottages
Join date: 7 Feb 2005
Posts: 7,903
|
10-13-2006 22:11
Thank you for all the help, guys!
I have spent close to two weeks on this problem, and I decided tonight to just finish up the house and postpone the appliances for a future build. After I finish the house, I will get back to this issue, with these notes in this thread for reference.
coco
|