Jump to content

Ruthven Ravenhurst

Resident
  • Posts

    491
  • Joined

  • Last visited

Everything posted by Ruthven Ravenhurst

  1. I ran across this post when looking for something else. does this hack still work? A role-play sim i'm part of has a surround landscape, so it too blocks all the other things on the map. I've rezzed out a mega prim and applied the invisiprim script, but what height does this need to be set to?
  2. EDIT* Changed the prim to a non-pathcut cube, and adjusted the position with Arton's suggestion. Also added in a the http bit to get the sim map texture I made this script and dropped it into a cube prim that's been flattened and 100(regent limit, can do 20 for a homestead sim) cylinder prims linked to it. I am cutting the path of the prim to 0.375 begin and 0.625 end because it's too early for me to figure out the math to offset the values to allow for a negative local position. any ideas? vector oldscale; float factor; float factorz; string URL = "http://www.subnova.com/secondlife/api/map.php?sim="; key httpRequestId; setpos() { list agents = llGetAgentList(AGENT_LIST_REGION,[]); list params = [PRIM_LINK_TARGET,LINK_ALL_CHILDREN, PRIM_POS_LOCAL,<0.0,0.0,0.0>, PRIM_COLOR,ALL_SIDES,<0.5,0.0,0.0>,0.0, PRIM_TEXT,"",<0.0,0.0,0.0>,0.0]; integer i; integer len = llGetListLength(agents); for(i = 0; i < len; i++) { list details = llGetObjectDetails(llList2Key(agents,i),[OBJECT_POS,OBJECT_NAME]); vector pos = llList2Vector(details,0); string name = llList2String(details,1); vector size = llGetAgentSize(llList2Key(agents,i))/100; params += [PRIM_LINK_TARGET,i+2, PRIM_POS_LOCAL,<(pos.x-128)*factor,(pos.y-128)*factor,pos.z*factorz>, PRIM_COLOR,ALL_SIDES,<0.5,0.0,0.0>,1.0, PRIM_SIZE,size, PRIM_TEXT,name+"\n"+(string)pos,<0.0,1.0,0.0>,1.0]; } llSetLinkPrimitiveParamsFast(LINK_SET,params); } default { state_entry() { llSetLinkPrimitiveParamsFast(LINK_ALL_CHILDREN, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_NONE, PRIM_POS_LOCAL,<0.0,0.0,0.0>, PRIM_COLOR,ALL_SIDES,<0.0,0.0,0.0>, 0.0, PRIM_TEXT,"",<0.0,0.0,0.0>,0.0, PRIM_SIZE,<0.01,0.01,0.01>]); vector oldscale = llGetScale(); if(oldscale.x > oldscale.y){oldscale.y = oldscale.x;} else{oldscale.x = oldscale.y;} llSetScale(oldscale); factor = oldscale.y/256; factorz = oldscale.y/4000/2; setpos(); llSetTimerEvent(5); httpRequestId = llHTTPRequest(URL + llEscapeURL(llGetRegionName()), [], ""); } http_response(key request_id, integer status, list metadata, string body) { if((request_id == httpRequestId) && (status == 200)) llSetTexture(body,0); } touch_start(integer n) { if(llDetectedKey(0) == llGetOwner()) { llResetScript(); } } timer() { setpos(); } }
  3. I wanted to play with slowing down the rotation so it looked more realistic than just snapping into open/close position. So I added in a steps variable, divided the rotation by that number of steps, and added a for loop to handle the stepped rotation. I may play with a target omega version // Open Other Way -- Rolig Loon -- April 2017 // This script always opens a door away from the person who touches it, then closes the door later automatically . // The script may be used in a linked or unlinked door, but must be placed in the door itself. If the door is linked, it must be a child link. // It was designed for a prim "cut" door (B:0.125, E:0.625 or B;0.375, E:0.875) but could be used for a mesh door hinged on one side. // The script will detect whether the door's X dimension is larger or smaller than its Y dimension and adjust accordingly. // When it is installed for the first time, be sure that the door is in its CLOSED rotation. NOTE: This is its LOCAL rotation, relative // to the root of the linkset, so it will not be affected if you move the entire linkset later. // User parameters =========== integer gIntSwing = 90; // Angular swing of the door, in degrees float gfOpenTime = 5.0; // Amount of time before the door closes automatically, in seconds // ===== Do not mess with anything below here unless you know what you are doing ============ integer steps = 6;//How many steps it will take to open/close the door to give a more realistic swinging action integer isFacing(vector avpos) { vector myPos = llGetPos(); rotation myRot = llGetRot(); vector facing; vector target = llVecNorm( avpos - myPos); float dp; if(giXisBigger) { facing = llRot2Left(myRot); dp = facing*target; } else { facing = llRot2Fwd( myRot); dp = -(facing*target);//had to reverse the dp when Y axis is bigger to make door swing the right direction } return ( dp > 0 ); } rotation gHomeRot; float gfHomeAngle; integer giXisBigger; rotation gRotSwing; integer gDir; integer IsClosed(rotation MyRot) // Is the door closed? { float MyAngle = llRot2Angle(MyRot); if (llFabs(MyAngle - gfHomeAngle) < 0.0523599) // Within 3 degrees of "closed" { llSetLocalRot(gHomeRot); // Be sure it's closed now, just in case return TRUE; } else { return FALSE; } } integer WhereAmI (vector AvPos) // Where is the av, relative to the door's default swing direction? { float dotP = llRot2Fwd(gHomeRot)*llVecNorm((AvPos - llGetPos())/llGetRot()- llGetLocalPos()); llSay(0,(string)dotP); if (giXisBigger) // The door's X dimension is bigger than its Y dimension { return (RAD_TO_DEG*llAcos(dotP) < 0.0) ; // TRUE or FALSE? } else // The door's Y dimension is bigger than its X dimension { return (RAD_TO_DEG*llAcos(dotP) > 0.0) ; // TRUE or FALSE? } } default { state_entry() { // First, define the "closed" rotation for the door gHomeRot = llGetLocalRot(); gfHomeAngle = llRot2Angle(gHomeRot); vector Size = llList2Vector(llGetLinkPrimitiveParams(LINK_THIS,[PRIM_SIZE]),0); giXisBigger = (Size.x > Size.y); // and now, here's the default rotation to apply in swinging the door .... gRotSwing = llEuler2Rot( <0.0, 0.0, (float)gIntSwing * DEG_TO_RAD>/steps ); } touch_start( integer mum ) { if ( IsClosed(llGetLocalRot()) ) //If the door is closed ... { gDir = 0; if ( isFacing(llDetectedPos(0)) ) // Where is the av, relative to the door's default swing direction? { llSay(0,"other way"); gDir = 1; // Reverse the door's default opening direction gRotSwing.s *= -1; } integer i; for(i = 0; i< steps;i++) { llSetLocalRot( gRotSwing * llGetLocalRot() ); } gRotSwing.s *= -1; // And reverse direction again, ready for the return swing llSetTimerEvent(gfOpenTime); } else { integer i; for(i = 0; i< steps;i++) { llSetLocalRot( gRotSwing * llGetLocalRot() ); } if (!gDir) // If the door just opened in the default direction, we don't need to reverse it yet again { gRotSwing.s *= -1; } llSetTimerEvent(0.0); } } timer() { // Now reverse the direction of gRotSwing and apply it.... integer i; for(i = 0; i< steps;i++) { llSetLocalRot( gRotSwing * llGetLocalRot() ); } if (!gDir) // If the door just opened in the default direction, we don't need to reverse it yet again { gRotSwing.s *= -1; } llSetTimerEvent(0.0); } }
  4. This is what I was thinking. And for the curved path, you would want to break it up into smaller segments, and add the short slower distances to the ends. I did something like this, but in reverse for a floating books path. Think Hogwarts Library books floating from shelf to shelf. Quickly moves out of the shelf, floats around slower to move in front of the next shelf, then quickly moves into place on the shelf
  5. I can see where Rolig is going with her answer, but I think I must have interpreted this differently. Are you wanting it to move at a slow speed at first for say 5 or 10% of the trip, then move quickly for the next 80% of the trip, then move slowly again as it approaches its target in the last 10%?
  6. Any updates to this? I just came across this idea in a chat, and was wondering if anyone had any success or tips with it.
  7. llUnSit Function: llUnSit( key id ); 220 Function ID 0.0 Forced Delay 10.0 Energy The agent identified by id is forced to stand up if any of the following apply: The agent is sitting on the scripted object The agent is over land owned by the scripted object's owner and/or a group the owner has land rights for. • key id – avatar UUID that is in the same region
  8. Ah I see. Then right, unless it's modified to listen for your bullets, or if you own the land that it's on, there's not really any other way that I know of
  9. Sure, it just depends if you have the tank set up to allow non-owners to drive or sit on it.Now if you have multiple people sitting on it, that would require some more logic to tell it who to knock off if you don't want to knock everyone off. But as said above use llRegionSayTo in the projectile to tell the tank that the projectile hit it. Owner or not shouldn't matter. If the tank is to shoot it's own projectile, I would use llGetObjectDetails(llGetKey(),[OBJECT_REZZER_KEY]), extract the key and save it as a global. Once the projectile hits where it's going to hit, check to make sure the llDetectedKey(x) != rezzerkey
  10. and going with Qie's mention of a timer to scroll through the names I put together this. I added in a test list of names. I also added in a line in the text to show how many pages there are, as well as total number of names in the list list user_names = ["name test1","name test2","name test3","name test4","name test5","name test6","name test7","name test8","name test9","name test10","name test11","name test12","name test13","name test14","name test15","name test16","name test17","name test18","name test19","name test20","name test21","name test22","name test23","name test24","name test25","name test26","name test27","name test28","name test29","name test30","name test31","name test32","name test33","name test34","name test35","name test36","name test37","name test38","name test39","name test40"]; integer pglen = 10;//this is how many names you want in each page integer page; integer pages; integer total; float time = 2.5; update_text() { list temp = llList2List(user_names,page*pglen,page*pglen+(pglen-1)); string text = "Sorting Hat Waiting List\n===========\nPage " + (string)(page+1) + " of " +(string)pages + "\n===========\n"+(string)total + " Names\n===========\n"; integer i; integer count = llGetListLength(temp); for(i=0;i<count;i++){ text += (string)(pglen*page+i+1)+". "+llList2String(temp, i)+"\n"; } llSetText(text, <1,1,1>, 1); } default { state_entry() { llSetTimerEvent(0); total = llGetListLength(user_names); pages = total/pglen; pages += (pages*pglen < total); if(total){llSetTimerEvent(time);} update_text(); } touch_start(integer total_number) { if(llDetectedKey(0) == llGetOwner()) { user_names = llDeleteSubList(user_names, 0,0); page = 0; llSleep(0.25); } else { if(llListFindList(user_names, [llDetectedName(0)]) == -1) { user_names += [llDetectedName(0)]; } else { llSay(0, "Your already on the list"); } } llSetTimerEvent(0); total = llGetListLength(user_names); pages = total/pglen; pages += (pages*pglen < total); if(total){llSetTimerEvent(time);} update_text(); } timer() { ++page; if(page == pages){page = 0;} update_text(); } }
  11. Right, I mentioned what you were missing in my comment above
  12. Try this. I moved the if tests around a bit. Also when you are removing an element from a list, you need to write the name of the list equals...for example listname = llDeleteSubList(listname,idx,idx) list user_names; update_text(){ string text = "Sorting Hat Waiting List\n===========\n"; integer i; integer count = llGetListLength(user_names); for(i=0;i<count;i++){ text += llList2String(user_names, i)+"\n"; } llSetText(text, <1,1,1>, 1); } default { state_entry() { update_text(); } touch_start(integer total_number) { if(llDetectedKey(0) == llGetOwner()) { usernames = llDeleteSubList(user_names, 0,0); llSleep(1); } else { if(llListFindList(user_names, [llDetectedName(0)]) == -1) { user_names += [llDetectedName(0)]; } else { llSay(0, "Your already on the list"); } } update_text(); } }
  13. The rotation isn't really an issue. There's the main panel and tabs. Each tab also has sub-prims/mesh that rely on lining up with the texture on the tab to function correctly. There's a bit going on for each tab and it can take up a lot of screen space at the default size. On a smaller screen it might need to be made bigger to see what's going on, while on my larger 32inch monitor, I can make it smaller and still read it. I have already accounted for rotating the whole thing 90° on the Y axis for minimizing. I've actually already gotten it all figured out I believe.
  14. Right, I was looking at that as well. I wanted the end user to be able to resize only the root prim (main panel) and then the others would be resized to fit. I thought about using this and making the HUD no mod
  15. **edit** figured out my mistake In another snippet for processing rotations, i had copied this over and forgot to change PRIM_POS_LOCAL to PRIM_ROT_LOCAL I've run into another problem with my hud positioning script. Here is the snippet for figuring out the PRIM_POS_LOCAL, it's the only part that's setting a pos and it's throwing an error "llSetPrimitiveParams error running rule #50 (PRIM_POS_LOCAL): arg #1 vector expected but quaternion given". but it seems to be positioning everything correctly. I've even added an ownersay to tell me what the list it's returning is, it's all vectors other than the params flags and the link number list processpos(list vectors, list links, string tab) { integer len = llGetListLength(vectors); integer len2 = llGetListLength(links); list temp = []; if(len != len2) { llOwnerSay(tab + " lists do no have the same number of elements"); return temp; } else { integer i; for(i = 0; i < len; i++) { vector postemp = ((llList2Vector(vectors,i)+offset)*scalefactor)*myrot; temp += [PRIM_LINK_TARGET,llList2Integer(links,i),PRIM_POS_LOCAL,postemp]; } return temp; } }
  16. Oh I think I know what I did wrong *facepalm*, it was extremely late. Instead of comparing it to the last scale, I was comparing it to the default scale. So if I resized the root and change scale was triggered, until I set it back to the original scale, of course that would test TRUE, lol
  17. I tried that too, it still was in an infinite loop, and the object ended up disappearing. maybe the server didn't like that? Innula's method worked perfectly
  18. I'm building a HUD, and was wondering if there's a way to detect if the root scale has changed other than with a changed event or a timer. I want the end user to be able to change the size of the root prim, and have it automatically changed the child prim sizes, local pos, and rotation. If i use CHANGED_SCALE, it gets triggered every time the script changes a child prim scale putting it into a loop. I don't want to have to use an un-necessary timer to only check for changes in the root prim size. I suppose I could build it into the touch event to check, but it also seems un-necessary to check every time it's clicked
  19. I actually got it to work somehow, I kept playing around with the different axis placements in the calculations. in the original script it's getting the HSL as: vector v = llDetectedTouchST(0); HSL = <v.y, 1.0 - v.x, HSL.z>; but in my fixed version it is: vector v = -llDetectedTouchST(0); HSL = <-v.x,1-v.y, HSL.z>;
  20. To show you more of what I mean, in the first snapshot here, I clicked on the top right, where it should be red, but it's gray instead. In the second snapshot, I click the bottom right, still gray In the third, I click yellow, I get pink
  21. I'm trying to make a color picker for a HUD I'm building. I'm using Mesh Studio to build the link set, and convert it to mesh. The problem is, the coordinates for it is returning for the color seems like the face is rotated, even though the texture offset is correct for the crosshair I put on it. Do I need to rotate the vector or something to make it work? I'm using the script here (which works normal on a legacy prim), and I changed the face numbers to the appropriate faces on the mesh I tried rotating the prim for the color pallet before meshing it, and i get the same results. I also tested the other faces (luminosity, and the alpha) and they also seem to be rotated You can see in the snapshot that I'm clicking on the lower part of the color pallet, and the color should be gray, but the preview panel and brightness panel are showing yellow, as if I clicked about the same point, but along the top of the pallet instead of the side
  22. I don't know about pants, but Adam Mesh has 4 different styles of underwear that have a pulled down version. http://maps.secondlife.com/secondlife/Absolut Creation/130/127/24
×
×
  • Create New...