|
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
|
02-13-2006 08:42
I am trying to figure out how to set up a touch-scripted door that hinges on one edge, like a normal door. I have tried a couple of the scripts in the script library and in the LSL WIKI, and what happens is that the door pivots on it's centerline, rather than on it's hinged edge.
[====wall====][=door=][====wall====]
The door is between two wall sections, and has a filler panel above it.
I suspect that I need to create a 'hinge joint', between the door and the wall section on the right. But when I tried, it said I couldn't make the wall physical because there were other prims interpenetrating it. Unfortunately, the wall that I want to attach the door to needs to have prims passing through it, so the aplha-mapped window has a windowsill, and so the roof fits right. So what do I do? Add another prim to the right of the door as a 'hinge post'? ("[P]", below):
[====wall====][=door=][P][===wall====]
So... what needs to be physical, phantom and/or linked to get a door to hinge normally, and how do I set that up? I think I am close, but something still isn't connecting for me.
Many thanks in advance for the answers, or for links to suitable threads. I wasn't able to find an explanation of what I am doing wrong, here or in the WIKI, but surely I can't be the first person to ask about this?
|
|
Sol Columbia
Ding! Level up
Join date: 24 Sep 2005
Posts: 91
|
02-13-2006 08:53
On your door, put an invisible prim on the hinge side, make it the root prim, then you can use llSetRot in a script to get the behavior you're looking for.
|
|
Herzog Svarog
The Wise(ass)
Join date: 9 Nov 2004
Posts: 74
|
02-13-2006 08:54
In using the script you've described you need to make the door twice the size (width) that you want it, then cut it in half and it will work the way you expect with no hinges or additional prims.
|
|
Jigsaw Partridge
A man of parts
Join date: 3 Apr 2005
Posts: 69
|
02-13-2006 08:54
I think most hinged doors in SL use prims which have been cut or dimpled in half so that the visible edge of the prim is aligned with a primary axis origin (i.e. the hinge axis) - in this case the simple rotate script you have will work fine. The alternative is to use a script which rotates about an offset axis, see instructions in the LSL Wiki under the rotations entry. This latter method is not so popular, since it makes the door appear to slide slightly as it rotates.
|
|
Kurshie Muromachi
Primtastic!
Join date: 24 Apr 2005
Posts: 278
|
02-13-2006 09:03
The way I do it is with a half-cut cube. Look here... /54/e3/55966/1.htmlThen for the script try this... /54/f8/55550/1.htmlEDIT: Sorry about the dupe link. Copy/Paste goofed.
|
|
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
|
02-13-2006 09:06
Thank you! I knew there had to be a simple solution that I was overlooking! That idea of making the door prim double-wide and cut 50% sounds perfect! I'm already doing a lot of cut and otherwise tortured prims for my low-prim building, so that should be easy to implement.
And with that, no part of it needs to be physical, right? Great!
|
|
Kurshie Muromachi
Primtastic!
Join date: 24 Apr 2005
Posts: 278
|
02-13-2006 09:08
From: Ceera Murakami And with that, no part of it needs to be physical, right? Great! Right 
|
|
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
|
02-13-2006 09:13
One last point. What about "prim drift", as mentioned in the linked threads, above?
A good door script should be able to compensate for that, I hope? I am not in a position to look at my available scripts right now, but I think at least one in the linked material or in the ones I already found dealt with that glitch, somehow.
{EDIT} Never mind. I read the linked threads more thoroughly, and yes, one of the door scripts there covers the prim drift problem. {/EDIT}
|
|
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
|
02-13-2006 11:24
Well, I got a door to work, finally.
I tried the prim torture route, and it did produce a door that could be pivoted on its Z-axis, to 'hinge' on one edge. But the script tried rotating it on the X-axis instead!
While trying to fix that, I realized that the script, the Deluxe Door Script from the LSL WIKI, would shape and initially texture the prim for me if I dropped it on a default cube. I did this, and that door worked fine. With a little re-sizing and re-texturing, I now have the door I needed, and it works right!
I need to fiddle with it a bit to get both left and right handed doors, but I am sure that should be fairly simple - just a matter of turning the door around on the Z-axis, swapping the front and back textures (it's a board and batten door, so the two sides are different) and changing one variable in the script to reverse the direction that it opens.
Again, many thanks for the fast responses, everyone!
|
|
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
|
02-15-2006 08:24
OK... Something new and screwy is happening now. The doors suddenly started affecting each other, or opening at cockeyed angles.
The door script in question is the "Deluxe Door" script from the LSL WIKI. No changes except to alter the variable for the direction of the door swing, and the doors have been rotated on the Z-axis as they are placed, to get them facng the right way when closed.
I'm building a 1/5 scale model of a two story building. I placed some of these doors as double doors, and some as singles, on each floor. As I have been editing and adding to each floor, I have been unlinking and then linking parts for one floor together, so I can easily slide the floor to one side to work on each level. I have tried to make the last step before re-linking be to de-select and re-select a section of floor, so that one prim remains the root prim.
Up until yesterday, it all worked great. I could open one or both doors in a pair, and they both stay open until the script auto-closes each door. They always remained in the door openings, and properly oriented for the open and closed positions. I could even take the model outside and expand it to full-scale for a real walk-through, with very little mis-alignment of any prims. In fact, before things went strange, I did just that with a copy, and the whole structure worked as expected. I then deleted the expanded copy and continued working with the original model...
Yesterday and this morning I made two changes, and it screwed up the doors on the ground floor.
1) I added a handrail to a back staircase on the ground floor, which consisted of a top-sheared cube prim, rotated on the x-axis to match the staircase angle. The floor was unlinked, the handrail added to the selection, and the batch re-linked. I may have failed at that time to de-select and re-select the piece of floor that I have been using as my root prim for the linked floor, which means the slanted handrail mght have become the root prim.
2) I added six fireplaces, three on each floor, each of which has a 'fire' in it, which consisted of two angled planes. I believe the root prim in the fireplaces is a cube that is rotated 90 degees on the X-axis, because the hollowed prim for the fire box is rotated to present the opening as needed, and I replicated that prim in the same orientation for the foundation and chimney, leaving the orientation the same for easier texturing. When I unlinked the floors to add the fireplaces to the link set, I may, again, have failed to de-select and re-select a floor section, to keep that the root prim. So one rotated part of one fireplace may be the root prim now.
I tried doing a camera-fly walk-through of the model, and when I opened the second door in a pair, it forced the other in the pair to close. They aren't linked, script wise, and never interacted before. I selected the linked assembly and tried resetting all the scripts, and after that, they no longer affect each other, but they open at strange, cockeyed angles. I have to open and close each door a dozen or so times to get them back to the original orientation.
I have saved some previous copies of the model as I went, as well as all the modular parts in the build, so I can go back to a stage where it works and fix things fairly easily, or could just replace the misbehaving parts. But I sure would like to know what went wrong. Is it because the link set wound up with a root prim that was rotated to a non-90 degree angle, on something other than the Z-axis? Did resetting the scripts re-orient the default axis to something strange, like to the angled handrail?
|
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
02-15-2006 10:33
I'm not used to the deluxe door script from the wiki, I tend to use one of my own. My first thought however, it's unlikely if llSetLocalRot() is being used correctly that adding new things should screw it up. That said I guess it's not impossible. You could try recompiling the door scripts in the new build and see if that makes the door start working again.
If it doesn't I'll hook my brain out and look at the deluxe script unless someone else beats me to it.
|
|
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
|
02-15-2006 11:28
Well, apparently it was having an angled root prim that threw it off... I rezzed the whole thing and tried it again. Still screwy, but noted it was only the ground floor that was messed up. So it wasn't the fireplaces, which are on both floors. Must be that handrail... Deleted the structure, rezzed it again, and this time selected the linked ground floor set, unlinked it, de-selected and re-selected a wall section, to make it the root prim, and then re-linked the floor. Everything works fine now! I think the cause was that the script has coding in it which is intended to compensate for prim drift, and that code probably checked the position of the object it was in. With a tilted root prim, it assumed the door had been tilted, as well... Anyway, problem solved!
|