Jump to content

Dora Gustafson

Advisor
  • Content Count

    2,120
  • Joined

  • Last visited

Everything posted by Dora Gustafson

  1. We have a vehicle flag: VEHICLE_FLAG_NO_DEFLECTION_UP This may or may not be what you are looking for
  2. This has not been suggested yet: string truncate_float_decimals( float x, integer n) { string s = (string)x; integer i = llSubStringIndex( s, "."); return llGetSubString( s, 0, i-1)+llGetSubString( s, i, i+n); } It is straight forward In this form it doesn't work with scientific notation and it does not round but it is simple and can easily be modified for special needs This code is not tested but the principle is
  3. JSON in LSL is slow compared to a similar task solved the traditional way with lists Avoid using JSON it in time critical applications Use JSON for complex list arrays when the execution time is not critical
  4. llMessageLinked is the way to go. Just be aware there is nothing secret about it. A script in the same prim that has the destination script can pick up the full message including prim number, number, message and key
  5. I may be wrong but in my book the script is running in an event handler and the event handle will be busy until the loop is finished. Thus it will stop other events while running and the event queue will build up. Virtually this is what the llSleep() does but in so many more words
  6. Just a matter of taste. Think of the definition: The statement after the "if clause" is executed if the clause is true AND this statement can be a simple statement or a compound statement. Where a compound statement is a compound of statements inside curly brackets
  7. Texture animations are by nature not synchronized, but if they are loaded to the viewer at the same time they are. For instance if you tp to a site and can see all the animated faces they will most likely be in sync The chance for sync is even better if all faces use the same texture (it is only loaded one time) :smileysurprised::smileyvery-happy:
  8. You don't want a script for that Simple, basic animations and other animations that do not animate at least neck and scull bones does exactly what you want, or rather the viewer does it for you. Use mouse cursor and keys: 'Alt Gr' + 'left mouse' to 'look' at an object/avatar and your avatar will keep looking at that object/avatar when it moves around :smileysurprised::smileyvery-happy:
  9. An object is either one prim or a link-set So a non-linked object must be one prim which is best resized in the viewer's editor Did you mean coalesced objects?
  10. I have a feeling you are complicating things unnecessarily If you make your orbiting object symmetrical to the center of the sphere and keeping only part of it visible, you can apply llTargetOmega() llTargetOmega() is easy, smooth and low lag :smileysurprised::smileyvery-happy:
  11. Notice the limit is just for channel zero, the public channel This is bad enough if you use it for debug messages to yourself, but you don't have to For debugging llOwnerSay() is much better, it has no throttle :smileysurprised::smileyvery-happy:
  12. If it is copy you could just rez another. That's what you usually do when copies are 'stolen' or lost somehow :smileysurprised::smileyvery-happy:
  13. Yes that is a miracle. The conditions for llAxes2Rot() are not fullfilled: "All three vectors must be mutually orthogonal unit vectors." It can not work on attachments as metioned bye Qui :smileysurprised::smileyvery-happy:
  14. I still don't understand rotations/quarternions fully and don't expect I ever will, but I have learned the mathematical rules and I have worked a lot with them Now I can do most things I want with rotations even though sometimes I need to rewrite several times before I get it right:smileyembarrassed: My advise is: Work with it, read examples an make them work, give yourself problems and solve them It takes time but there is no shortcut for normal people :smileysurprised::smileyvery-happy:
  15. Or it could detach the moment it hears the word. Only one attachment would remain. If it is the one attached to the skull is another question:smileyhappy: :smileysurprised::smileyvery-happy:
  16. It is not clear to me if the teleporter goes back to start after use IF it does AND the old warp hack is used it may get caught over a parcel that do not allow object entry Solution: Replace warp with the modern llSetRegionPosition :smileysurprised::smileyvery-happy:
  17. Bit flag parameters are used in many LSL functions and not in a small way llTakeControls() and control llRequestPermissions() and run_time_permissions llGetInventoryPermMask and llGetObjectPermMask() Masks in llParticleSystem() llSetVehicleFlags and llRemoveVehicleFlags I will not list them all These examples shows what bit flags are good at: Marking and unmarking mutual independent cases :smileysurprised::smileyvery-happy:
  18. Using each bit in an integer gives you 32 Booleans which is 32 times more dense than one Boolean per integer. One Boolean per integer is standard in LSL. It can be TRUE or FALSE. But maybe that is what you are saying, I'm not sure :smileysurprised::smileyvery-happy:
  19. Bit flags are useful but why restrict the use to the Exclusive OR function when we have the full register? // bit logic by Dora Gustafson, Studio Dora 2016integer bits; // contains flags 0 thru 31integer flag( integer x){ return 1<<x & bits;}setflag( integer x){ bits = 1<<x | bits;}clrflag( integer x){ bits = ~( 1<<x) & bits;}eorflag( integer x){ bits = 1<<x ^ bits;}showbits(){ string s; integer i = 32; while ( i-- ) if ( flag( i)) s+="1"; else s+="0"; llOwnerSay( s);}default{ state_entry() { showbits(); setflag( 0); setflag( 3); setflag( 4); showbits(); clrflag( 2); clrflag( 3); eorflag( 4); eorflag( 5); setflag( 31); showbits(); }}/*Test output: 00000000000000000000000000000000Test output: 00000000000000000000000000011001Test output: 10000000000000000000000000100001*/ I use bit flags regular but never in a convoluted form like this, rather as in-line code :smileysurprised::smileyvery-happy:
  20. I still use RPN and will to the day I die. Not so much on original calculators. Much more in apps that runs on PC, tablet and smart phone. In those apps the original Hewlett-Packard code lives on. Really, I would feel lost without it. :smileysurprised::smileyvery-happy:
  21. Madelaine McMasters wrote: Rolig Loon wrote: reverse Poilish notation When I encounter a calculator with an = key, I feel like tearing my hair out. Is there any calculator but a RPN calculator ???
  22.  "exponent" and "magnitude" triggered me:smileywink: Or exponent and mantissa. Give me back the slide rule, no batteries, readable everywhere and not controlled by Google or Microsoft :smileysurprised::smileyvery-happy:
  23. The decimal digits after the decimal point are called decimals, no? :smileysurprised::smileyvery-happy:
  24. float a = 1.2345678E38;float b = 0.0;float c = 1.2345678e-8;string fixedPrecision(float input, integer precision){ if((precision = (precision - 7 - (precision < 1))) & 0x80000000) return llGetSubString((string)input, 0, precision); return (string)input;}default{ state_entry() { llOwnerSay( "a = "+fixedPrecision( a, 3)+" b = "+fixedPrecision( b, 3)+" c = "+fixedPrecision( c, 3)); }}/* Output: a = 123456800000000000000000000000000000000.000 b = 0.000 c = 0.000*/ I had to do this to figure out what might be the meaning of the word 'precision'. The output indicates that precision is used for the number of decimal digits after the decimal point. In my vocabulary a is presented with seven digits precision while c is presented with zero digits precision. After all this routine is very useful for numbers with absolute values not too big and not too small and zero :smileysurprised::smileyvery-happy:
  25. You are right, my mistake Still it is a bit in sane to keep digits after the point that carry no value and to round small numbers to zero float a = 1E38;float b = 0.0;float c = 1e-8;default{ state_entry() { llOwnerSay( "a = "+(string)a+" b = "+(string)b+" c = "+(string)c); }}/*Output a = 100000000000000000000000000000000000000.000000 b = 0.000000 c = 0.000000*/ :smileysurprised::smileyvery-happy:
×
×
  • Create New...