Jump to content

LepreKhaun

Resident
  • Posts

    1,384
  • Joined

  • Last visited

Everything posted by LepreKhaun

  1. Better would be llRegionSayTo as far as lag reduction. Otherwise, smaller textures will always win out over larger and keep in mind that a face set to an alpha of 0.0 (completely transparent) will work for preloading textures.
  2. irihapeti wrote: when the list is sorted as OP showed then performance-wise by the tools is probably integer NumberOf(list lst, integer this){ integer i = llListFindList(lst, [this]); integer j = 1 + i; if (j && j < llGetListLength(lst)) while(llList2Integer(lst, j) == this) j++; return j - i;} if was unsorted then i probably sort it first Wrong, this fails if there is no match: integer numberTimesFound(list theList, list item){ integer place; if(~(place = llListFindList(theList, item))) return 1 + numberTimesFound(llDeleteSubList(theList, 0, place), item); else return 0;}integer NumberOf(list lst, integer this){ integer i = llListFindList(lst, [this]); integer j = 1 + i; if (j && j < llGetListLength(lst)) while(llList2Integer(lst, j) == this) j++; return j - i; // If no match is found, then this line is "return 0 - (-1)"} default{ touch_end(integer num){ list haystack = [1,2,3]; integer needle = 5; llOwnerSay((string)NumberOf(haystack, needle)); // 1 llOwnerSay((string)numberTimesFound(haystack, (list)needle)); // 0 }} [Edited to show exactly where and how your error is occuring.]
  3. As a general rule, it's best to avoid changing states in the touch_start event handler, as you're doing in state off. It can be a bit buggy at times. See Notes at https://wiki.secondlife.com/wiki/Touch_start.
  4. Don't fret too much about being "unfamiliar with scripting". All of us, without exception, were at that point once. Just stick with it! And thank you for linking: I learned a bit from that thread, which I may have overlooked otherwise.
  5. Doesn't matter if the list is sorted or not and length of list is immaterial. One needs only to iterate the number of times that there are matches: // Call with (list, (list)item), item may be any lsl variable type (except list, of course) integer numberTimesFound(list theList, list item){ integer place; if(~(place = llListFindList(theList, item))) return 1 + numberTimesFound(llDeleteSubList(theList, 0, place), item); // Edited, see Note below else return 0;} Just have to know the tools at hand. [Note: I first had llDeleteSubList(theList, place, place) but later realized it was much better to trim off the start of the list up to place, sending an ever smaller list into the recursion.]
  6. Wizardry and Steamworks has written a puppeteer framework for NPC's that you might find useful for this.
  7. http://www.inmotionhosting.com/business-hosting Have used them for about a decade now. If you can find better, let me know.
  8. Wandering Soulstar wrote: Hi all, I am encountering a strange problem with a bit of code I have and cannot for the life of me find why. I have a single object (mesh) where I want to on occasion set the Alpha of all the faces except one to 100%. The following snippet is what does this: integer numFaces = llGetNumberOfSides();integer x;for (x = 0; x < numFaces; x++){ if (x != HINGE_FACE) { llSetAlpha(0.0, x); }} The problem is that most of the time (not always) all the faces go to 100%. I have put in a sniffer and can see that when the face in question comes up in the loop it does not enter and execute the llSetAlpha statement, but the result is still said face going to 100% Alpha. Any ideas? Keep in mind that each call to llSetAlpha() entails an object update and your loop is causing this to happen for as many faces as your mesh has. Try: integer HINGE_FACE = faceNumberYouWantToKeepOpaque;llSetAlpha(0.0, ALL_SIDES); // Set everything transparent then...llSetAlpha(1.0, HINGE_FACE); // Set that one face opaque This will require fewer object updates and should lessen, if not eliminate, wonky behavior.
  9. No problem. We'd all like to bring items such as to the Marketplace. But, to do so, creators need to master their craft(s). Attempting to mod old scripts written before LSL went Mono may not be the best way to go about that.
  10. It's refreshing to see a 10 year old script by Cubey Terra is still getting modded. However, this seems to be pretty much the same question you were asking before in http://community.secondlife.com/t5/LSL-Scripting/Rudder-script-for-BWWind-sailing-engine/m-p/1526333 . Perhaps if you studied http://lslwiki.net/lslwiki/wakka.php?wakka=control it may help you get a handle on all this.
  11. I've always looked at an object in SL as being equivalent to an LSL list, with the main difference being the change in indexing to base 1 in multiple prim objects. What is lacking is nested hierarchies within both. And though I doubt that either will ever be implemented in SL, one may wish.
  12. You should instruct those that witnessed the actual incident to file an AR. This would set well with When to file an abuse report where it says "File reports on any abuse you witness..." and avoid the possibility of you getting caught in a hearsay situation of a false accusation.
  13. I went to http://go-jamaica.com/power/ , and saw the Note to Webmasters: "Please do not link directly to the audio feed. Please link to the Power 106 Page. Remember we depend on advertising to support the cost of streaming."
  14. All Linden Homes have that. Just go ahead and ignore it. If you're in the correct house, you have a 117 prim allotment (equivalent to Land Impact) and can rez up to that amount.
  15. It's difficult to say without seeing the formula you're using since things are somewhat interconnected to produce the final effect. Perhaps lowering the value of PSYS_SRC_BURST_RADIUS would help.
  16. Observe what is happening to the values as your code goes through all this: string AnimStates;string name;string SIT_anims;string ST_anims;string W_anims;init(){ AnimStates = llJsonSetValue( "Walks",[W_anims,0], "w0"); // (5) AnimStates == {"[]":["w0"]} AnimStates = llJsonSetValue( W_anims, [JSON_APPEND], "w1"); // (6) AnimStates == ["w1"] } default{ state_entry() { SIT_anims = llList2Json( JSON_ARRAY, [JSON_NULL]); // (1) SIT_anims == [null]; ST_anims = llList2Json( JSON_ARRAY, [JSON_NULL]); // (2) ST_anims == [null]; W_anims = llList2Json( JSON_ARRAY, []); // (3) W_anims == []; AnimStates = llList2Json( JSON_OBJECT, ["Walks",W_anims,"Stands",ST_anims, "Sits", SIT_anims]); // (4) AnimStates == {"Walks":[],"Stands":[null],"Sits":[null]} init(); // (6) AnimStates == ["w1"] } touch_start(integer total_number) { name = "Walks"; string s = llJsonGetValue(AnimStates, [name,W_anims]);// (7) s == JSON_INVALID; // string s = llJsonGetValue(name, [W_anims,1]); llOwnerSay(" got " + s); }} The string s is JSON_INVALID because you are trying to access an object Name of "Walks" in AnimStates which is now a JSON array. It was a JSON object in step (4) but your call to init changed it. [Edited to consolidate a few following postings as I realized where the problem lay.] I beleive the problem in your script is thinking you need to name these arrays as you would a LSL variable. Look at them as anonymous arrays that are accessed as the Value in the Name:Value pair within the JSON object. OK? Here's all you need: string AnimStates;init(){ AnimStates = llJsonSetValue( AnimStates, ["Walks", JSON_APPEND], "w0"); } default{ state_entry() { AnimStates = llList2Json( JSON_OBJECT, ["Walks", "", "Stands", "", "Sits", ""]); // (1) AnimStates == {"Walks":"","Stands":"","Sits":""} init(); // (2) AnimStates == {"Walks":["w0"],"Stands":"","Sits":""} } touch_start(integer total_number) { string name = "Walks"; string s = llJsonGetValue(AnimStates, [name, 0]);// (3) s == "w0", the first value in the array which the the value of the "Walks" Name in the object AnimStates // string s = llJsonGetValue(name, [W_anims,1]); llOwnerSay(" got " + s); }} As soon as you use JSON_APPEND, an array will be formed if there's not one there at that location, as per your specifiers list. If there is one, the supplied value will be added to the end of that array. If you attempt to name your arrays as you were doing, such as W_anims, you will only confuse the fact that the only name of that array, within AnimStates, is "Walks". That array is Value of the Name:Value pair of that element within the JSON object. (There, I think I said it right finally! LOL)
  17. arifmukhthar wrote: Hi, I am doing a project in a secondlife to move objects with gestures using a motion sensing device. I am done with the kinect interfacing part. As i have no expert skills in LSL coding, I need some help with it. Any help will be greatly appreciated. Here are the requisites, 1. There must be a parent prim. 2. If we click a on child prim, the child prim must move and get attached to the parent prim. EXAMPLE: Let the parent prim be the body of a robot. If the arm (child prim) is clicked it must hover to the body and get attached to a phase. My project's deadline is approaching and I am stuck with the LSL coding part. An example script to move a child prim and attach it to the parent prim's face will do. Thanks in advance! I'm a bit confused as to what you're wanting to do here. But if you want the child prim, when clicked on, to move to the root prim and get "attached" by aligning two of their faces, this is going to be more complicated than you might think. It's possible, I suppose, but I don't know of any example scripts to do this. Sorry. If you contact skidz Tweak inworld, they might be able to help, having written a number of scripts that do similar things along these lines. I have found them to be very helpful in the past.
  18. Innula Zenovka wrote: I can't say I often (ever?) use llPassTouches, but am I correct in thinking that I would consider using it only if I've got scripts in both the root and a child prim, both scripts contain touch events, and I don't want the touch event in the root to fire if someone touches the child prim? It's an old function, and, to my mind, it's now pretty much obsolete since there's very circumstances in which I would need a separate script, let alone one containing a touch event, in a child prim. You'd use it if you DID want the touch event passed on. Default is FALSE. Say one did a HUD with buttons that each had distinct functionality that you wanted to toggle on and off as needed. Using llPassTouches(TRUE) in each button (child prim) script then the background prim (root) script could then highlight (with color, scaling or texture changes) the active button(s) at any moment. And, yes, it could be done in one huge script in root but this approach would modularize everything and give the scripter much more room to work within in developing the functionalities of the buttons.
  19. Happy Toshi wrote: I really didnt want anyone to make this but if you enjoy moving threads around its all good... I just wanted to buy it off the marketplace... Make sure you search the Marketplace for both "mesh lightbulb" and "mesh light bulb". That should make sure you're not missing anything offered along these lines.
  20. Check to make certain you're not wearing an animation overrider (AO) which may have its own sit animation set higher than our default level 4. If you're wearing such, you'll have to remove it for the poseball to work correctly.
  21. irihapeti wrote: LepreKhaun wrote: copy and pasting from (as irihapeti so eloquently says it) "SL freebie dumpsters" . by SL freebie dumpster I mean a box of scripts or gestures or anims or textures or clothes or objects or whichever found inworld at any number of places under a big sign that say Free or Freebie. When a script is found in a freebie dumpster box then copypasta to forum is how it goes usually Ahhh, you mean like YadNi's Junkyard! I love that place, go there about once a month and always find something useful. Ever read The Junkyard Rules? Do you think you could forget about trying to find legal license loopholes to the ToS here and just go with that when it comes to our LSL script repositories? I only ask because when I hear Ferd Frederix say "People come back again and again for good content. They go back again and again to libraries." I sense a bit of well earned pride and justified satisfaction in doing such a crucial service for this community. Is it really too much to ask that the users here link to his content rather than copy and paste it?
×
×
  • Create New...