Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Rotation/Door Script

Smoke Carter
Registered SCOTTISH User
Join date: 29 Apr 2007
Posts: 31
08-26-2009 00:48
I am running into big problems. Here is what I have so far: I want a "hinge" to rotate a set of linked prims over a 90° angle on touch, then return it on touch, while the object is being WORN. I have tried door scripts galone, they all snap the object OFF the avatar, turn it sideways then do their "open-close" routine. My scripting skills are not such that I can find the problems and correct this.
My instinct tells me this is a very simple script that does NOT take the physical location within the entire SIM into account......sort of like fixing a no sound problem by turning on the speakers, but for the life of me, I am at a dead end.
Can someone PLEASE point me in the right direction
Smoke Carter
Ephraim Kappler
Reprobate
Join date: 9 Jul 2007
Posts: 1,946
08-26-2009 00:53
Virtual ignoramus here but have you tried using llGetLocalRot and llSetLocalRot instead of llGetRot and llSetRot?
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
08-26-2009 02:17
you'll want to use get local, and not get root (as it will return the region rotation and you don't want that)

this should work just fine for attachments IIRC (ignore the part about the cut root when using a hinge or ball joint
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Smoke Carter
Registered SCOTTISH User
Join date: 29 Apr 2007
Posts: 31
ignoramus????????
08-26-2009 05:39
From: Ephraim Kappler
Virtual ignoramus here but have you tried using llGetLocalRot and llSetLocalRot instead of llGetRot and llSetRot?

not at all, solved the problem totally.
I am not totaly conversant in ANY programming language, just have enough to get meself in trouble.
When I could do you a good turn, then do not hesitate to ask!
Ephraim Kappler
Reprobate
Join date: 9 Jul 2007
Posts: 1,946
08-26-2009 07:16
From: Smoke Carter
not at all, solved the problem totally.
I am not totaly conversant in ANY programming language, just have enough to get meself in trouble ...

Neither am I any kind of expert. Glad to see you got it sorted but I suggest you investigate the link Void provided just to be on the safe side. She's no slouch in these matters.