Jump to content

TonyBowlin

Resident
  • Posts

    25
  • Joined

  • Last visited

Everything posted by TonyBowlin

  1. So the idea is that i have this in my Prim head. And on toggle my head would turn and look at the nearest person. But After hours of trial and error I'm unable to wrap my head around rotations. Any help in making this work would be a treat. off() { llSetLocalRot(<0.00000, 0.00000, 0.00000, 1.00000>); } LinkedLookAtOG( vector Target , key person) { vector p = llDetectedPos(0); string o = llDetectedKey(0); vector mypos = llGetPos(); rotation myrot = llGetRot(); rotation rotvec = llRotBetween(<0,0,-1>, llVecNorm( ( ( Target - mypos ) ) ) ); rotation rotbet = (rotvec); llSetLocalRot( (rotbet)/myrot/myrot ); //llOwnerSay((string)rotvec); llOwnerSay("My Pos = "+(string)mypos+"\nDeceted Pos = "+(string)p+"\nDetected Key = "+(string)llGetDisplayName(o)); } LinkedLookAt( vector Target , key person) { vector p = llDetectedPos(0); rotation r = llDetectedRot(0); string o = llDetectedKey(0); vector mypos = llGetPos(); rotation myrot = llGetRootRotation(); // rotation rotvec = llRotBetween(<0,0,-1>, llVecNorm( Target - mypos ) ); // rotation rotvec = llRotBetween((mypos/myrot) , (Target) ); // rotation rotvec = llRotBetween(<0,0,-1>, llVecNorm( ( ( Target - mypos ) ) ) ); vector VecNorm = llVecNorm( (p) - (mypos/myrot) ); // rotation rotvec = llRotBetween(p, mypos ); rotation rotvec = llRotBetween( (mypos/myrot) , VecNorm ); llSetRot( (rotvec) ); // rotation test = ((r/myrot)/myrot); //Rotation //llSetLocalRot( test ); //llOwnerSay((string)rotvec); // llOwnerSay("My Pos = "+(string)mypos+"\nDeceted Pos = "+(string)p+"\nDetected Key = "+(string)llGetDisplayName(o)); } //float range = 30; float range; float rate = 0.001; float Position; vector vel; vector pos; vector DetPos; vector MyPos; rotation rot; key id; vector p; string o; default { state_entry() { llListen(6508,"", NULL_KEY, ""); // rotation myrot = llGetLocalRot(); // llOwnerSay((string)myrot); state automode; } listen(integer channel, string name, key id, string message) { if (llGetOwnerKey(id) == llGetOwner()) { if (message == "spotauto2") { // llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_POINT_LIGHT,FALSE,<1,1,1>,1,20,0]); state automode; } } } } state automode { state_entry() { range = (float)llGetObjectDesc(); llListen(6508,"", NULL_KEY, ""); llSensorRepeat( "", "", AGENT, range, PI, rate); } sensor( integer value ) { p = llDetectedPos(0); o = llDetectedKey(0); if (llDetectedKey(0)!=llGetOwner()) { // off(); LinkedLookAt(p,o); // } } no_sensor() { off(); } listen(integer channel, string name, key id, string message) { if (llGetOwnerKey(id) == llGetOwner()) { if (message == "spotoff2") { llSetLocalRot(<0.00000, 0.00000, 0.00000, 1.00000>); llResetScript(); } } } }
  2. vector newnoz = (mypostest-carpos)/llGetRot(); That was all I needed to do. Thanks.
  3. Ok so the idea here is I have a vehicle that is sending out these values for the fuel pump to use to set the fuel pump's handle position and rotation to line up with the vehicle when using the pump. This is what the car is sending to the pump. vector pos=llGetPos()+nozzle_pos*llGetRot(); rotation rot=nozzle_rot*llGetRot(); float nx = pos.x; float ny = pos.y; float nz = pos.z; llWhisper(993029418,"AUDA|RETU|"+(string)galLimit+"|"+(string)nx+"|"+(string)ny+"|"+(string)nz+"|"+(string)rot); Here is what the pump script is receiving. listen(integer channel, string name, key id, string message) { list dat=llParseString2List(message,["|"],[]); if (llList2String(dat,1)=="RETU") { galFilled=(float)llList2String(dat,2); carrot = (rotation)llList2String(dat,6); float carnx = llList2Float(dat,3) ; float carny = llList2Float(dat,4) ; float carnz = llList2Float(dat,5) ; //vector carpos= <carnx,carny,carnz>*carrot; vector carpos= <carnx,carny,carnz>; llOwnerSay( "car's pos "+(string)carpos); vector mypos = llGetPos(); float myposx = mypos.x; float myposy = mypos.y; float myposz = mypos.z; vector mypostest = <mypos.x,mypos.y,mypos.z>; llOwnerSay( "mypostest "+(string)mypostest); vector newnoz = mypostest-carpos; llOwnerSay( "FINAL NOZZLE POS,"+(string)newnoz); llSetLinkPrimitiveParamsFast(link1,[PRIM_POSITION, newnoz]);//Here is the fuel pump's handle, it is the child prim of the pump } } For the life of me I can't seem to understand the rotation part. the fuel pump's handle or link1 in this case will only move to the correct spot if the vehicle and pump are rotation in the same one and only direction globally at <0,0,180>. I haven't even begun to start on matching the link one's rotation with that of the vehicle as I'm still stuck on matching positions. I are broke brain on this one. =\
  4. Alright, I've been staring at the screen for hours and I can't do it. I'm trying to make a look at ignoring the Owner if the Owner is closer than anyone else. The goal was to make a spotlight on a vehicle and would look at everyone else and not the owner since the owner is a closer distance. float range = 20; float rate = 0.001; float Position; vector vel; vector pos; vector DetPos; vector MyPos; rotation rot; key id; LinkedLookAt( vector Target, key id) { rotation rotvec = llRotBetween(<0,0,-1>,llVecNorm((Target - llGetPos()))); rotation rotbet = rotvec/llGetRootRotation(); llSetLocalRot(rotbet); } default { state_entry() { llSensorRepeat( "", "", AGENT, range, PI, rate ); } sensor( integer number_detected ) { vector p = llDetectedPos(0); //key id; LinkedLookAt(p,id); } }
  5. I was wondering if anyone has run into this before and if there's a way to fix it. //Ok so I ran into a weird issue that if you have a face with media enabled and run this to rotate the face animate it then turn off animation then set rotation back to default it will ***** up the media browser. Because I'm working on something that has to have a face animated but needs to be rotated but then can switch to media browser. but when it switches to media browser the mouse tracks on the media rotated and offset. how to do fix this?? I tried with the media not set first and with it set after I ran these functions I still get the same result. integer face = 0; string url = "https://www.google.com/?gws_rd=ssl"; setmedia() { llSetLinkMedia( LINK_THIS, face, [ PRIM_MEDIA_CURRENT_URL ,url, PRIM_MEDIA_AUTO_SCALE,TRUE, //PRIM_MEDIA_PERMS_INTERACT,0x1, // owner only //PRIM_MEDIA_PERMS_CONTROL,0x1, // owner only PRIM_MEDIA_AUTO_PLAY,TRUE, PRIM_MEDIA_FIRST_CLICK_INTERACT ,TRUE ] ); } default { state_entry() { setmedia(); llOwnerSay("Loading"); llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_TEXTURE,face,"89556747-24cb-43ed-920b-47caed15465f",<1,1,0>,<0,0,0>,90*DEG_TO_RAD]); llSetTextureAnim(ANIM_ON | SMOOTH | LOOP , face , 1, 1, 1.0, 1.0, 30.0); llSleep(2); llOwnerSay("Setting to default"); llSetTextureAnim(FALSE, face, 1, 1, 1.0, 1.0, 1.0); llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_TEXTURE,face,"89556747-24cb-43ed-920b-47caed15465f",<1,1,0>,<0,0,0>,0*DEG_TO_RAD]); llOwnerSay("Ready"); } }
  6. Ok well my next question is there are 10 notecards. and so each message like if (message == "clue1request") if (message == "clue2request") Would need to send a specific notecard based off that message
  7. So I'm making a HUD that sends out a request message to a rezzed object to retrieve a notecard llRegionSayTo("07a7b953-3748-a756-ee46-a6ab0618861e",8462,"clue1request"); Now that HUD will be used by multiple people and the object receiving the message needs to give the notecard to whoever sent that message from anywhere in the sim. Here is the script that is in the object that will send out a notecard to whoever requests the notecard. I can't seem to figure it out and this is where im stuck. default { state_entry() { llOwnerSay(llGetKey()); llListen(8462,"", llDetectedKey(0), ""); } listen(integer channel, string name, key id, string message) { if ( message == "clue1request") { llOwnerSay("Clue Sent"); key id = llDetectedKey(0); llGiveInventory(id,llGetInventoryName(INVENTORY_NOTECARD,0)); } }}
  8. Oh sorry, Gas is the same thing as value forgot to rename it. =\
  9. Heres out the final idea came out. I split it all into three scripts for ease of learning if anyone else wants to use it. Script 1: Receiving: string message; integer channel; string blank = ""; default { state_entry() { channel = (integer)llGetObjectDesc(); llListen(channel, "","",""); } listen(integer channel, string name, key id, string message) { llPlaySound("3b32ba49-d06a-663b-8835-1d57b9a4ea4a",1.0); llInstantMessage(llGetOwner(),llKey2Name(id) + "-"+ (string)message); } } Script 2: Sending: string message; integer channel; integer user; integer channel2 = 4; integer listen_handle; string message2; default { state_entry() { channel = (integer)llGetObjectDesc(); user = (integer)llGetObjectName(); listen_handle = llListen(channel2, "", llGetOwner(), ""); } listen(integer channel2, string name, key id, string message) { llRegionSay(channel,message); llPlaySound("e1149699-fd54-d9af-efcc-445a2cda289e",1.0); } } Script 3: Channel Set: integer channel = 1; integer listen_handle; string message; default { state_entry() { listen_handle = llListen(channel, "", llGetOwner(), ""); } listen(integer channel, string name, key id, string message) { llSetObjectDesc(message); llPlaySound("3b32ba49-d06a-663b-8835-1d57b9a4ea4a",1.0); llResetOtherScript("Reciveing"); llResetOtherScript("Sending"); llOwnerSay( "Channel Set to " + message); llResetScript(); } }
  10. Why does this not work? can I not do a comparison this way with an increment counter? The goal is to count 1 to 10 on each face and with each count on a selected face, a llOwnerSay of that value for the face clicked will report back. default { state_entry() { llListen(6508,"", NULL_KEY, ""); llSetTimerEvent(0.0); value = 0; } touch_start(integer num_detected) { integer face = llDetectedTouchFace(0); if (face == 7) { value++; llSetText("_"+(string)value,<1,1,1>,1); llPlaySound("8cb0cb67-728b-b621-d307-a798159791e4",0.2); if(gas == value + 3); { llOwnerSay("value is 4"); } if(gas == value +9 ); { llOwnerSay("value is 10"); } } if (face == 6) { valuetwo++;
  11. So what I'm trying to do here is have a listen on channel 4. that message coming in would be. "kb(Legacy name)" Example: ""kbTonyBowlin Resident" And the legacy name changes often so the only consistency in the message is the kb at the start Now I want this listen to get that message and then llSetObjectDesc(killer); killer would be the end result of a llDeleteSubString of the first two characters. I'm just not sure how to have the listen get that kb message. Any help would be greatly appreciated.
  12. So I want to get the local position on an object then on touch set a rounded value of its local position. But I'm super new to coding. Any help?
  13. But I get a syntax error with this so idk. I don't know what im doing.
  14. How does this work? llSetLinkMedia(link1, 1,<PRIM_MEDIA_CURRENT_URL,"https://www.google.com/">);
  15. So want to do this llSetPos(llGetPos()+<0,0,0>); But I have no idea how to llRound it so that its position is set to whole numbers.
  16. Well, I'm making a playable Ocarina. so when a correct song is played it triggers something, but haven't gotten that far yet.
  17. I also wanted to do different combinations of controls like BACK,BACK,BACK and BACK,BACK,LEFT
  18. So my basic Idea here is to take controls for CONTROL_FWD/BACK/LEFT/ and RIGHT. However, I don't want anything to happen such as llPlaySound untell a combo chain of these controls had been inputted such as hitting the back key three times then playing a sound. Anyone know of a way to do this?
  19. I'm trying to do a less than or equal to a comparison between to scale values. However, I'm not sure if it is possible. My goal is to output different llSay values at different scales sizes. But my scaling does not scale down at regular intervals so I can not compare a getscale to a set value using == It must be <=. And if you can not compare the three axis of a get scale. I would also be able to compare the Z value from getscale. but again not sure if this is possible. So, my question is it possible to compare two scale values and how would it be done?
  20. I did find something on the marketplace I use to do it automatically once I set it. however, the script is no mod. But you can see how it works for cheap. https://marketplace.secondlife.com/p/Automatic-Group-Changer/6620836
  21. Somewhere along the line, I lost track of what I was doing. My goal is a simple two-way radio. but I'm lost in the Region Say where I want it to send a message containing "user" which is defined by llGetObjectName followed by the message from channel 4. Heres where I left it after I think making it worse. string message; integer channel; integer user; integer channel2 = 4; integer listen_handle; default { state_entry() { channel = (integer)llGetObjectDesc(); user = (integer)llGetObjectName(); listen_handle = llListen(channel2, "", llGetOwner(), ""); } listen(integer channel2, string name, key id, string message) { llRegionSay(channel, "--" + user +","+ message); llPlaySound("",1.0); } }
  22. Nvm I just used a compounded if statement. I figured it out. =D
  23. 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"); } }
  24. Ok, Thank you. Now I can finally go to sleep for the night @ 2:30 P.M.
  25. 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...