Jump to content

Dorex Delicioso

Resident
  • Posts

    13
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

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

  1. The thing here is you can just visit sim after sim, collecting all the names of the avatars there and spam them.
  2. Hi I'm trying to show or hide a prim using llSetLinkPrimitiveParamsFast(LINK_THIS,[ PRIM_ALPHA_MODE, ALL_SIDES, PRIM_ALPHA_MODE_MASK, 255 ]); I can do it using /llSetLinkAlpha(LINK_SET, 1.0, ALL_SIDES); etc, but I'm having trouble with the correct values for PRIM_ALPHA_MODE_MASK and the integer that follows it. I have tried PRIM_ALPHA_MODE_NONE and PRIM_ALPHA_MODE_MASK, but neither seem to hide it Thanks for your help. DD
  3. Hi Dora I took your advice and rename all the marker prims with the same name and moved the index into the description. Made for smaller, cleaner code, which is always a good thing. Thanks everyone for your help, here's how it ended up default{ touch_start(integer total_number) { lastTargetId=-1; llSensorRepeat("Link", "", PASSIVE, 50.0, PI, 1.0); } sensor( integer detected ) { float selectedTargetId=9999; float targetId; vector targetPos; rotation targetRot; // // do the detect loop this way so we get the closest objects first // integer detectedIndex=0; do{ // find the next prim with our target name 'Link' where the target id in the description // is greater than the lastTargetId, but lower than all remaining // // parse the description field to get a csv list of values {targetId,speed,xxx,xxx} // targetId is required, nothing else is. // list objectValues=llGetObjectDetails(llDetectedKey(detectedIndex),([OBJECT_POS,OBJECT_ROT,OBJECT_DESC])); list descriptionValues=llParseString2List(llList2String(objectValues,2),[","],[]); targetId = llList2Float(descriptionValues,0); if(targetId>lastTargetId && targetId<selectedTargetId){ // possible target, save the info for later selectedTargetId=targetId; targetPos=llList2Vector(objectValues,0); targetRot=llList2Rot(objectValues,1); } }while(++detectedIndex<detected); lastTargetId=selectedTargetId; if(selectedTargetId<9999){ llSetRegionPos(targetPos); llSetRot(targetRot); llOwnerSay("Moving to: " + namePrefix + " " + (string) selectedTargetId); } else { // couldn't find anymore prims llSensorRemove( ); } }}
  4. Hi, Yes, the prims are along the outter edge of a whole region which is why I had to number them and visit them individually so the next one would be in range. Seems to work pretty good so far, better than placing the object there for each point manually and getting the data points from it.. The biggest issue I'm having is when getting near a lot of unrealated objects that clog up the sensor limit. thanks a lot Dorex
  5. So after posting this, I read the replies and came up with this code. It works, it's not particularly fancy and I'm sure some top-notch scripter can rewrite it in 1/2 the code, but it works. //// Follow a path of target prims// Because sensor only returns 16 objects, the targets have to // be fairly close to make sure each is found (sensorDistance)//// Each target prim has to be named 'Link xx.xx' where xx.xx is any sequential float number// Link 1, Link 2, Link 2.2, Link 3. Floats were used so you can insert additional targets as needed.// Each next target can be in any position, ahead, behind, etc. so we can't just use the next closest target.//float sensorDistance=32.0;float lastTargetId;string namePrefix="Link";float SEARCHID=9999.9;vector startPosition;rotation startRotation;default{ touch_start(integer total_number) { // // remember where we started // startRotation=llGetRot(); startPosition=llGetPos(); lastTargetId=-1; llSensorRepeat("", "", PASSIVE, sensorDistance, PI, 1.0); } sensor( integer detected ){ float selectedTargetId=SEARCHID; integer detectedId; float targetId; while(detected--) { // filter only for the prim names we are searching for string name = llDetectedName(detected); //llOwnerSay("Looking at: " + name); if(llSubStringIndex(name, namePrefix)>-1){ // get the targetId from the target prim targetId = (float)llGetSubString(name, llSubStringIndex(name," "), -1); // // search all targets found for the next lowest id // if(targetId>lastTargetId && targetId<selectedTargetId){ selectedTargetId=targetId; detectedId=detected; } } } lastTargetId=selectedTargetId; if(selectedTargetId<SEARCHID){ // // found a prim to follow, move to it's location and read it's position/rotation // list details = llGetObjectDetails(llDetectedKey(detectedId), ([OBJECT_POS, OBJECT_ROT, OBJECT_DESC])); vector pos=llList2Vector(details,0); rotation rot=llList2Rot(details,1); llSetRegionPos(pos); llSetRot(rot); // save pos/rot here for other uses } else { // couldn't find any more targets llSensorRemove( ); llSetRegionPos(startPosition); llSetRot(startRotation); } }}
  6. Lousy subject line because I'm not sure what this would be called I don't know if this can be done or not, so I thought I'd ask. I would like to lay down any number of prims in a circut, and have another prim follow them, picking up each prims information as it goes. For example, I lay down a bunch of prims in a circle, all with different orientations. The main prim moves to one and gets that prims position and rotation info, then it moves to the next and collects that, all the way around. Sort of like laying down railroad track and having the prim follow them. What I don't know is how to make one prim detect another one I guess. I know i can make a prim do a circut with KeyFrame, but this is to teach a prim the location values to use in a KeyFrame script. I want to put down the prims, have one follow them and get the data, then I can test and rerun until I'm happy with it instead of having to manually place the prim in each position and read the data that way. Is this even possilbe ? Thanks for your advice and help Dorex D.
  7. Since I've changed how I rezz my boat object, I've detected no difference in motion if I'm sitting on it or not
  8. Thank you for your answer. I will admit, I raised an eyebrow when I read your answer. I mean really, wouldn't that be silly? I then went and rezzed the project, removed the pilot prim, added a fresh cube and inserted the script. ......it worked fine....WTF? I played with a few different ways including unlinking and making a copy of the pilot prim and linking the copy. Seems the copies remember state also. I didn't want to have to copy scripts from an origianl to a new prim each time I rezzed it. What I ended up doing was unlinking the original pilot prim, taking it back into inventory, rezzing it again and linking it back. Works like a charm. Still...WTF? So now the question becomes is there any way I can duplicate this process in a script? Again, thanks for your answer, it was spot on. Dorex
  9. Hi, I have a script that is meant to follow the borders of a full sim. The idea is to link a boat to a prim and have the boat off sim while the pilot prim remains on the sim. I can get the pilot prim to do the traversing around the sim, but the corners where the pilot prim has to stop and then rotate 90 degress is causing a problem. When the pilot prim turns, it's motion is very jerky, it will loose up to 8m from where it started in both the x and y directions. Once the turn is completed, it's found it's way back to where it was supposed to be and continues on happily. Here is the bare bones of the code. It's pretty simple. Can anyone telll me why the rotation is so jerky? I've tried playing with the speed of the rotation to no avail. Thanks for any help you can give. rotation NormRot(rotation Q) { float MagQ = llSqrt(Q.x*Q.x + Q.y*Q.y +Q.z*Q.z + Q.s*Q.s); return <Q.x/MagQ, Q.y/MagQ, Q.z/MagQ, Q.s/MagQ>; } default { touch_start(integer total_number) { llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]); llSleep(0.2); rotation rot90Degrees = NormRot(llEuler2Rot(<0, 0, -90> * DEG_TO_RAD)); integer time = (integer)dist; float dist = 63.0; llSetKeyframedMotion([ <dist, 0.0, 0.0>, ZERO_ROTATION, time , <0.0, 0.0, 0.0>, rot90Degrees, 10, <-dist, 0.0, 0.0>,ZERO_ROTATION, time , <0.0, 0.0, 0.0>, rot90Degrees, 10, <0.0, -dist, 0.0>,ZERO_ROTATION, time , <0.0, 0.0, 0.0>, rot90Degrees, 10, <-dist, 0.0, 0.0>,ZERO_ROTATION, time , <0.0, 0.0, 0.0>, rot90Degrees, 10 ],[KFM_MODE, KFM_FORWARD]); } }
  10. Thanks so much Just dropped both scripts into prims and they were perfect. Didn't have to change a thing, and we know how seldom that hapens Now I can continue my project and make it much simpler !! Thanks again Dorex
  11. Thanks so very very much. I'll add that in tonight and we'll see how it goes.. I still don't get how it going to get a name from a LM, but I think there is more to a LM than what the values are we see displayed. Wonderful, Thanks Dorex
  12. Hi I have a TP HUD that contains a number of landmarks. The menu system filters and searches until it finds the LM I need and then TPs me to that position.. I find that I have to set the RegionName manually though as I can't read the region from the landmark. I can't even read the description field in the landmark. If I could, I could parse out the region info.. As it sits, I have to rename the landmark to add the region name to it and the code extracts this at TP time. Does anyone know how I could do this? Thanks so much for any help Dorex
×
×
  • Create New...