Jump to content

Kallie Barrowstone

Resident
  • Posts

    9
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Your fix worked! You have most definitely inspired me to learn more about scripting. I'm intrigued and plan to work out what you did for myself. I really do appreciate all the help, and the time you spent assisting me. Best wishes to you and many thanks!
  2. Nothing like scripts to make me feel like a total noob. lol No matter what I try, when I attempt to move the parts you suggest, I get syntax errors. I'm afraid I don't know the proper format for the braces, etc.
  3. Dora - Many thanks for the keyframed script! It is definitely much smoother than the original script I was using. At this moment, when I rotate the chair it will stay where I put it and rock in the new direction only if I reset the script. Is this the only way, to reset the script whenever I decide to turn it? It appears I'm still at square one, albeit with a much smoother script. :matte-motes-tongue:
  4. I removed the brace and it saved fine. Thanks! Unfortunately, the script just made the entire chair rotate in a complete circle.
  5. Dora I really appreciate all the time you are taking to assist me. I tried the script you modified, and it gave me a syntax error on 11,0. In what way should the linkset need to be changed so that it corrects the problem, but still allows one to click on the chair and have it rock?
  6. Ok, well at least I got that part right. The problem still remains and I'm hoping someone can suggest what to change in the script so that it will still rock no matter which way it's facing.
  7. Nope, I have it in a sphere that is situated under the seat of the chair, and I have that prim set as the root. Making it a child prim doesn't allow me to click the chair to begin rocking. I was under the impression that the script had to be in the root prim so that it can rock all other child prims?
  8. Ok, I reset the script after the move but it then starts rocking side to side rather than front to back. In fact, regardless of which way the chair is facing, if I do a script reset it makes the chair rock side to side.
  9. I know that there has got to be a simple fix for this (at least I hope!) Below is the script I'm using for my rocking chair. My problem is that when I turn the chair to face another direction it will reset itself to the original position when you click to begin rocking. I would love to be able to turn the chair to face any direction and have it rock as expected when clicked. I'm not even partially lsl literate, so any help from those more knowledgable than me is greatly appreciated! integer swing=FALSE; //So it starts out NOT swinging float time=0.01; //Decreasing this (on it's own) makes the swing move FASTER and vice versa integer steps=12; //The total number of steps in the swing's path. More steps=smoother swing. More steps (alone) means slower swing too - time for a complete swing cycle is steps * time (so 4.8 s with the default settings). integer swingDegrees = 10; //How far from the vertical the swing moves //If you play from here on down you might break the script. Do so at your own risk. There are no comments - just to encourage you NOT to play. integer i=1; float swingRad; vector normal; rotation Inverse(rotation r) { r.x = -r.x; r.y = -r.y; r.z = -r.z; return r; } rotation GetParentRot() { return Inverse(llGetLocalRot())*llGetRot(); } SetLocalRot(rotation z) { llSetRot(z*Inverse(GetParentRot())); } default { state_entry() { normal = llRot2Euler(llGetRot()); swingRad=DEG_TO_RAD*swingDegrees; llSetTouchText("Rock"); } touch_start(integer num) { if(swing) { swing=FALSE; llSetTouchText("Rock"); } else { swing=TRUE; llSetTouchText("Stop swing"); llSetTimerEvent(time); } } timer() { float stepOffset=(float)i/steps*TWO_PI; if(i>steps) i=1; if(swing==FALSE && (i==steps || i==steps/2)) { llSetTimerEvent(0.0); SetLocalRot(llEuler2Rot(<normal.x + swingRad*llSin(stepOffset), normal.y, normal.z>)); } else { SetLocalRot(llEuler2Rot(<normal.x + swingRad*llSin(stepOffset), normal.y, normal.z>)); i++; } } moving_end() { normal=llRot2Euler(llGetRot()); } }
×
×
  • Create New...