Jump to content

Wulfie Reanimator

Resident
  • Posts

    5,752
  • Joined

Everything posted by Wulfie Reanimator

  1. Another guess (I can't get in-world to test), but I don't think you need to give the contents on CHANGED_OWNER. The attach event by itself is enough, it will work even without resetting the script. Edit: Yes, you did it right.
  2. Wild guess, but it's probably because the attach event triggers when your friend attaches it and they get the lContents... and then the changed event triggers because of new owner, giving them the lContents again.
  3. Here's the simplest, complete example I can give: default { attach(key id) { if(id) llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); } touch_start(integer n) { llStartAnimation("holdanimradio"); } } (Of course, you'll have to change "holdanimradio" to something that actually exists in the object.) You have to make sure that you attach the object after you have saved the script. If you are already wearing the object when you save the script, the "attach" event never triggers, and it won't have permissions until you detach and reattach the object. This demonstrates that: Permissions to animate are given. You don't need a run_time_permissions event. (In this example. There are other cases where you would need to use it.) You can use llStartAnimation without problems.
  4. The basic concept behind that snippet of code I posted earlier is fairly simple: "When this HUD is attached to an avatar, request permissions to animate." Then, at any point later when you would need to play an animation, you can simply call llStartAnimation. if (message == "Love") { // default message llInstantMessage(ownerID, thaName+" poked you and you love it."); // other person? Warn if (toucherID != ownerID) { llInstantMessage(toucherID, "The owner loved it"); } llStartAnimation("love"); // Just play the animation, you have permissions. } As for the script you posted, it seems like you don't quite have a hold on "events" as a concept: else if (message == "Hate") { llInstantMessage(toucherID, "The owner HATED it, don't do it again!"); // I know it's not here, but this is where it must happen, but I have no idea how :) run_time_permissions(integer perm) { if (perm & PERMISSION_TRIGGER_ANIMATION) { llStartAnimation("Walkpose"); llSetTimerEvent(14.0); } } } Events (such as run_time_permissions) cannot be inside of other events (like the listen event in this case). They are separate blocks of code that trigger whenever something happens, like run_time_permissions is triggered after llRequestPermissions if any permissions are granted or denied. And if you want to only play a love/hate animation after a dialog choice, you don't even need run_time_permissions in the script at all (because permissions are guaranteed to be granted with the method I showed).
  5. llStartAnimation is correct, but the HUD must call llRequestPermissions before llStartAnimation, or you will get an error. However, PERMISSION_TRIGGER_ANIMATION will be automatically granted (no permission dialog) after llRequestPermissions because the HUD is attached. To make life easy, you should just put llRequestPermissions in the attach event, after making sure the HUD is attached. eg: default { attach(key id) { if(id) llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); } } "if(id)" is the same as "if(id != NULL_KEY)"
  6. Behold: I call it "The Jank" justify(integer k, list words) { while(words) { list w; integer word; // Test length of adding next word while(llStringLength(llDumpList2String(w + llList2String(words, word), " ")) < k && word < llGetListLength(words)) { w += llList2String(words, word++); } integer spacesLeft = k - llStringLength(llDumpList2String(w, " ")); integer wordCount = llGetListLength(w)-1; integer i; while(spacesLeft--) { w = llListReplaceList(w, (list)(llList2String(w, i) + " "), i, i); if(++i == wordCount) i = 0; } // Show line, delete used words before looping llOwnerSay(llDumpList2String(w, " ")); words = llDeleteSubList(words, 0, word-1); } } // Output: //[12:20:54] Object: the quick brown //[12:20:54] Object: fox jumps over //[12:20:54] Object: the lazy dog By the way, whenever you copypaste anything into the forum text box, you should use the "paste as plain text" option. (Shown below the box as an option, or you can right-click to paste as plain text.) Otherwise, the text style will be pasted as well, and it doesn't really work for some of us...
  7. Of course your own attachments (even your HUDs) affects the performance of your viewer. You don't think rendering yourself is somehow magically free and instant for your computer, do you?
  8. Complexity in general is a lie, at the moment. Not only is it based on the average of each viewer reporting their own complexity calculations of others (so a malicious viewer could technically falsely report avatars as far higher complexity than they should be), but it is also incredibly easy for creators to exploit the complexity algorithm by making 1-3 of the 4 levels of detail as low as possible, leaving only the 1-2 highest levels "visible." I wrote more about real examples of this in an older thread:
  9. Thank you dearly, @Whirly Fizzle and @CoffeeDujour. My C++ never got to a point where I could comfortably cruise through so much source code. I was also actually going to be using C#, so that LibreMeteverse link is a life saver.
  10. With the official SL viewer code as scattered as it is, I'm having trouble finding all the code related to connecting to SL (login, specifically). Does anybody know off the top of their head where it is and if there's actual documentation for the API? I'm interested in trying a little project (not a full viewer or even in C++).
  11. Ideally, you would have those points as a list. First, you would navigate to the first point, then in the path_update event, you would wait until you have reached that point and move to the next point in the list. I can't post an example right now, but I think it's a pretty simple concept.
  12. Interesting thought, what's the difference between "loot boxes" and other similar things, like those little gacha machines in stores (collectibles, have resale value) or other "blind purchases" like trading cards with a very strong second-hand market (Magic the Gathering, Pokemon, etc)? You can buy a booster pack of 15 MTG cards, you know there's going to be 10 commons, 3 uncommons, 1 rare or mythic, and a land card from whatever set that booster is for. But you have no idea what the exact cards are going to be. Not all of those cards are good or playable for you, most of them won't be worth anything (2 cents second-hand) but others could be worth $40 or over $200.
  13. That's because technology has surpassed our old/current laws and social norms in many ways, not just in the definition of gambling. The US as a whole doesn't seem to be doing much regarding this subject, but Minnesota specifically has age restricted loot boxes from anyone under 18. This whole thing started from Star Wars Battlefront 2, which did not have trading or selling. Belgium required the loot boxes to be removed from the game to be compliant with their laws. China and SK have similarly strict laws and passed a new one specifically for "virtual tickets" aka loot boxes, chests, keys, etc.
  14. "Loot boxes" always give you something. Still classified as gambling by multiple countries now. (Netherlands, Belgium, Australia, China, South Korea, Minnesota US) Some games allow the contents of a loot box to be traded or sold directly for real money (particularly on Steam). There are third-party sites that allow you to literally bid your loot in order to win something better (or nothing at all).
  15. I can only assume this is the paragraph Steph is clinging to on the holy page of Mono: "In some extreme cases Mono scripts can use up to four times the memory as LSL2 scripts. To maintain backwards compatibility, the script size limit has been increased from 16KB to 64KB." This does not imply that they intended to keep scripts at the original size. They just chose a size that wouldn't break anything while not seeing a reason to go higher at the time. Later on the same page, in the FAQ section, there's even this question: "64K? Wow, isn't that going to encourage inefficient scripting? We hope that the change will promote more efficient scripting. Currently programmers have to get around the 16K limit by using multiple scripts, and a lot of cycles get spent on passing data between those scripts. With a single script that would not be necessary." Even back then they've recognize the benefit of not having to split one script into multiple. This consideration is still alive as shown by the conversation with a Linden earlier.
  16. As usual... No sources or examples for anything. Just more of the same old misinformation and false beliefs. (Comments affect script performance? What even is a compiler? 😂) Edit: A site as a whole is not a "source." Didn't they teach you that in school? You must link the page where the information is found.
  17. One limitation of this is the fact that you'll have to try and account for every type of character that's probably going to be attached to the word. Period, comma, question/exclamation, brackets, etc. (And the function can only take a limited amount, so you'd have to do it in multiple batches.) It really depends on what the exact use-case is (or expected input), for the best advice.
  18. If you know them, you should ask! Or you could link a video here so we can speculate. It depends on how many avatars are in your view and what they are wearing. I would expect someone making that high performing videos to be pretty aware of this and take it into account. Maybe it's just a couple avatars in carefully constructed settings. If something is causing them performance issues, they'll probably hold back on recording until it's resolved.
  19. There is probably no commercially available (/viable) build that can run SL maxed out in every situation. SL viewers are already off to a poor start when most of them run single-threaded and don't utilize the GPU even nearly as much as the CPU. But it's not so much that SL itself isn't capable of performing well, it's the content in it that's the biggest problem. Almost everything in SL is created by regular users with no standards or understanding of working in an environment rendered in real-time. Some of the most popular/recognizable products and brands like Maitreya, Belleza, and Catwa create bodies and body parts that are hundreds if not thousands of times more render-heavy than the equivalent you'd find in even a hobbyist video-game. If you're around people (or just bad enough objects), expect to lag no matter how powerful your computer is. If you will be using your computers for work as well (what kind of work?), you wouldn't have to worry about SL not performing flawlessly as if you wasted money.
  20. Textures only need to be downloaded once, even if there are several copies. This can sometimes be seen in areas where the same texture is used in multiple places (or multiple copies of the same object), they'll all load at the same time. I believe the same applies for meshes. That said, two faces and 2042 KB texture memory? Why would anyone use two max size textures? Horrible practice, honestly.
  21. But, to be fair, Mono itself is not LL's code. It's an open-source, multi-platform programming language. (link, link) Probably not related at all, but it's a fun fact.
  22. It depends on what comes after the !~ operators. Would you share? "~" Is "bitwise not," also called "two's complement." It inverts each individual bit in binary, then adds one to the result. ~(-3) = 2 ~(-2) = 1 ~(-1) = 0 ~0 = -1 ~1 = -2 ~2 = -3 ~3 = -4 In scripting, this is most commonly seen with functions that return an index, or -1 if "nothing is found" if the function returns it to indicate an error. "!" is "logical not." Any nonzero (like -589, -1, 1, 2385) integer becomes 0, and 0 becomes 1. !~(-3) = 0 !~(-2) = 0 !~(-1) = 1 !~0 = 0 !~1 = 0 !~2 = 0 !~3 = 0 Here, -1 finally becomes 1 (because ~(-1) = 0, and !0 = 1) or "true." This is why you see this syntax used with functions that might return -1 in some cases. The if-check probably roughly translates to "if nothing is found."
×
×
  • Create New...