Jump to content

LindsayKat

Resident
  • Posts

    9
  • Joined

  • Last visited

Everything posted by LindsayKat

  1. Holy crap. It's working perfectly now. HUZZAH! i never was very good at geometry, so sorry about that. Thank you for the fixes, everyone. Now i need to study the absolute crap out of this to figure out what i need to do differently in the future. Yay, learning. Qie, what kind of efficiency changes would you suggest?
  2. Code updated in first post. HUZZAH! We have movement! Problem is... well... um. When i click on it, the doors a, skitter about five centimeters off center from each other then, b, fly about five meters away on a diagonal course. When i click on the frame to close it, they continue to slide another five meters away. Needless to say, i screwed something up, but apparently i know nothing of physics either, so... i know i've asked for a lot of help from you guys, but, please?
  3. Hmmm, okay. i had seen that script before and because i am moving multiple doors in the same thing, in different directions, etc, i wasn't sure how much it applied to me. But, it is useful, and thank you very much for reminding me. Question though: Do i have to have a rotation set as well, or can i just move the door without the rotation change?
  4. Yay! Thank you for that explanation, and that helped me to fix the problem. Updating code. Problem still is in the move part. Wish it were as simple as doing it with listeners and non-touch-linked. Okay, so what am i misunderstanding about the list itself? i get that llSetLinkPrimitiveParamsFast takes an int and a list. Is the list supposed to be what holds the vector for the move? If so, what's the integer in the llSet...Fast(int,list) supposed to be of?
  5. Profaitchikenz Haiku, thank you, that helped me figure out that the link set numbers were wrong anyway. Also, it has reminded me how much i hate for-loops, but that's another topic entirely. The checker would totally have vomited, but what you wrote was perfect to use with minor edits, so thank you. Qie Niangao, i thought it only updated when the door opened, but i didn't realize that wouldn't work... but even with the llSetLinkPrimitiveParamsFast, it still isn't moving anything.... i think maybe my problem isn't understanding how the list is supposed to play with all of this. Ideas? Also, yes, the top of the frame is the link set's root. Now, for some reason, when i click on the doors, it works though, so that's a start. Maybe restarting the sim did the trick.... Or script reset or something, i don't even know. Okay, now, using the llSetPrimitiveParamsFast is throwing an error, i think because i'm trying to use a vector instead of an int, and i don't know how to fix it. Sooo confused. Added a timer, and now it's closing the door every thirty seconds. Now what did i mess up? Placement? If i use an if(doorState == 0) statement, then it doesn't work at all... i've considered doing this the stupid way, and using listeners, but then i'd have to change the listener channel in every single door and that's a **bleep** that i don't want to deal with. (There will be a lot of doors.) (Code edited in first post to reflect updated version.)
  6. As far as i can tell, yes, those are the direct link numbers. Edit tab, edit linked, link number.
  7. So, i'm having some pretty frustrating issues here and i don't know where to start on this damned thing! Anyway. i have a frame and then two doors, one that is to slide left and the other to the right, into the wall. The script is in the frame of the door. Side note, for some reason, clicking on the frame will pop a debug saying that yes, its getting the click and opening and closing the door, but when i click on the doors themselves, it won't do that. i'm so confused. Would someone please help? (Heads up, i am, ah, rather new to scripting.) Thanks. Code below. /* * Sliding double door! IT WORKS! * By Lindsaykat (SL) / Katie Onyx (OpenSim private grid) * With a lot of help from the SL forums (in no particular order): * Qie Niangao, Rolig Loon, Profaitchikenz Haiku, Innula Zenovka * Updated 20150730 1040 SLT */ //Variables integer doorState = 0; //Indicates if door is opened or closed. integer dLLink = -1; //Link number for left door. integer dRLink = -1; //Link number for right door. vector dLPos; //Left door original position. vector dRPos; //Right door original position. float dLSlide = -0.1; //Original left door slide amount. float dRSlide = 0.1; //Original right door slide. list paramsL; //List for left door parameters. list paramsR; //List for right door parameters. key owner = NULL_KEY; float cT = 30.0; //Timer original time. //Functions init() { integer iiMax = llGetNumberOfPrims(); //Find the number of prims in the door. integer ii; //To determine what the actual link numbers are.... for(ii = 1; ii <= iiMax; ++ii) //Find them using this! { string name = llGetLinkName(ii); if(name == "L") //Feed the link number to dLLink dLLink = ii; else if(name == "R") //Or feed it to dRLink dRLink = ii; } owner = llGetOwner(); } open() { paramsL = llGetLinkPrimitiveParams(dLLink, [PRIM_POS_LOCAL]); //Grab original position, feed to left list. dLPos = ((vector)llList2String(paramsL, 0)); //Also feed that vector to the original pos. paramsR = llGetLinkPrimitiveParams(dRLink, [PRIM_POS_LOCAL]); //Feed original position to right list. dRPos = ((vector)llList2String(paramsR, 0)); //Feed vector to position vector. llSetLinkPrimitiveParamsFast(dLLink, [PRIM_POS_LOCAL, <dLPos.x, dLPos.y + dLSlide, dLPos.z>]); //Move dL along the Y axis .8 meters. llSetLinkPrimitiveParamsFast(dRLink, [PRIM_POS_LOCAL, <dRPos.x, dRPos.y + dRSlide, dRPos.z>]); //Move the right door now, .8 meters, y axis. doorState = 1; //Set the door state to 1. //llWhisper(0, "Door Opened"); //Debugging. llSetTimerEvent(30.0); } close() { llSetTimerEvent(0.0); //Move doors back to original position. llSetLinkPrimitiveParamsFast(dLLink, [PRIM_POS_LOCAL, dLPos]); llSetLinkPrimitiveParamsFast(dRLink, [PRIM_POS_LOCAL, dRPos]); doorState = 0; //Set door state to close. //llWhisper(0, "Door Closed"); //Debugging. } //Main default { state_entry() { if(owner == NULL_KEY) init(); //Debugging. //llSay(0, (string)dLLink); //llSay(0, (string)dRLink); llSetTimerEvent(0.0); dLSlide = -0.65; dRSlide = 0.69; } touch_start(integer num_detected) //When touched, open or close. { if(doorState == 0) //If door state is closed: { open(); } else if(doorState == 1) { close(); } else { //llWhisper(0, "Invalid Command"); } } timer() { close(); } }
×
×
  • Create New...