Jump to content

tomm55

Resident
  • Posts

    100
  • Joined

Everything posted by tomm55

  1. Honestly I am little bit confused. I have googled "LSL compiler source code" and it gave me this: https://github.com/Sei-Lisa/LSL-compiler On that page they say "This is a standalone LSL compiler, extracted from the viewer sources." I did a quick search in my Firestorm sources, but found nothing. So either it was not included in Firestorm sources and is only in official viewer source (which I don't have right now) or I don't know where it comes from.
  2. Additionally if you were interested in memory efficiency, the wiki page http://wiki.secondlife.com/wiki/User:Omei_Qunhua suggests that height = height * 100 or height *= 100 should result in same bytecode length. x=x*2; 10 x*=2; 10 A bit shift operator will result in 4 more bytes of bytecode for some reason. x=x<<1; 14 (assuming you use Mono)
  3. Yeah, and I think the compiler is also closed source. So we can probably only test it and see what result it gives 😀 Edit: it's not closed source.
  4. If you need to just multiply one or two values, then you don't need to worry about such things. Only if you are for example multiplying thousands of times in a cycle, and you want to make it as fast as possible. Premature optimisation is a way to hell they say 😄 and can also negatively impact code readability. And also there might be another and larger bottle-neck in your code that you don't know of. Anyway, most programming languages already take care of optimisation and for example turn division by a constant into multiplication by default. Not sure if this happens in LSL too, but as @Quistess Alpha already said, the fastest you can get is to multiply or divide by powers of 2 using the bitshift operator. But I have a feeling that it won't really make a huge difference in LSL 🙂 But who knows... You could do a comparison and show us the results 😉 Would be interesting to see.
  5. Try setting the desired maturity level and then click search (maybe also enter some keywords). It should be remembered.
  6. Just curious...where do you set your account as scripted agent? Never noticed this.
  7. Are you sure you don't have a bug in your code? Maybe you accidentally pass empty string or whitespace to llSetText? I have never seen a hover text to disappear on its own (but I have rather seen people struggling to get rid of it 😁 including me 😁)
  8. I don't know if there's something wrong in using llRezObject, but I do use it 😁I have a script that rezzes large (or better said lengthy/disproportional) objects consisting of multiple linked elements. When I was first using llRezAtRoot, the objects were not placed exactly as I wanted. As positioning is important in my scenario, I have later figured out that it was because the rezzed objects have their root prim somewhere on the left side. The wiki explains it: llRezAtRoot rezzes objects according to center of the root prim, llRezObject rezzes objects according to center of the whole object (or center of its mass, you know what I mean...). You can of course add offset to the position and use llRezAtRoot anyway, but the llRezObject can be handy sometimes, so probably nothing wrong if you use it @eduardoalonzo.
  9. That's what both scripts already do. Would be better if you shared your actual script with us, as you have probably changed it, or at least share the important parts.
  10. It's my nature to never trust asynchronous callbacks (after years of programming) Anyway, @MelodicRain, you can use whatever solution was posted in this topic and you will be fine And next time I will not write posts on a small display ðŸĪŠ
  11. Aaaah, I'm sorry @Rolig Loon ! Now I can see it. I probably looked at @Fenix Eldritch's post instead of Rolig's. So, @Rolig Loon's script will work fine Sorry for the confusion!
  12. I don't agree @Rolig Loon llGetNotecardLine is an asynchronous function. The execution of next line of code follows immediatelly. Try this example and see for yourself: key notecard1Query; key notecard2Query; string NOTECARD1_NAME = "notecard1"; string NOTECARD2_NAME = "notecard2"; string resultOne; string resultTwo; default { state_entry() { if (llGetInventoryKey(NOTECARD1_NAME) == NULL_KEY || llGetInventoryKey(NOTECARD2_NAME) == NULL_KEY) { llOwnerSay("Notecard missing"); return; } llListen(123, "", NULL_KEY, ""); } listen(integer chan, string name, key id, string msg) { integer index = (integer)msg; if (index >= 0) { resultOne = ""; resultTwo = ""; notecard1Query = llGetNotecardLine(NOTECARD1_NAME, index); llSay(0, "request for 1st notecard sent"); notecard2Query = llGetNotecardLine(NOTECARD2_NAME, index); llSay(0, "request for 2nd notecard sent"); } } dataserver(key query_id, string data) { if (data == EOF) return; if (query_id == notecard1Query) { llSay(0, "result for 1st notecard received"); resultOne = (string)data; } else if (query_id == notecard2Query) { llSay(0, "result for 2nd notecard received"); resultTwo = (string)data; } if (resultOne != "" && resultTwo != "") { llSay(0, resultOne + " " + resultTwo); } } } The output will be: request for 1st notecard sent request for 2nd notecard sent result for 1st notecard received result for 2nd notecard received
  13. It works like this: 1. You call llGetNotecardLine and it basically says "Ok, I will read a line from notecard, here you have an ID for this request and I will let you know when it's ready". 2. Execution of your code continues with the next line of code. 3. When your line has been read from notecard and is ready, then the dataserver event is fired. It basically says "Hey, here's the line that you requested, and gives you also the request ID." The order in which the dataserver event will be fired is probably not guaranteed in my opinion (or at least it's not a good practice to rely on it), so you might get data for second request first. If that happens, then the solution proposed by @Fenix Eldritch will not work very well. So if you need both lines at same time and order is important to you, then I propose a more robust way: key notecard1Query; key notecard2Query; string NOTECARD1_NAME = "notecard1"; string NOTECARD2_NAME = "notecard2"; string resultOne; string resultTwo; default { state_entry() { if (llGetInventoryKey(NOTECARD1_NAME) == NULL_KEY || llGetInventoryKey(NOTECARD2_NAME) == NULL_KEY) { llOwnerSay("Notecard missing"); return; } llListen(123, "", NULL_KEY, ""); } listen(integer chan, string name, key id, string msg) { integer index = (integer)msg; if (index >= 0) { resultOne = ""; resultTwo = ""; notecard1Query = llGetNotecardLine(NOTECARD1_NAME, index); notecard2Query = llGetNotecardLine(NOTECARD2_NAME, index); } } dataserver(key query_id, string data) { if (data == EOF) return; if (query_id == notecard1Query) { resultOne = (string)data; } else if (query_id == notecard2Query) { resultTwo = (string)data; } if (resultOne != "" && resultTwo != "") { llSay(0, resultOne + " " + resultTwo); } } }
  14. Maybe related to this? https://community.secondlife.com/blogs/entry/9883-second-life-simulator-update-with-script-performance-improvements/ Edit: Haha too late 😁
  15. Ok, I had a little bit of time, so inspired by @Qie Niangao a wrote a possible solution. It can really get as simple as this: key notecard1Query; key notecard2Query; string NOTECARD1_NAME = "notecard1"; // edit this to match your notecard name string NOTECARD2_NAME = "notecard2"; // edit this to match your notecard name default { state_entry() { if (llGetInventoryKey(NOTECARD1_NAME) == NULL_KEY || llGetInventoryKey(NOTECARD2_NAME) == NULL_KEY) { llOwnerSay("Notecard missing"); return; } llListen(123, "", NULL_KEY, ""); } listen(integer chan, string name, key id, string msg) { integer index = (integer)msg; if (index >= 0) { // Line numbers are counted from zero, so 1st line is 0, 2nd line is 1, ... notecard1Query = llGetNotecardLine(NOTECARD1_NAME, index); notecard2Query = llGetNotecardLine(NOTECARD2_NAME, index); } } dataserver(key query_id, string data) { if (data == EOF) return; if (query_id == notecard1Query) { llSay(0, NOTECARD1_NAME + ": " + (string)data); } else if (query_id == notecard2Query) { llSay(0, NOTECARD2_NAME + ": " + (string)data); } } } In this code I have separate notecard for each list. I don't know what you want to do exactly, so I simply output the same line for both notecards. You can of course adjust it as needed.
  16. If this is what LlGetUsedMemory returns, then that's way too much, even if you compile it to Mono. Surprises me that it even runs for a while
  17. It's difficult to say if we don't know what is behind the three dots ("...") But if there is more code, it's really possible that you have just put too much into your LSL script. I recommend checking the used memory using e.g. http://wiki.secondlife.com/wiki/LlGetUsedMemory and llGetMemoryLimit to get available memory (maybe you are also not compiling to Mono?).
  18. Getting stack heap collision most probably means that your script has run out of memory. You have probably put too many items in your list (or you have not shared the entire code with us). It is also usually a good practice to check your index before accessing a list with it. Although LSL is a pretty safe language and (usually) you will not shoot your own leg if you don't do it, adding such check really won't hurt and will make the code better. If buttonClicked was for example 0, then you will get a negative index and llList2String will not do what you wanted it to do.
  19. Indeed, it would be very cool to have real-time reflections in SL. I really don't know about the privacy thing and actually, it raises an interesting question, whether it would be against ToS to live stream SL to public. But anyway, you're welcome 🙂
  20. I know and I was not reacting to Alwin. I was talking about SL viewers and that SL viewers store passwords (or at least Firestorm) in an encrypted file.
  21. Thanks a lot for the link. I did not know I can access Jira with my username and password (just tried it), so that's very useful for me. And yes, it looks like it has been so for ~15 years and was basically accepted as a feature 🙂 Thanks.
  22. I would also recommend little bit more RAM... 8 GB might work, but if she for example wanted to do also other things on the computer while logged in SL, then more RAM will become really handy. I have 12 GB and really noticed the difference when upgraded from 8.
  23. Not sure if I am getting you, but it is possible to create a transferable object that has a "no transfer" script in it. Is that the point of your question?
  24. However I have to admit that this is also refreshing
  25. The URL can reference e.g. a HTML page that loads random image using Javascript. However keep in mind that not all residents have Shared Media enabled by default. They will have to click your prim first to see anything at all.
×
×
  • Create New...