Jump to content

TonyBowlin

Resident
  • Posts

    25
  • Joined

  • Last visited

Reputation

2 Neutral

Recent Profile Visitors

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

  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.
×
×
  • Create New...