Jump to content

Jabadahut50

Resident
  • Posts

    37
  • Joined

  • Last visited

Everything posted by Jabadahut50

  1. I am very curious about potential examples to see how these things are done. It sounds fascinating.
  2. If you're talking about the spinning crystals... llTargetOmega is your best bet... llSetPrimitiveParamsFast occasionally to resync the spin. If it was something else, you'll have to specify.
  3. Wow.... not bad at all. Blender can do all of this but is WAY fiddlier, so it's nice to have a separate piece of software that specializes it. And their free license ACTUALLY includes the availability to do commercial work with it. Throw in a fairly reasonable price that is cheaper than adobe even when you do go over that amount of revenue... this is looking like a great piece of software. Thanks for sharing!
  4. this kind of thing is also very useful for people who DO know how to write scripts but find syntax far more tedious than the drag and drop method (aka lazy people like me XD)
  5. I have almost never gotten a good script out of chat gpt and it's actually what drove me to take the time to learn how to actually script troubleshooting its hallucinated code. I found it had the tendency to make up functions and constants a lot.
  6. The easiest thing would be simply to set up a listen event and have the dancer look for a chat command, but not filter by the poster.
  7. Another update. This time I moved the Bail function into the Assume function and then split the Assume function into two separate types, allowing to individually test for type and value. Additionally, I added the ability to return instead of Bailing by setting a new parameter the BailFlag to 0 to allow for error handling instead of automatically killing the script no matter what. /*Assume and Bail Goal: Create functions and macros to enable easier debugging # Released under MIT License Copyright (c) 2023 Abel Skaeren(Jabadahut50.Resident) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef DEBUG #define DEBUG #endif //DEBUG #ifndef ASSUMEANDBAIL #define ASSUMEANDBAIL #ifdef DEBUG integer AssumeTypesCalls = 0; integer AssumeValuesCalls = 0; integer AssumeTypes(list Assume, list Test, integer BailFlag){ integer i;//for loops integer count;//for loops list types = ["Invalid","Integer","Float","String","Key","Vector","Rotation"];//Thank you to Quistess Alpha's reccomendation for simplifying the testing using this. ++AssumeTypesCalls; if(Assume != Test){ if(BailFlag == TRUE){ llOwnerSay("ERROR| Func: AssumeTypes Call " + (string)AssumeTypesCalls + ": Assume and Test are not the same length. Bailing!"); llSetScriptState(llGetScriptName(),FALSE); llSleep(0.1); }else{ llOwnerSay("ERROR| Func: AssumeTypes Call " + (string)AssumeTypesCalls + ": Assume and Test are not the same length. Returning."); return 0; } } count = llGetListLength(Test); for(i = 0; i < count; ++i){ if(llGetListEntryType(Assume, i) != llGetListEntryType(Test, i)){ if(BailFlag == TRUE){ llOwnerSay("ERROR| Func: AssumeTypes Call " + (string) AssumeTypesCalls + ": Assume[" + (string)i + "] Type " + (string)types[llGetListEntryType(Assume, i)] + " did not match Test[" + (string)i + "] Type " + (string)types[llGetListEntryType(Test,i)] + ". Bailing!"); llSetScriptState(llGetScriptName(),FALSE); llSleep(0.1); }else{ llOwnerSay("ERROR| Func: AssumeTypes Call " + (string)AssumeTypesCalls + ": Assume[" + (string)i + "] Type " + (string)types[llGetListEntryType(Assume, i)] + " did not match Test[" + (string)i + "] Type " + (string)types[llGetListEntryType(Test,i)] + ". Returning."); return 0; } } } llOwnerSay("SUCCESS| Func: AssumeTypes Call " + (string)AssumeTypesCalls + ": Assume and Test share all types. Returning."); return 1; } integer AssumeValues(list Assume, list Test, integer BailFlag){ integer i; integer count; ++AssumeValuesCalls; if(Assume != Test){ if(BailFlag == TRUE){ llOwnerSay("ERROR| Func: AssumeValues Call " + (string)AssumeValuesCalls + ": Assume and Test are not the same length. Bailing!"); llSetScriptState(llGetScriptName(),FALSE); llSleep(0.1); }else{ llOwnerSay("ERROR| Func: AssumeValues Call " + (string)AssumeValuesCalls + ": Assume and Test are not the same length. Returning!"); return 0; } }else{ count = llGetListLength(Assume); for(i = 0; i < count; ++i){ if((string)Assume[i] != (string)Test[i]){ if(BailFlag == TRUE){ llOwnerSay("ERROR| Func: AssumeValues Call " + (string)AssumeValuesCalls + ": Assume[" + (string)i + "] Value: " + (string)Assume[i] + " did not match Test[" + (string)i + "] Value: " + (string)Test[i] + ". Bailing!"); llSetScriptState(llGetScriptName(),FALSE); llSleep(0.1); }else{ llOwnerSay("ERROR| Func: AssumeValues Call " + (string)AssumeValuesCalls + ": Assume[" + (string)i + "] Value: " + (string)Assume[i] + " did not match Test[" + (string)i + "] Value: " + (string)Test[i] + ". Returning."); return 0; } } } } llOwnerSay("SUCCESS| Func: AssumeValues Call " + (string)AssumeValuesCalls + ": Assume and Test Values all equal. Returning."); return 1; } #else #define AssumeType(x,y) /* Removed by #undef DEBUG */ #define AssumeValue(x,y) /* Removed by #undef DEBUG */ #endif //DEBUG #endif //ASSUMEANDBAIL default { touch(integer num_detected) { integer i; //Passes and returns i = AssumeTypes([1,2,3],[1,2,3],0); //Fails and returns i = AssumeTypes([1,"2",3],[1,2,3],0); //Passes and returns i = AssumeValues([1,2,3],[1,2,3],0); //Fails and Bails. i = AssumeValues([1,2.1,3],[1,2,3],1); } }
  8. Sounds like they're talking about on the fly AO baking or maybe on upload AO map generation of some kind. It'd be a nice feature to be able to generate for a mesh on upload and then let people tick on option on a mesh during building so that you can have the mesh override the one in a material, so materials can be more portable between objects. So long as it's not the only method, and we can still make the ones in the GLTF at our discretion to maintain artistic vision.
  9. Just had a thought today. If we are getting rid of 32 bit viewer support and switching exclusively to 64 bit. Is LL going to go back in and solve tech debt based around 32 bit limitations and do the same with the servers? Are we going to get better rendering and building capabilities above 4000 m? Are we going to get 64 bit LSL variables? Somehow I doubt it, but it'd be great if they did.
  10. Won't let me edit the original again, so posting new modification here. This version makes Bail into a function and automatically removes it when you use #undefine DEBUG in your script, so you no longer need to put your Bail = Assume(); and following if statement into an #ifdef DEBUG block. The Preprocessor will simply automatically remove the new function for you. /*Assume and Bail Goal: Create functions and macros to enable easier debugging # Released under MIT License Copyright (c) 2023 Abel Skaeren(Jabadahut50.Resident) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef DEBUG #define DEBUG #endif //DEBUG #ifndef ASSUMEANDBAIL #define ASSUMEANDBAIL #ifdef DEBUG integer AssumeCalls = 0; integer Assume(list input, list test){//test to make sure the input is what you are expecting it to be. integer i; //for the loops ++AssumeCalls; //for tracking which assume call triggered the Bail. list TYPES = ["invalid","integer","float","string","key","vector","rotation"];//Thank you to Quistess Alpha's reccomendation for simplifying the testing using this. //test first to make sure there lengths are the same if(input != test){ llOwnerSay("ERROR| Func: Assume Call " + (string)AssumeCalls + ", Input and Test lists not the same length, Bailing!"); return 0; }else{ for(i = 0; i <= llGetListLength(input); ++i){ if(llGetListEntryType(input, i) != llGetListEntryType(test, i)){ llOwnerSay("ERROR| Func: Assume Call " + (string)AssumeCalls + ", Input[" + (string)i + "] did not match type to Test[" + (string)i + "]"); llOwnerSay("ERROR| Func: Assume Call " + (string)AssumeCalls + ", Input[" + (string)i + "] was " + llList2String(TYPES,llGetListEntryType(input, i)) + "."); llOwnerSay("ERROR| Func: Assume Call " + (string)AssumeCalls + ", expected " + (string)TYPES[llGetListEntryType(test, i)] + ". Bailing!"); return 0; } } for(i = 0; i<= llGetListLength(input); ++i){ if((string)input[i] != (string)test[i]){ llOwnerSay("ERROR| Func: Assume Call " + (string)AssumeCalls + ", Input[" + (string)i + "]: " + (string)input[i] + " did not match Test[" + (string)i + "]: " + (string)test[i] + ". Bailing!"); return 0; } } } llOwnerSay("Succes| Func: Assume Call " + (string)AssumeCalls + ", Complete. " + llList2CSV(input) + " matched test. Proceeding."); return 1; } Bail(list input, list test){ integer Bail; Bail = Assume(input, test); if(Bail == FALSE){ llSetScriptState(llGetScriptName(), FALSE); llSleep(0.1); } } #else #define Bail(x,y) /* Removed by #undef DEBUG */ #endif //DEBUG #endif //ASSUMEANDBAIL default{ state_entry(){ llOwnerSay("click to test"); } touch(integer num_detected){ /*will pass as written. Must include ()'s around lists not passed as variables in order to satisfy #undefine macro */ Bail(([1,2.5,"Wohoo"]),([1,2.5,"Wohoo"])); //will fail due to Element[3] not matching Bail(([1,2.5,"woohoo"]),([1,2.5,"wohoo"])); // will fail for different list lengths Bail(([1,2.5]),([1,2.5,"wohoo"])); //will fail for Element[1] bieng different types Bail(([1,2.5,"Wohoo"]),([1.0,2.5,"Wohoo"])); } }
  11. Excellent suggestions, will defiantly update the code when I can. The efficiency is less important to me on this script because it's only going to be used (by me at least) during debugging. When I go to make the script efficient and fast for publishing after getting it to work, I'll #undefine DEBUG removing all of this anyway. I've never personally used JSON_ARRAY's yet (I only started coding in LSL about a month ago) but feel free to modify for your uses if it helps ^.^
  12. Having gone to the link and read the script, very basically it contacts AccuWeather once an hour and changes between 32 different environment settings in order to match the weather AccuWeather reports to it.
  13. A simple little function I whipped up to aid in debugging. To use, you would call Bail = Assume() before and/or after another function that manipulates data to test to see if the data going in or out is what you expect it to be. If not, Bail becomes set to 0 and a simple if statement with llSetScriptState(llGetScriptName(),FALSE); llSleep(0.1); will stop the script. As you can probably tell, I wrote this using the Firestorm Preprocessor, since I plan to use it frequently in debugging my scripts. I'll hop back on here later and leave a more conventional copy/paste version for people who prefer not to use the Preprocessor. EDIT: Updated code to include Quistess Alpha's recommendations, as well as a new call counter to aid in finding which exact call of Assume(); in your script caused a bail. Additionally, added some very basic example codes. /*Assume and Bail Goal: Create functions and macros to enable easier debugging # Released under MIT License Copyright (c) 2023 Abel Skaeren(Jabadahut50.Resident) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef DEBUG #define DEBUG #endif //DEBUG #ifdef DEBUG #ifndef ASSUMEANDBAIL #define ASSUMEANDBAIL integer Bail;//Global variable for bailing integer AssumeCalls = 0; integer Assume(list input, list test){//test to make sure the input is what you are expecting it to be. integer i; //for the loops ++AssumeCalls; //for tracking which assume call triggered the Bail. list TYPES = ["invalid","integer","float","key","string","vector","rotation"];//Thank you to Quistess Alpha's reccomendation for simplifying the testing using this. //test first to make sure there lengths are the same if(input != test){ llOwnerSay("ERROR| Func: Assume Call " + (string)AssumeCalls + ", Input and Test lists not the same length, Bailing!"); return 0; }else{ //test to make sure the inputs share types for(i = 0; i <= llGetListLength(input); ++i){ if(llGetListEntryType(input, i) != llGetListEntryType(test, i)){ llOwnerSay("ERROR| Func: Assume Call " + (string)AssumeCalls + ", Input[" + (string)i + "] did not match type to Test[" + (string)i + "]"); llOwnerSay("ERROR| Func: Assume Call " + (string)AssumeCalls + ", Input[" + (string)i + "] was " + llList2String(TYPES,llGetListEntryType(input, i)) + "."); llOwnerSay("ERROR| Func: Assume Call " + (string)AssumeCalls + ", expected " + (string)TYPES[llGetListEntryType(test, i)] + ". Bailing!"); return 0; } } //finally, test to make sure the input actually matches for(i = 0; i<= llGetListLength(input); ++i){ if((string)input[i] != (string)test[i]){ llOwnerSay("ERROR| Func: Assume Call " + (string)AssumeCalls + ", Input[" + (string)i + "]: " + (string)input[i] + " did not match Test[" + (string)i + "]: " + (string)test[i] + ". Bailing!"); return 0; } } } llOwnerSay("Succes| Func: Assume Call " + (string)AssumeCalls + ", Complete. " + llList2CSV(input) + " matched test. Proceeding."); return 1; } #endif //ASSUMEANDBAIL #endif //DEBUG default{ state_entry(){ llOwnerSay("click to test"); } touch(integer num_detected){ //will pass as written Bail = Assume([1,2.5,"Wohoo"],[1,2.5,"Wohoo"]); if(Bail == FALSE){ llSetScriptState(llGetScriptName(), FALSE); llSleep(0.1); } //will fail due to Element[3] not matching Bail = Assume([1,2.5,"woohoo"],[1,2.5,"wohoo"]); if(Bail == FALSE){ llSetScriptState(llGetScriptName(), FALSE); llSleep(0.1); } // will fail for different list lengths Bail = Assume([1,2.5],[1,2.5,"wohoo"]); if(Bail == FALSE){ llSetScriptState(llGetScriptName(), FALSE); llSleep(0.1); } //will fail for Element[1] bieng different types Bail = Assume([1,2.5,"Wohoo"],[1.0,2.5,"Wohoo"]); if(Bail== FALSE){ llSetScriptState(llGetScriptName(), FALSE); llSleep(0.1); } } }
  14. The GLTF standard is mostly about asset portability. How your engine interprets said assets is up to you... to an extent... I think it does define some specific requirements TBF, so It is still up in the air, but separating texture channels and manipulating them is trivial nowadays, so I'd imagine this wouldn't be too hard. I suppose we'll wait and see.
  15. Yeah, been watching that post. LSL is such a strange place that creates fascinating solutions.
  16. This made me think of my TI-86, and now I'm wondering if the newer CX CAS's have gotten powerful enough that one could hack Linux and SL onto it XD.
  17. Wow... the quality difference between those two pictures really shows a dramatic difference. I support this idea.
  18. The first mainstream 64-bit processors came out in 2003. It has been 20 years since their introduction. Operating systems themselves are ditching 32 bit support and given the security concerns of running old OS's it is a matter of time for anyone running a PC at home to run anything other than a 64 bit machine if they aren't already there. I can't see this switch being a negative for many if anyone to be honest. The vast majority of the computing world expects 64 bit performance. It will be nice to finally move forward from the anchor of the purely 32 bit world.
  19. One place where rotations are helpful is pulling data out of a list. You can pull multiple pieces of int or float data at once, which is a bit faster than pulling them to integers one by one. I created an integer accumulator adder that increments 8 different int variables in a loop 126 times then sums them afterward, averaging 0.004856s. I did the same thing then but pulled the initial 0 value from a list and that averaged 0.007483s Finally, I made a version that first pulled the data from the list using rotations and then assigned the parts of the rotations to integers. This averaged 0.006778s. It's not a ton faster than individual assignments, but it is still faster. I imagine as scripts get more complex and scale, it may make a small difference in the final result. Food for thought.
  20. I actually ran some speed tests on this idea, and doing it the way you show here is actually about twice as slow as just using regular integers to do this. I haven't yet tested float speed compared to this, but I imagine the speed differences will be similar. This tells me LSL Mono doesn't really have anything to accelerate these under the hood like I had wanted with the original request idea.
  21. Been pretty busy lately and as such was unable to get back to fixing my feature request before it was closed on the JIRA. I may submit a new idea similar based off the insights offered by others in this thread but atm I have other issues irl to take care of. Thank you everyone who pitched in constructive criticism.
  22. bit of a necro but if the viewer can see it, couldn't you add a feature to a viewer that when it receives a specific chat command on a specific channel it could spit out the info on that channel? Kind of like llListen but have the viewer watching that chat channel and then take the command let's say something like /4658 animinfo, "*insert animation name here or UUID of animation*", "*insert UUID of object you own to look for animation in or leave blank to have it search your inventory*" It could then search through the object/your inventory and get the animation's info and spit it out in the chat channel in some easy to parse way... perhaps 4,28.60,0.60,0.60,Yes,19 (in the case of the one shown at the top of this thread)? Or would this fall under "Impacts the shared experience!" issue and would cause the viewer to be banned by LL?
  23. I gotta head to bed (3rd shifter and gotta work tonight) but do you mind if I rewrite my jira submission more around your suggestion (crediting you of course) or would you rather make the jira suggestion?
  24. This is a much more elegant solution than my suggestion actually. A strided list with known built in SIMD optimizations under the hood (as long as we can get all the operations and not JUST those mentioned in the liststatistics method) would better fit the overall nature of the LSL language while still getting the result I was looking for with my suggestion.
  25. a few examples off the top of my head: checking multiple binary flags at once with bitwise instructions large math sums of long lists speeding up bitwise XOR hashing To each there own but I feel anywhere where you can break dependency chains and need to do the same thing on several different bits of data at once it can provide quite the boost. It's admittedly considered to many a form of late stage development optimization by many in other development environments by many coders but I feel if you code with it in mind it can provide significant performance boosts for where it is useful. There are plenty of built in LSL functions that do niche things but when used properly can provide increase performance.
×
×
  • Create New...