These forums are CLOSED. Please visit the new forums HERE
locket script |
|
Polyester Partridge
Registered User
Join date: 29 Sep 2005
Posts: 23
|
12-01-2005 13:22
Im looking to make a locket with a door script, but when it moves everytime i open and close it on the avatar and misaligns itself. Does anyone know of a way to make it open and close and stay put on an avatar, or if its even possible?
|
Cid Jacobs
Theoretical Meteorologist
![]() Join date: 18 Jul 2004
Posts: 4,304
|
12-01-2005 14:59
Make sure the moving part is not the parent prim (the last one selected when linked) and try using the functions llSetPos & llSetRot . Hope that helps.
![]() _____________________
|
Lightwave Valkyrie
Registered User
![]() Join date: 30 Jan 2004
Posts: 666
|
12-01-2005 16:10
i used the vehicle door script on my locket
it uses setpos and setrot like cid said ![]() -LW |
Logan Bauer
Inept Adept
![]() Join date: 13 Jun 2004
Posts: 2,237
|
12-01-2005 16:39
This might help also...
_____________________
![]() PICS - BLOG - http://arcticgreenhouse.blogspot.com/ XSTREET - INWORLD -http://slurl.com/secondlife/Alternate Reality/144/138/54/ |
Zodiakos Absolute
With a a dash of lemon.
Join date: 6 Jun 2005
Posts: 282
|
12-02-2005 20:33
I've made a script for a locket (the one I'm wearing ^_-) that used llSetAlpha to toggle between open and closed states instead, and it works pretty well. You might want to take that route if you can't get this to work right. It's the same technique that is used on several tails and sometimes other... anatomical devices.
![]() |
elka Lehane
WOWAWIWA
![]() Join date: 30 Mar 2005
Posts: 983
|
12-02-2005 20:40
P0l Pawns
_____________________
View my profile inworld for direct teleports to all !BF! locations :3
|
Scopi Pascal
Registered User
Join date: 31 May 2005
Posts: 20
|
Scopi Pascal's Locket Door Script v0.1
12-05-2005 19:19
Im looking to make a locket with a door script, but when it moves everytime i open and close it on the avatar and misaligns itself. Does anyone know of a way to make it open and close and stay put on an avatar, or if its even possible? Step 1: Create 2 half spheres and place them in the same x,y,z coordinates so they look like a full sphere. Change the color or texture of the front one so you can tell them apart. Step 2: Create a new script in the front piece and add this code: // Scopi Pascal's Locket Door Script // Feel free to use it and send me any L$ you think appropriate // Shout out to Polyester Partridge for asking me to do this when I was wandering around in my PJs // Version 0.1 // Created 12/04/2005 // Last Modified 12/05/2005 // status is used to figure out if we are opening or closing the door. integer status = 1; default { touch_start(integer total_number) { // new_pos is used to move the door vector new_pos; new_pos = llGetLocalPos(); // y_30 is because we step rotate the door 6 times. 6*30=180 or 1/2 circle rotation y_30 = llEuler2Rot( <0, 30 * status * DEG_TO_RAD, 0> ); // see how we multiply by status, so the -1 will move the other way rotation new_rot; integer x; new_rot = llGetLocalRot(); for (x = 0; x < 6; x++) { new_pos = new_pos + <.05/6*status, 0, 0>; llSetPos(new_pos); new_rot = y_30 * new_rot; llSetLocalRot(new_rot); } //reverse status status = status * -1; } } |