Jump to content

Life Camino

Resident
  • Posts

    127
  • Joined

  • Last visited

Everything posted by Life Camino

  1. Hi Rolig, The follower script is in a HUD. And, your suggestion about using llSetAnimationOverride worked great. Thanks!
  2. I'm actually using llGetAgentInfo and llGetObjectDetails to determine what the other avatar is doing and deciding on a built-in animation to start and stop based on that, rather than using RLV. I don't want the other avatar to have to wear anything, either. The problem I'm running into is when the other avatar, who had been walking, decides to start flying, the following avatar goes up with them, but starts a falling animation, even though I'm telling it to start the fly animation. If I click "Fly" on my viewer, the fly animation starts playing properly. But, otherwise, I look ridiculous just flailing along behind the other flying avatar. So, I need to figure out how to emulate the function of the "Fly" button on my viewers movement controls. Any way to do that with a script?
  3. I can start and stop the fly animation, but that is not the same thing. I'm working on a follower script that will cause the user to follow another avatar and change animations as they change animations - so, if the other avatar starts to fly, the user needs to start flying. And, if the other avatar stops flying, I need the user to stop flying. So, how do I do this with a script?
  4. I've been working on a HUD and making modifications to the scripts contained in it, and I detached the HUD then reattached it and all of my script changes that I had compiled and saved and tested and knew to work propery were just gone. Why would this happen?
  5. I took the time to do a complete rework of that original sensor-based 3D radar system using llGetAgentList and put it up on the Marketplace for free with full permissions. It will allow you to cover any 256m x 256m x 256m area in a region with the center of the cube representing 128,128, <altitude>. It is resizable to 20M and will calibrate itself, including changing the scan ball sizes. It is also color coded and puts the name and distance to the tracked avatar in hovertext over the scan ball. Here's the link: https://marketplace.secondlife.com/p/Sim-wide-3D-Radar-v30/6162000 If you find it useful, a review would be appreciated. I've given hundreds of them away, but no reviews, yet. Have fun!
  6. I figured it out - llGetInventoryName does not support negative indexes. Problem solved...
  7. I've written a function to purge certain inventory items from an object and it isn't working and I can't see anything wrong with the function and it acts like it's working - it says the inventory has been purged, but it isn't. It doesn't remove even a single piece of inventory. What am I missing here or what have I done wrong? purge() { list purge_list = []; integer n = llGetInventoryNumber(INVENTORY_OBJECT); integer i = 0; i = i - n; for (; i< 0; i++) { string object = llGetInventoryName(INVENTORY_OBJECT, i); purge_list += object; } n = llGetInventoryNumber(INVENTORY_TEXTURE); i = 0; i = i - n; for (; i< 0; i++) { string texture = llGetInventoryName(INVENTORY_TEXTURE, i); purge_list += texture; } n = llGetInventoryNumber(INVENTORY_NOTECARD); i = 0; i = i - n; for (; i< 0; i++) { string notecard = llGetInventoryName(INVENTORY_NOTECARD, i); purge_list += notecard; } n = llGetInventoryNumber(INVENTORY_ANIMATION); i = 0; i = i - n; for (; i< 0; i++) { string animation = llGetInventoryName(INVENTORY_ANIMATION, i); purge_list += animation; } n = llGetListLength(purge_list); i = 0; i = i - n; for (; i < 0;i++) { string purge_item = llList2String(purge_list, i); if (purge_item != "")llRemoveInventory(purge_item); llSleep(0.1); } llOwnerSay("Inventory items purged..."); }
  8. If I know the key of the object, how can I determine whether it still exists without having to visit the region?
  9. It seems I was using an llHTTPRequest command, after all - in one tiny function in a radar script to retrieve the group name for a parcel. And, it was being triggered whenever the color pad script changed the color of one of its prims, triggering a CHANGED_LINK which caused a reset of that script and the repeated triggering of that function. Although, why changing the color of a prim would do this is beyond me. I could understand it triggering a CHANGED_COLOR, but not a CHANGED_LINK. Anyway, taking away the testing for CHANGED_LINK in the radar script solved the problem.
  10. I'm working with a color change pad in a HUD and as I drag across the color pad, I'm getting this message: "Too many HTTP requests too fast. (Set HTTP_VERBOSE_THROTTLE, FALSE in the parameters to hide these messages.)" You see, the problem is, I am not using the llHTTPRequest command at all anywhere in the script - or, in any other scripts in the HUD. So, why else might I get this message?
  11. Thanks, Rolig, that was exactly what I needed!
  12. I found this function that takes the start parameter from the on_rez event and converts it into a color vector, and I would like to know how I might do the reverse by converting a color vector into an integer that would work with this function? vector RGBAtoColor(integer rgba) { return < ((rgba >> 16) & 0xFF) / 255.0, ((rgba >> 8) & 0xFF) / 255.0, (rgba & 0xFF) / 255.0 >; } I'm not quite sure what is happening here. I see that it is deriving a vector from the integer sent to the function, but how is it splitting up the integer to create the vector? Being able to send a color vector to a rezzed object in this fashion would be great. But, understanding how it works would be even better. So, any help would be greatly appreciated.
  13. I figured out that I needed to use float values for all the elements. But, it still makes no sense to me that I should be required to use float values for all the elements. If you divide an integer by a larger integer, you get a float value - but, not in this case. For some strange reason, in LSL, you must treat all the elements as floats. That is what is counterintuitive. I understand that I broke a rule. It's just that I don't think the rule makes any sense - because, it is not mathematically sound and is counterintuitive.
  14. "Because an integer divided by an integer times an integer is an integer" No, it isn't. That is why this was causing me grief. It was counterintuitive for the functions to require float values for all elements.
  15. I figured it out. I discovered that all elements of a divide operation must be float values. So, adding decimal points to the numbers used made all the difference.
  16. default { state_entry() { } touch_start(integer total_number) { float percent_used = (7887/15000) * 100; llOwnerSay("Percent Used: " + (string)percent_used + "%"); } }
  17. Thank you, Nova. That looks like it would work great. But, I was directed privately to the llAtan2 function and in the SL Wiki entry for the function, they included this example, which worked perfectly and was less involved than the method you described. Here is what I ended up using to determine compass heading to the target avi: string compass (vector target) { vector source = llGetPos(); list DIRS =["W","NW","N","NE","E","SE","S","SW","W"]; integer index = llCeil(3.5 - (4 * llAtan2(target.y - source.y, target.x - source.x) / PI)); return llList2String(DIRS, index);}
  18. Conceptually, I understand this. What I need is to know how to code that. I don't know how to determine the angle between where I am and where the other avatar is to make the determination of which direction they are located.
  19. I'm working on an avatar scanner HUD and I figured out how to decide whether an avatar is N, S, E, or W of me but I'm having trouble deciding when I should combine directions, like NE, NW, SE, and SW. Any suggestions would be greatly appreciated. Here's what I have, so far... avatar_scan() { vector avi_pos; list avatar_info = []; list avatar_keys = llGetAgentList(scope, []); if (~llListFindList(avatar_keys, [llGetOwner()])) { integer idx = llListFindList(avatar_keys, [llGetOwner()]); avatar_keys = llDeleteSubList(avatar_keys, idx, idx);//We don't want the owner information displayed in hovtext } integer n = llGetListLength(avatar_keys); integer i = 0; for (; i< n; i++)//This is where we build our avatar_info list. It has only the avi distance and keys in it { list temp_list = llGetObjectDetails(llList2Key(avatar_keys, i), [OBJECT_POS]); avi_pos = llList2Vector(temp_list, 0); integer distance = (integer)llVecDist(llGetPos(),avi_pos); avatar_info += [distance]; avatar_info += [llList2Key(avatar_keys, i)]; } if (sort_flag)avatar_info = llListSort(avatar_info, 2, TRUE);//sort our strided list in ascending distance order if (!sort_flag)avatar_info = llListSort(avatar_info, 2, FALSE); // llOwnerSay("avatar_info = " + llDumpList2String(avatar_info, "::")); n = llGetListLength(avatar_info); i = -n; for (; i < -1; i = i + 2) { avatar_info = llDeleteSubList(avatar_info, i, i); } // llOwnerSay("avatar_info = " + llDumpList2String(avatar_info, "::")); avatar_keys = avatar_info; integer number_of_display_prims = llGetListLength(radar_links); integer current_link_number; integer idx; i = 0; n = llGetListLength(radar_links); for (;i < n; i++)//We must set prim text in every radar prim, even if it is an empty string { key current_avi = llList2Key(avatar_keys, idx); ++idx; list temp_list = llGetObjectDetails(current_avi, [OBJECT_POS]); vector avi_pos = llList2Vector(temp_list, 0); vector pos = llGetPos(); integer distance = (integer)llVecDist(pos, avi_pos); string dist = (string)distance; string display_name = llGetDisplayName(current_avi); string user_name = llGetUsername(current_avi); string direction; string up_dn; if (avi_pos.x > pos.x && llFabs(avi_pos.x-pos.x)/llFabs(avi_pos.y-pos.y) > llFabs(avi_pos.y-pos.y)/llFabs(avi_pos.x-pos.x))direction = "E"; if (avi_pos.x < pos.x && llFabs(avi_pos.x-pos.x)/llFabs(avi_pos.y-pos.y) > llFabs(avi_pos.y-pos.y)/llFabs(avi_pos.x-pos.x))direction = "W"; if (avi_pos.y > pos.y && llFabs(avi_pos.y-pos.y)/llFabs(avi_pos.x-pos.x) > llFabs(avi_pos.x-pos.x)/llFabs(avi_pos.y-pos.y))direction = "N"; if (avi_pos.y < pos.y && llFabs(avi_pos.y-pos.y)/llFabs(avi_pos.x-pos.x) > llFabs(avi_pos.x-pos.x)/llFabs(avi_pos.y-pos.y))direction = "S"; if (llFabs(avi_pos.z-pos.z) > 5 && avi_pos.z > pos.z)up_dn = Chr(0X25b2);//up_dn = "^"; if (llFabs(avi_pos.z-pos.z) > 5 && avi_pos.z < pos.z)up_dn = Chr(0X25bc);//up_dn = "V"; integer agent_action = llGetAgentInfo(llList2Key(avatar_keys, i)); string action = ""; if (agent_action & AGENT_SITTING)action = "S"; if (agent_action & AGENT_MOUSELOOK)action = action + "M"; if (agent_action & AGENT_AWAY)action = "AWAY"; if (agent_action & AGENT_BUSY)action = "BUSY"; if (agent_action & AGENT_TYPING)action = action + "T"; if (agent_action & AGENT_CROUCHING)action = action + "C"; if (agent_action & AGENT_IN_AIR)action = action + "F";//Flying or falling if (agent_action & AGENT_WALKING)action = action + "W"; vector hov_text_color; if ((integer)dist >= 96)hov_text_color = <0.000, 1.0, 1.0>;//Cyan if ((integer)dist < 96 && (integer)dist >= 20)hov_text_color = <1.000, 1.0, 0.000>;//Yellow if ((integer)dist < 20 && (integer)dist >= 10)hov_text_color = <0.180, 1.0, 0.251>;//Green if ((integer)dist < 10)hov_text_color = <1,1,1>; if (~llSubStringIndex(action, "M"))hov_text_color = <1,0.2,0.0>; string prim_text = display_name + " (" + user_name + ") [" + dist + "m " + direction + " " + up_dn + "] " + action; if (display_name == "")prim_text = ""; integer x = (integer)i; current_link_number = llList2Integer(radar_links, x); integer y; for (; y <= x; y++) { prim_text = prim_text + "\n "; } string agents_text = ("[ " + (string)llGetListLength(avatar_keys) + " Agents in Range (" + (string)(llGetListLength(avatar_keys) + 1) + " in sim) ]"); llSetLinkPrimitiveParamsFast(agents_link, [PRIM_TEXT, agents_text, <0.0, 0.35, 1.00>, 1.0]); llSetLinkPrimitiveParamsFast(current_link_number, [PRIM_TEXT, prim_text, hov_text_color, 1.0]); } }
  20. I have a sim sized star ship rezzed by one of my tenants and one of the bridge sounds can be heard from as far as 500m away, while the other bridge sounds can only be heard within a reasonable distance. Why would one sound be able to travel so much farther than the others?
  21. I'm using Firestorm, but switching viewers corrected the problem. Thanks.
  22. I have an attachment that I cannot detach from my avatar, no matter what I do. I've tried relogging. I've tried wearing other items on the same attachment point. I've tried removing all attachments. Detach is greyed out in the menu when I right click it in my inventory, so is Delete. So, I'm stuck. I can't do anything with it. So, what could cause an attachment to be locked to the avatar?
  23. It's limited by script memory. So, it will vary, depending on whatever else you have going on in the script. Also, keep in mind that when dumping a list using llSay, for example, the output is going to be limited by chat character limits. No matter what you have in your list, you will only see the first 1024 characters of it. In trouble -shooting your script, you might consider checking list length, rather than dumping the contents of the list. Or, read a few individual records to check content.
  24. Hi Rolig. I'm still having trouble. This is the script I'm using as a positioning script for the object. The avatar drops this script into the object to be rezzed and clicks it to store the offset and original rotation. The avatar then takes the object back to inventory to be rezzed from the HUD at the avatar's center. When the HUD rezzes the object, I want it to move to a position relative to the front of the avatar. But, so far, the best I can do is have it move to the relative position of the avatar in region coordinates, regardless of the direction the avatar is facing. If the avatar is facing west, the object will rotate itself 180 degrees, but it then moves behind the avatar to the region coordinates represented by the avatar's position plus the offset. vector my_pos;vector owner_pos;vector offset;rotation my_rot;rotation owner_rot; default{ state_entry() { } on_rez(integer start_param) { owner_pos = llList2Vector(llGetObjectDetails(llGetOwner(), [OBJECT_POS]), 0); owner_rot = llList2Rot(llGetObjectDetails(llGetOwner(), [OBJECT_ROT]), 0); llSetRot(my_rot * owner_rot); llSetRegionPos(llGetPos() + offset); } touch_start(integer total_number) { my_pos = llGetPos(); my_rot = llGetRot(); owner_pos = llList2Vector(llGetObjectDetails(llGetOwner(), [OBJECT_POS]), 0); offset = my_pos - owner_pos; float distance = llVecDist(my_pos, owner_pos); llOwnerSay("Owner Pos = " + (string)owner_pos); llOwnerSay("My Pos = " + (string)my_pos); llOwnerSay("Offset = " + (string)offset); llOwnerSay("Distance = " + (string)distance + "m"); }} How do I get the object to move to be in front of the avatar regardless of which direction it is facing? Or, behind the avatar, if that is where it was when it's position and rotation were originally recorded?
×
×
  • Create New...