Jump to content

TonyBowlin

Resident
  • Posts

    28
  • Joined

  • Last visited

Everything posted by TonyBowlin

  1. So my goal is to be able to have an object with 6 faces that when clicked can detect what face is clicked then detect what section of the face in a 2 by 2 grid then rez an object from that spot within the grid. Only thing is Im not sure how to add both after I already made the DetectedUV. Any help would be great. integer rows = 2; integer columns = 2; default { touch_start(integer num_detected) { vector touchUV = llDetectedTouchUV(0); integer rows = (integer) (touchUV.y*rows); integer columns = (integer)(touchUV.x*columns); integer grid = rows*columns + columns; integer face = llDetectedTouchFace(0); if (grid == 0) llSay(0,"Rez Object 1"); if (grid == 1) llSay(0,"Rez Object 2"); if (grid == 2) llSay(0,"Rez Object 3"); if (grid == 3) llSay(0,"Rez Object 4"); } }
  2. Ok, Thank you. Now I can finally go to sleep for the night @ 2:30 P.M.
  3. Here I am trying to get Object name and Desc and use them as position values but think I confused myself on this one. I can't get this to work and I've been staring at this for hours. Any help would be great. Just note this is a linked object. //vector close_position = <-0.00011, -0.26520, 0.17491>; //vector open_position = <-0.00011, -0.26520, 0.20384>; vector close_position; vector open_position; integer steps = 3; float sleep = 0.01; integer channel = 4; integer close_open; integer handle; integer sitting; vector step_position; float stepsb; vector vLin(vector x, vector y, float t){ return x*(1-t) + y*t; } rotation slerp( rotation a, rotation b, float t ) { return llAxisAngle2Rot( llRot2Axis(b /= a), t * llRot2Angle(b)) * a; } close() { float step; float stepsb = steps; while(stepsb--) { step_position = vLin(open_position, close_position, step); llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POS_LOCAL, step_position]); step = step + (1.0 / steps); llSleep(sleep); } llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POS_LOCAL, close_position]); } open() { float step; float stepsb = steps; while(stepsb--) { step_position = vLin(close_position, open_position, step); llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POS_LOCAL, step_position]); step = step + (1.0 / steps); llSleep(sleep); } llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POS_LOCAL, open_position]); } close_or_open() { if(llGetLocalPos() != open_position) open(); else close(); } default { state_entry() { llListen(666,"", NULL_KEY, ""); close_position = llGetObjectName(); open_position = llGetObjectDesc(); } listen(integer channel, string name, key id, string message) { integer z; integer A = 1; if (message == "test") { for(z = 1; z <= A; ++z) open(); llSleep(5); close(); } } }
×
×
  • Create New...