Britt32 Beck Posted September 20, 2019 Share Posted September 20, 2019 Hello, I have a cabinet that has two sliding doors, each needs to slide inwards towards the center of the cabinet. I can't find a script where i can set the distance needed to slide, everything i've bought so far slides too far and is not adjustable. I've found one that seems to work, but it's not a linkable script. Would anyone know of a script that is fully modifiable and has click to open, click to close? Thanks! Link to comment Share on other sites More sharing options...
Rolig Loon Posted September 20, 2019 Share Posted September 20, 2019 Link to comment Share on other sites More sharing options...
Britt32 Beck Posted September 20, 2019 Author Share Posted September 20, 2019 Thanks, but that script seems to be for one door only. I have two doors attached to the cabinet that need to slide opposite directions. Does this script cover that? Link to comment Share on other sites More sharing options...
Rolig Loon Posted September 20, 2019 Share Posted September 20, 2019 Yes, you could easily modify it or any sliding door script to talk to a companion. Link to comment Share on other sites More sharing options...
Britt32 Beck Posted September 20, 2019 Author Share Posted September 20, 2019 I'm not a scripter, nor do i understand it much. I wouldn't know where to begin to do something like that. Link to comment Share on other sites More sharing options...
Britt32 Beck Posted September 20, 2019 Author Share Posted September 20, 2019 Actually this script is perfect if I knew how to add a second door that works independently from the the one i have working. I was able to get the direction of the slide and the distance for the one on the left corrected. Any suggestions would be greatly appreciated! Link to comment Share on other sites More sharing options...
Rolig Loon Posted September 20, 2019 Share Posted September 20, 2019 A second independent door? Just name the second door something else. Notice the comment line in the script that says // All prims in the door must be named "DOOR", and none can be the root prim of the linkset Well, in your second door, name all prims something like "door" instead of "DOOR", and be sure to change the two places in the script that look for the name of the door that you touched. 1 Link to comment Share on other sites More sharing options...
Britt32 Beck Posted September 20, 2019 Author Share Posted September 20, 2019 I wasn't aware you could drop two scripts into an object. While that works now, it seems inefficient. It would be nice to have the one script listen for both RIGHTDOOR and LEFTDOOR and slide each different directions ( Left slides on the +, Right slides on the - ) Link to comment Share on other sites More sharing options...
Rolig Loon Posted September 20, 2019 Share Posted September 20, 2019 Yes, I agree. If you were a scripter, you could do just that. This particular script is a very simple, bare bones script that could be modified in lots of ways, including managing several doors. So, you have a choice. You could either figure out how to change it yourself -- not a terribly difficult job -- or you could hire a scripter to do it for you. Or, you could just go ahead and use two separate copies of this script, one in each door. Frankly, the small inefficiency of using two scripts is almost negligible, and that's by far the easiest option you have. If you were scripting an entire house full of doors, I'd think abut the modification. Link to comment Share on other sites More sharing options...
Chic Aeon Posted September 20, 2019 Share Posted September 20, 2019 I needed a sliding door script (first time in over a decade if I am remembering correctly) for a pocket door for Lani's new trailer. I tried a bunch of sliding door scripts that I had saved including Rolig's ancient one but this one the only one that I could make work. So it may be helpful. The slide is dependent on the direction you door needs to move so the default is East and West (if I am not too tired) and you would change for North to South. So that might not be what you are looking for, but here it is (no creator info on the file): integer isOpen = FALSE; vector originalPos; float slideBy = 1.6; init() { originalPos = llGetLocalPos(); vector size = llGetScale(); // Set up the amount to move by. Use size.y instead of size.x // if you want to slide along the y-axis. slideBy = size.x - 0.22; } openclose() { if (isOpen) { llSetPos(originalPos); isOpen = FALSE; } else { llSetPos(<originalPos.x + slideBy, originalPos.y, originalPos.z>); // To move alon the y-axis, use this instead: // llSetPos(); isOpen = TRUE; } } default { state_entry() { init(); } on_rez(integer param) { init(); } touch_start(integer total_number) { openclose(); } changed(integer change) { // When the links change, reset the script // so that we pick up the changes. if (change & CHANGED_LINK) { llResetScript(); } } } Link to comment Share on other sites More sharing options...
Britt32 Beck Posted September 20, 2019 Author Share Posted September 20, 2019 (edited) Thank you both. Chic, I will try the script you have here so I can compare. As of now, the cabinet is working and by a bit of trial and error, I was also able to figure out how to modify a z axis swinging door to swing on the x, and move the pivot point from center to the far edge so it doesn't swing from the middle of the mesh. (this particular cabinet has a top hatch as well as the two sliding doors, that was problem 2, but now solved also!) Thanks again. Edited September 20, 2019 by Britt32 Beck 1 Link to comment Share on other sites More sharing options...
Rolig Loon Posted September 20, 2019 Share Posted September 20, 2019 And you said that you weren't a scripter! This is how we all begin. A small challenge pokes us into trying something, and it works. I should warn you ... once the bug bites, there's no turning back. Scripting is like doing crossword puzzles or whatever your favorite puzzle is. It's addictive, and very rewarding. Keep at it. As you get stuck on whatever you are working on, feel free to bring it here to share. This forum is a place for scripters to share insights and to commiserate about things that aren't quite working right yet. 1 Link to comment Share on other sites More sharing options...
drifox McMillan Posted March 18, 2021 Share Posted March 18, 2021 (edited) Hi all, Britt32 Beck, Chic Aeon, Sorry to reassemble this topic, but I am unable to modify the sliding axis of my bay window. In my house, all the doors are oriented in the same direction, except one, which is in another axis. when i link my door to my building it doesn't want to open the right way, i tried to adjust the script but i can't. can you help me please? Edited March 18, 2021 by drifox McMillan Link to comment Share on other sites More sharing options...
Recommended Posts
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