|
Octal Khan
Putting the Mod in Modern
Join date: 14 Feb 2004
Posts: 116
|
05-30-2006 23:01
Hi all, Well, what I thought was a problem with 1.10 was there all along, and im hoping someone can help me out. I have a house with doors that have remote switches to open them. But once the linked house is rotated, the switches no longer work. Im fairly sure I need a SetLocalRot in the Door target script but I just cant figure out where or how...if anyone has time can you take a look at this script and let me know what will work? thanks! ####DOOR TARGET SCRIPT### integer listener; //handle for the listen open() { vector target = origpos + newpos; while (llVecDist(llGetLocalPos(), target) > 0.001) llSetPos(target); llSetTimerEvent(20); } close() { vector target = origpos; while (llVecDist(llGetLocalPos(), target) > 0.001) llSetPos(target); llSetTimerEvent(0); } vector origpos; vector newpos = <0,0,4>; default { state_entry() { llListen(1003,"",NULL_KEY,""  ; origpos = llGetLocalPos(); } timer() { close(); } listen(integer channel, string name, key id, string message) { if (message=="Door Opened"  { open(); } else if (message=="Door Closed"  { close(); } } }
|
|
Angela Salome
Registered User
Join date: 6 Oct 2005
Posts: 224
|
05-30-2006 23:38
Hi, Octal. I've just tried your code with two primitives for walls and a third primitive for the door, and the door goes up and down opening not matter how I rotate the house. I think the problem might be due to the shape or rotation of the primitives making up the door? Or you might be at the link range limits, which will stop the motion of the linked door?
|
|
Nexus Nash
Undercover Linden
Join date: 18 Dec 2002
Posts: 1,084
|
05-31-2006 07:55
You need to take into account the 'base' rotation in the house and apply it to the prims. Take a look at these examples. Not for the faint of 'math' http://secondlife.com/badgeo/wakka.php?wakka=rotation
|
|
Octal Khan
Putting the Mod in Modern
Join date: 14 Feb 2004
Posts: 116
|
05-31-2006 10:50
From: Angela Salome Hi, Octal. I've just tried your code with two primitives for walls and a third primitive for the door, and the door goes up and down opening not matter how I rotate the house. I think the problem might be due to the shape or rotation of the primitives making up the door? Or you might be at the link range limits, which will stop the motion of the linked door? thanks angela, can you try it with both switch and target prims parented to a master prim and let me know if it still works? heres the switch script ### DOOR SWITCH SCRIPT### integer on; //is the switch on? default { state_entry() { llSay(0, "Click to Open The Door"  ; } touch_start(integer total_number) { if (on == 0) { on =1;//now it's on llShout(1003, "Door Opened"  ; } else if (on == 1) if (on == 1) { on =0;//now it's off llShout(1003, "Door Closed"  ; } } }
|