Jump to content

Quistess Alpha

Resident
  • Posts

    3,876
  • Joined

  • Last visited

Everything posted by Quistess Alpha

  1. my point was that, if you link them, the LSD becomes merged, which if you figure out the caveats, might bypass the need for communication.
  2. I usually figure out the technicals before deciding on the UI. probably too much hassle if you're only slightly over 1024, but having the object rez and then link the "backup disk" then unlink it and present it to the user to take, doesn't sound too unfriendly, especially if actually using the backup is less common than creating one. . .now I think on it though, scripted backup seems pretty silly unless the object is no-copy.
  3. If I needed to do that, I've tossed around the idea of linking and breaking in my head a few times, but not actually tried it. that requires special permissions and is a tad slow though.
  4. AFAIK, no. if sending large amounts of data in 1024 length packets (as you alluded to in another post) and you really need to keep the order, you might have to add some book-keeping to your conversation protocol. For example "0,some data","1,some data","-2,some data" using the sign to indicate it's the last transmission in the group, receiver stores everything and interprets only after a negative index, and number_of_received_packets+1==llAbs(the_last_negative_index). sending acknowledgements from the receiving object, (transmitter 'sends the next packet' when it hears "ack" from the receiver) if it's not mission critical, llSleep(0.2); between each message is probably good enough for most use-cases)
  5. I guess it depends on what you're trying to optimize. A single loop means the function itself will take up, maybe 10~50 bytes less script space? but will run incalculably slower. (because you're checking something you already know, for every character) ETA: Also, I liked the first one better. % and / are both slow. Preffer &1 and >>1 (or *0.5 for floats) respectively . (n/2)*2 == n&(~1) == n&(integer)(-2)
  6. Good job! Some really minor suggestions, but wouldn't flipping the conditional save doing a negation operation for every character? if(iDir) instead of if(!iDir). Come to think of it, you could just place the conditional outside the loop, and if I'm being over-optimizationalist, overload the input parameter as the loop variable: string MemComp(string sInput, integer iDir) { //Compress 2 UTF-8 chars into UTF-16, or decompress UTF-16 to UTF-8. Credit: Jenna Huntsman, Mollymews string sOut; if(iDir) // decode for every non-0 value. { //Decode for (iDir = 0; iDir < llStringLength(sInput); ++iDir) // overload iDir to be a loop increment. { integer c = llOrd(sInput,iDir); sOut += llChar((c >> 8) & 255) + llChar(c & 255); } }else // idir==0 { //Encode for (iDir = 0; iDir < llStringLength(sInput); ++iDir) // overload iDir to be a loop increment. { sOut += llChar((llOrd(sInput,iDir) << 8) | llOrd(sInput,iDir+1)); ++iDir; //Iterate i by 2 and not 1 on encode. //(if you wanted to be fancy could embed ++ in the += line, but that would be harder to read and debug given lsl execution order, and no more efficient.) // something like llChar(llOrd(sInput,++iDir) | (llOrd(sInput,++iDir) << 8) ); with the increment removed from the for construction and initialize to -1. } } return sOut; } again though, really minor nitpicks!
  7. actually forum software deletes it, or at least I was able to copy the character from Wikipedia but not Invision forums.
  8. I managed to get it after trying again (several times), not sure if I just hit my own cache or something though.
  9. No, I don't think so. (Trying to explain logic is hard, or I'd be more verbose.) If they don't ~leave at about the same time , that could cause a minor "issue". If this were a widely used thing and that were a common complaint, the easy hack fix would be to llSleep(0.5); at the beginning of the collision_end() event. llSetStatus() has no forced delay, and llVolumeDetect() has no llSLPPF equivalent. If anything, llSetStatus is better than llSet.. because it doesn't have a list argument. (list instantiation is a bit slow)
  10. Just to pinpoint the problem, did you try dropping it from about the same height without breaking links? a hacky solution might be using llSetHoverHeight to never actually hit the ground?
  11. There are a lot of annoying places that expect it to be owner only. none of them seem hard to fix, but it would be a tad tedious to debug. main points for a quick hack-together fix: replace all llOwnerSay("text"); with llRegionSayTo(llGetLinkKey(llGetNumberOfPrims()),0,"text"); or similar (could be more efficient with global variables). replace llListen(ListenCh, OwnerName, NULL_KEY, ""); with llListen(ListenCh,"","",""); remove if(llGetOwnerKey(id) != Owner) return; remove if(sitting != llGetOwner()) { // llWhisper(0, NonOwnerMessage); llUnSit(sitting); }else replace llRequestPermissions(Owner, with llRequestPermissions(sitting, There may be other necessary changes in scripts in child prims.
  12. nd == "Number detected" or, how many people started/stopped colliding with the thing in that instant, which not especially useful to you unless you try and use the information to try and fix annoying edge-cases: a group-member and a non-group-member try to go through at the exact same time. someone TP's away while inside. #2 is especially annoying. Last time I tried something kinda like this, the best work-around seemed to be only using collisions as a hint to start llSensorRepeat(). -- Don't fix what isn't broken, but FWIW, llSetStatus(STATUS_PHANTOM, ONOFF); and llVolumeDetect(ONOFF); serve similar purposes. I'd use volume detect unless I had a reason not to, but it shouldn't make much difference in this case. also, I don't think there's a need to check the phantomness of the object before turning it one way or the other, default { collision_start(integer nd) { if(llDetectedGroup(0)) { // 0 is the first collision detected llSay(0, "Detected someone of the same group! WELCOME!"); llVolumeDetect(TRUE); // Become un-solid } else { llSay(0, "You shall not pass without our group active :) ! "); llVolumeDetect(FALSE); } } collision_end(integer nd) { llVolumeDetect(FALSE); } }
  13. Is it in state_entry()? function calls aren't allowed outside an event.
  14. I don't think finding sandboxes is that big an issue*, but it would be nice if there were a list of/ category for open sandboxes in the in-world destination guide, and if the "you cannot create objects here, the landowner does not allow it" message was more prominent (it appears in the upper right corner, is pretty small and blink and you'll miss it) and had a link to said list. *It's been a bit since my new-user experience, but I managed to find the ivory tower and such easily enough during my early weeks.
  15. So, if you have a script that does something there's not much you can do unless you can edit the script (you probably already know this, ). A single script in the root 'make the touched link glow' might look something like this: default { touch_start(integer n) { integer link = llDetectedLinkNumber(0); // which link was touched? if(link==1) return; // do nothing if the root was touched. float glow = llList2Float(llGetLinkPrimitiveParams(link,[PRIM_GLOW,0]),0); // was it glowing? glow = 0.05 * (glow==0.0); // if it wasn't glowing, we want it to glow, if it was, we want it to not. llSetLinkPrimitiveParamsFast(link,[PRIM_GLOW,ALL_SIDES,glow]); } } for this sort of thing, I usually differentiate the action based on the name or description of the touched link: default { touch_start(integer n) { integer link = llDetectedLinkNumber(0); // which link was touched? if(link==1) return; // do nothing if the root was touched. string name = llGetLinkName(link); if("glow"==name) { float glow = llList2Float(llGetLinkPrimitiveParams(link,[PRIM_GLOW,0]),0); // was it glowing? glow = 0.05 * (glow==0.0); // if it wasn't glowing, we want it to glow, if it was, we want it to not. llSetLinkPrimitiveParamsFast(link,[PRIM_GLOW,ALL_SIDES,glow]); }else if("turn"==name) { rotation orientation = llList2Rot(llGetLinkPrimitiveParams(link,[PRIM_ROT_LOCAL]),0); orientation = <0,0,0.71,0.71>*orientation; // turn 90 degrees on its local z axis. llSetLinkPrimitiveParamsFast(link,[PRIM_ROT_LOCAL,orientation]); } } } // if you can't make it all one script and need all of the scripts in every link of the object to be notified, you need to use a link_message: // script in root: default { touch_start(integer total_number) { llMessageLinked(LINK_SET,0,"Touched",""); } } // script in child prim default { link_message(integer SendersLink, integer Value, string Text, key ID) { llSay(0, "Touched "+(string)llGetLinkName(LINK_THIS)); } } or, if you just want everything to glow: llSetLinkPrimitiveParamsFast(LINK_SET,[PRIM_GLOW,ALL_SIDES,glow]);
  16. As far as know, they can enter anything they want. If it were me, I'd use a 'zero-width space' as the separator. https://en.wikipedia.org/wiki/Zero-width_space ETA: Apparently, the forum software does not like ZWSP's. Now that we have llChar, you could just use llChar(0x200B);
  17. Sounds like a decent first project if you want to figure it out yourself. the main pieces: list inventory; integer nItems = llGetInventoryNumber(INVENTORY_ALL); integer i; for(;i<nItems;++i) { inventory+= llGetInventoryName(INVENTORY_ALL,i); } llGiveInventoryList(llDetectedKey(0),"Folder name",inventory); if( llVecDist( llDetectedPos(0),llGetPos() ) < someDistance) { // then... } Assuming the object is set to the group to check: if(llDetectedGroup(0)) { // then... } group checking is a bit awkward because you can only check against the ~active group.
  18. Even better, the script has pretty obvious sections for when the door opens and closes, you could add a different sound for each. MoveDoor() { if(!bOpen) { /* some code*/ llPlaySound("Door opening sound",1.0); }else { /* some code*/ llPlaySound("Door closing sound",1.0); } /* more code*/ }
  19. they don't have "children's sizes" (fit for common kids bodies) but [hate this] has some decent ones (no-transfer though): https://marketplace.secondlife.com/stores/25598
  20. Yes, as long as llGenerateKey() doesn't fluke and return NULL_KEY, if(llGenerateKey()){/*always executes*/}else{/*never executes*/}
  21. Yup, but it only works if the type of the value is key. As per the wiki on the if statement: https://wiki.secondlife.com/wiki/If
  22. The real problem is one step back: Where are your customers getting a name of an item without a working slurl to directly in-front of the relevant vendor? If that's too hard to fix, perhaps add an additional vendor with literally everything in your store searchable by product name?
  23. Silly me imagined using the position of the prims as the spacer rather than whitespace characters, dope. figuring out the correct spacing for each letter seems error prone and tedious. Good job!
  24. Just some irrelevant style notes, but n should probably be a local variable in this case, not a global one. I'd do away with n altogether and just apply the modulus to the counter: iCounter = (1+iCounter)%iMax;
×
×
  • Create New...