These forums are CLOSED. Please visit the new forums HERE
Door Script Not Working RIght |
|
|
Fearsum Vellhi
Registered User
Join date: 29 Oct 2006
Posts: 19
|
08-15-2007 07:02
I built a house with doors that open/close and lock. Everything works fine. But... when I link everything together, the door script doesn't open the door. It recognizes me and gives status messages, but the door doesn't open. If I unlink the house, it works normally. Does anyone know why this would happen, or what I can do to fix it? Thanks.
|
|
Nika Talaj
now you see her ...
Join date: 2 Jan 2007
Posts: 5,449
|
08-15-2007 08:08
Door scripts are funny -- the rotation is relative to the root prim, so when you link them odd things can happen.
See this thread: /8/4c/203879/1.html |
|
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
|
08-15-2007 16:36
For doors, you pretty much either need to use cut prims with a script that adjusts according to *local* reference, or use some scripts that do some special math to take into account the fact that the prims are linked.
|
|
Thili Playfair
Registered User
Join date: 18 Aug 2004
Posts: 2,417
|
08-15-2007 22:50
Been awhile since i tried this, but something like this i guess,
integer on=FALSE; default { touch_start(integer total_number) { if(on==TRUE) { rotation rot = llGetRot(); rotation delta = llEuler2Rot(<0,0,PI/4> ;rot = delta * rot; llSetRot(rot); llSleep(0.25); rot = delta * rot; llSetRot(rot); on=FALSE; } else { rotation rot = llGetRot(); rotation delta = llEuler2Rot(<0,0,-PI/4> ;rot = delta * rot; llSetRot(rot); llSleep(0.25); rot = delta * rot; llSetRot(rot); on=TRUE; } } } |
|
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
|
08-16-2007 20:42
That's probably the oddest problem I've ever heard...and I'm a door-maker that deals with every door problem you could possibly imagine
![]() I would imagine it has something to do with the rotation not being set as a local-rot like previous posters have mentioned. However, if such is the case, your entire house would likely attempt to rotate. Personally...if you've found that they worked while not linked to the house itself...and you're not planning to sell the house (or if you ARE planning to sell the house, but use a box rezzer where you can let a customer rezz multi-object homes no problem), then just use them in an unlinked state. _____________________
--AeonVox--
Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music. |
|
Soen Eber
Registered User
Join date: 3 Aug 2006
Posts: 428
|
08-17-2007 17:51
If its the multi-user lockable door the door (and hinge component) need to be linked separate to work. So you have one link set for the house, and a 2nd link set for the door and hinge (the hinge can be hard to find).
If that's the case AND you or someone you know is handy with building/scripting, there's a sequence of steps you can follow to convert them to a state where the door can be linked to the house. It requires a moderate-to-advanced level of competence with building and only a passing familiarity with scripting. 0) Record all current door settings (not needed, but nice to have in case of accidents) 1) Locate both the door and the door hinge. Pull both away slightly from the house so you can work on them easier (you will need to unlink) 2) Have available a door texture you can use to replace the current door with 3) resize and path cut (to .125 & .625) the hinge until it is the right shape and size to serve as a replacement door. Change the object type to cube if needed. 4) Retexture the hinge with the door texture(s) you have selected. You'll want to edit the inside and outside faces separately, and make sure the remaining faces are textured with a non-alpha texture. 5) In the door script, replace all references to "llSetRot" with "llSetLocalRot". Also replace all references to "llGetRot" with "llGetLocalRot". 6) Delete the original door if you haven't already done so. 7) Reposition the new door and link to the house. Not really all that simple, but if you're handy...maybe a five minutes job tops. There are better doors out there though, and I say that as the current developer for the multi-user lockable door. |