Jump to content

Quistess Alpha

Resident
  • Posts

    3,732
  • Joined

  • Last visited

Everything posted by Quistess Alpha

  1. using linkset data can greatly simplify remembering handles: Instead of: key gHandleRequestStat; // global variable //... later in some event: gHandleRequestStat=llReadKeyValue("my_stat"); //... dataserver(key ID,string value) { if(ID==gHandleRequestStat) { /*...*/ } } consider: llLinksetDataWrite("Handle:"+(string)llReadKeyValue("my_stat"),"read:my_stat"); //... dataserver(key ID,string data) { string request = llLinksetDataRead("Handle:"+(string)ID); // semi-important ETA: delete the stored key after use! llLinksetDataDelete("Handle:"+(string)ID); // also in 'real code', check request!="" for sanity. if(0==llSubStringIndex(request,"read:")) { string stat = llGetSubString(request,5,-1); // set stat to data }// ...else ... }
  2. LL tries very hard to make sure new changes don't break old things, so whatever was done in the tutorial should still be valid. Everything you really need to know about notecard reading should be available on the wiki: https://wiki.secondlife.com/wiki/LlGetNotecardLine There's a new function for reading from a notecard called llGetNotecardLineSync, but I wouldn't recommend it to a beginner.
  3. The wiki example can be generalized a bit: // untested example: string generalCompass (vector direction) { list DIRS =["W","NW","N","NE","E","SE","S","SW","W"]; integer index = llCeil(3.5 - (4 * llAtan2(direction.y, direction.x) / PI)); // I'd clean up the above math for clarity, but too lazy to debug. Off the top of my head. . .: // list DIRS = ["N","NE","E","SE","S","SW","W","NW"]; // integer index = llRound(8*(llAtan2(direction.x,direction.y)/PI)); // llAtan2(x,y); returns clock-angles, whereas llAtan2(y,x); returns math angles. return llList2String(DIRS, index); } // What direction is the position X with respect to where this object is? // generalCompass(X-llGetPos()); // What direction is object 'ob' facing? (assuming it has standard orientation, which avatars do, but many don't: // generalCompass(llRot2Fwd(llGetObjectDetails(ob,[OBJECT_ROTATION]))); // What direction am I or the avatar I'm attached to facing? // generalCompass(llRot2Fwd(llGetRot()));
  4. Agreed. Anyway, the closest thing I know of to what you're asking for would probably be a slave auction board. It's usually portrayed as doms paying for subs, but one of the more popular ones had a section for the reverse last time I checked (years ago). Other than that, I think you'd just have to 'freelance' and find appropriate places to advertise your services.
  5. Indeed, putting a script that says something on a non-zero channel when touched into the hunt item is probably the best solution. But if you're willing to change the input from touching the object to touching the HUD when near the object and your avatar is facing it, llSensor could be viable, or raycast as was suggested earlier.
  6. Jump targets. See the first example in the wiki: https://wiki.secondlife.com/wiki/Jump
  7. (also at the risk of going off topic...) It used to be things were done by color and getting versions for each body included was a given. In my naive non-merchant understanding, don't color fatpacks make more sense? I'd presume there are more people who like different colors than people who use two or more different bodies on the regular.
  8. store the inventory key of the notecard and check against it, roughly: key kNC; // notecard's inventory key. //... changed(integer c) { if(c&CHANGED_INVENTORY) { key k = llGetInventoryKey("Notecard Name") if(k!=kNC) { kNC = k; handleNotecardRead = llGetNotecardLine("Notecard Name",0); } } }
  9. All the ones I've seen are of this variant, but they can be ~very clever about not making the position obvious. If you have such a device, write a simple particle script that sends a beam from an attachment to a known object in-world (a 'leash' should work, but make sure it's from a different device than the one that's doing the hiding). That may make the hidden position more obvious.
  10. perhaps use ⌚ or ⌛ instead? Those seem to be in the character set given by @Frionil Fang's quote.
  11. A few years ago I made a thing that needed a 'guided setup', there were like 5 different things the user needed to do (change permissions, set object description, input an email, etc.) that for the sake of clarity were asked of the user in-order. Implementing it with states for each step had a lot of duplicated code, but was rather easy to write and debug. a while later I had to re-write the system, and decided to use just 2 states (one for setup, and one for when it was running) to see the difference. and it turned out a lot messier, with a lot of checks on the 'state' global variable in each event, which just looked confusing. Moral of the story I guess, is that states aren't useful most of the time, but when they make sense, they're incredibly useful if only for code clarity. All the times I can think of using states have been some form of 'setup' state, where the script does things like requesting permissions and reading notecards, (IMO a separate setup state is best practice for anything requesting PERMISSION_DEBIT) and then a state for when it's operating normally. But any time something needs to have radically different reactions to events, states can offer a lot more clarity than global variable checks, even though almost everything a state change can do can be done without one*. *moving from a state with a touch event to one without can "disable" the mouse hover over effect for an object. CLICK_ACTION_DISABLED might now have the same effect, the wiki doesn't say so though.
  12. even with global variables, I think what Love's saying is that you might have accidentally done something like: string name = "Bad Value"; default { state_entry() { string name = "Good value"; // by writing 'string' at the begining of the line, we cause the global copy of name to not be written to. } touch_start(integer n) { llSay(0,name); // will say 'bad value' because of error in state_entry() } } Which is allowed in LSL, but almost never intended.
  13. llGetInventoryKey("animation name"); will give you the key of "animation name" if it's in the object's inventory, unless there are some permission issues I've forgotten about. You can in-fact start and stop an animation with its key rather than its name, but if you try and stop an animation with its key and it's neither a built-in animaiton nor in the prim's inventory, I think that makes a pop-up error.
  14. It doesn't answer the wording of your problem, but perhaps a better way of going about it would be to use llGetAnimationList() to check which animations are running rather than a global variable. Or, you could just stop all the animations you may be running; AFAIK there is no penalty for stopping an animation that was never started.
  15. AFAIK the "correct" behavior is that temp attachments only detach when done explicitly (logout/user detach/llDetachFromAvatar) or when entering a parcel/region that doesn't have the experience that requested the permission to attach. A quick test shows that non-experience temp-attachments survive region-changes non-borked.
  16. Basically, yes. You could also think about it as the new region taking non-zero time to learn about your attachments from the old region.
  17. The energy system is anything but intuitive and affects very few specific systems; Thanks for telling us how you figured it out!
  18. https://search.secondlife.com/?search_type=standard&collection_chosen=places&places_category=&destinations_category=92&events_category=0&date=&dateformat=mm%2Fdd%2Fyy&starttime=0000&maturity=gma&query_term=sandbox
  19. A fancy replacement for cycleList might be something like: list = llList2List(list,1-llGetListLength(list),0);
  20. LSL is pass-by-value, and will never pass-by-reference. In other words, cycleList (content1); cannot change the value of content1. you have to return the value and do an assignment: list cycleList (list c_list) { if(llGetListLength(c_list) > 0) { string first_entry = llList2String(c_list, 0); c_list = llDeleteSubList(c_list, 0, 0); c_list += first_entry; llOwnerSay("Debugging. New list order is: " + llList2CSV(c_list)); //return c_list; // returning here but not outside the if() will result in an error: // functions that return a value must return a value in all cases. } return c_list; } // later in the script: some_list = cycleList(some_list); Consider also: default { state_entry() { integer x=7; llOwnerSay("X="+(string)x); // scope-creation does not need a reason, like an if/while/for { integer x = 9; // removing 'integer' from this line leads to more 'expected' behavior. llOwnerSay("X="+(string)x); } // when scope is exited, x has its previous value: (because was re-declared in new scope) llOwnerSay("X="+(string)x); } }
  21. Very recently, llSetClickAction(CLICK_ACTION_IGNORE); was introduced, which fixes that exact problem: when CLICK_ACTION_IGNORE is set, clicking behaves as if the object which ran the command doesn't exist. (I haven't tried it though, not sure how it interacts with right-clicking)
  22. should just be llOwnerSay("@shownames=y"); also, you can combine multiple commands into a single string: for example: llOwnerSay("@shownames=n,shownametags=n,setdebug_renderresolutiondivisor:10.0=force");
  23. That's a RLV-specific thing that changes a debug setting, llOwnerSay("@setdebug_renderresolutiondivisor:8=force"); where 8 is the amount of pixelation. Some combination of environment lighting settings can make a 'trippy' atmosphere. play with your personal environment settings, then see llSetAgentEnvironment
  24. I was prompted recently to post a rather old script I wrote that did such in the LSL library. It's actually rather subtle and tricky to do in a way that 100% won't crash in a room full of people with crazy (long&/funny symbols) names. (said example does crash)
  25. you need the attach event from your first script to request the permission to play the animation before you play it (you can remove the permission to take controls).
×
×
  • Create New...