Jump to content

Wulfie Reanimator

Resident
  • Posts

    3,963
  • Joined

  • Last visited

Posts posted by Wulfie Reanimator

  1. 10 hours ago, Madelaine McMasters said:

    Niceties like libraries and #include are outside the scope of what's possible through translation.

    11 hours ago, Testicular Slingshot said:

    new abstractions to LSL like classes, dictionaries, switch statements, and shortcuts for tedious code.

    It's worth mentioning that Firestorm's Preprocessor already does these things to some extent.

    You can #include external files and #define constants/macros. It enables switch-statements, list[index] style access, magic constants (like current line), and other things.

    https://wiki.firestormviewer.org/phoenix:lsl_preprocessor

    46 minutes ago, Profaitchikenz Haiku said:

    What think you could consider implementing is something like a preprocessor to take a switch-case construct and produce a set of if-else statements.

    The current preprocessor generates jumps in order to support fall-through. 🙂

    • Like 3
    • Thanks 1
  2. On 10/19/2021 at 7:32 PM, Blip Mumfuzz said:

    Has the quality of the light changed with EEP?   I can't seem to get certain effects like a nice orange glow along the edges of grass that I used to be able to using WL.  And the colors everywhere seem more muted.  It is totally frustrating.  

    Certain effects did change with EEP.

  3. The only problem I have with [insert operating system] is the public testing period that's gonna last a couple years after release. I have enough headaches with my current systems, I'll move over after the biggest ones are already fixed on the next one.

    • Like 2
  4. 1 hour ago, Malikharper said:

    A. How the payload of animation/script get delivered? Where is it stored?
    B. When you accept an invitation, how are permissions established for what the script is allowed to do.

    The permission is stored into the script that requested permission with llRequestPermissions. The animation is started with llStartAnimation.

    1 hour ago, Malikharper said:

    C. How long are permissions granted? How do you revoke them?

    Permanently (unless the script makes another permission request). You can't revoke them if the script doesn't currently exist in the same sim as you.

    1 hour ago, Malikharper said:

    D. How can you identify who currently has access to "inject" command or  execute a script  associated with your avatar?

    You can't. There may be hundreds, if not tens of thousands of scripts holding permission on your avatar right now. (Any furniture you've ever sat on, for example.) Many of those scripts won't even exist in-world, just stored in someone's inventory, possibly with further copies made of them.

  5. 3 hours ago, Quistess Alpha said:

    I'm really surprised there's no general consensus on texture HUDs like there is for say sitting scripts and AVsitter.

    Omega, kind of?

    The problem with "texture changers" vs AV Sitter is that one is inherently more complicated than the other as far as assumptions about the environment goes. As long as the build has enough links for sit targets, you can write a general set of scripts to handle 98% of use-cases. Changing textures though... that gets out of hand very fast. There are a lot of parameters per face, and there can be a lot of faces on an object.

    • Like 1
  6. 5 hours ago, NonchalantxAce said:

    Hi, I’m new to second life and I would like to know if there’s a guide somewhere with getting started in second life.

    Here's an official "getting started" article:

    If you're asking for mesh specifically, since you poted in the mesh section, there's this, assuming you at least know how to make models:

     

  7. 12 hours ago, KT Kingsley said:

    Can it ever be more efficient to change everything and then unchange the things you didn't really want to change?

    Depends what kind of efficiency you're looking for.

    From the script's point of view, obviously it would be more memory-efficient to change everything to the same thing and then replace a couple pieces, assuming that the replacements are fewer than the rest. It may even be faster within the script to do that if you're building the list(s) at runtime.

    Whether that holds true on the server/viewer side when the call is made may be a different answer.

    • Like 1
    • Thanks 1
  8. 3 hours ago, Taliro said:

    If I get it right, its useful for sl owners who dont own an external web server and just for projecting data in their internet browser? 

    No. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type

    Content-type tells the receiver what kind of data was sent. It may be ignored, but often it affects how the data is handled. For example, a request sent to a server may be completely ignored (or responded with an error) if it's the wrong type of content. Your browser displaying things differently is just one aspect of that behavior.

    • Like 1
  9. 16 minutes ago, Diamond Puddles said:

    In this case sensor is bad voodoo for what I need it for!

    What do you need this for?

    Some more context might help us understand the problem and suggest solutions.

    • Thanks 1
  10. On 9/24/2021 at 12:09 PM, Jaylinbridges said:

    If you add at least one name (any resident) to your parcel ban list, then you can not see another avatar when you are over 50 meters away and both avatars are on the SAME parcel.  This was tested only on a Bellisseria 1024 sqm parcel.  On larger parcels the visibility distance increases.  I think this is a long term bug (or undocumented feature).  But someone can hover like 51 meters higher than you with parcel privacy turned on, and you cannot see them and they cannot see you, if there is at least one banned name in the parcel ban list.  

    For example, if my Alt is at 21 meters elevation, on the ground, then he will turn invisible when I fly to a height of 72 meters above him on the parcel.

    That is what I meant by "same section of the same parcel."

  11. 2 hours ago, MillyWH said:

    You can set your land so people can't see you on your land which means they can't see you if you are naked or fully dressed. That's the easiest way to solve your issue. It doesn't matter how close they are or if they cam into your house they can't see you.

    Parcel Privacy only prevents people from seeing you if they are either not on your parcel, or on the other side of the banlines within your parcel.

    If they're in the same section of the same parcel, they can see your avatar despite that setting.

  12. FYI, an avatar that is sitting on an object can be moved up to 2000 meters away from the root using functions like llSetLinkPrimitiveParamsFast and PRIM_POS_LOCAL.

    llUnsit doesn't require any permissions either. All it requires is:

    1. The agent is sitting on the scripted object, or
    2. The agent is over land owned by the scripted object's owner and/or a group the owner has land rights for.
    • Like 1
  13. 16 hours ago, LoneWolfiNTj said:

    Ok, that works, but I figured I'd get it down from 4 lines to 2 by using a ternary operator:

    text()
    {
        string sta_str = "Status: " + (status?"On":"Off");
        llSetText(sta_str, <0.0,1.0,0.0>, 1.0);
    }

    But alas that gave "syntax error". No ternary ("a?b:c") operator in LSL, alas. Too bad, because many other languages (C, C++, Perl, etc) have it and it's very useful.

    So, is there any other similar feature? Or are with stuck with if / else?

    There is no ternary operator in LSL, but if you want to avoid repetition, you could do some dumb list trickery.

    string sta_str = "Status: " + llList2String(["Off", "On"], status);

     

    • Like 2
  14. 7 hours ago, portexploits said:

    Thanks, that's great. I see a major difference in how you're iterating the SetVelocity(vector, int). You're using a loop, I was doing it in a timer. So how would I break out of the loop to stop it? I know a trick to do it, but if you have a suggestion on how to do so, I am open ears.

    One way is to check for some kind of external factor in the loop-condition, such as the name/color of an object, which would be changed by a separate script that isn't stuck in a loop.

  15. Assuming some things about the build itself, things can be pretty simple.

    As long as your buttons are "together" in the linkset, as in linked sequentially, you can have all the button-states in a list and use very simple math (like.. subtraction) to figure out which button is being pressed.

    list buttons = [1, 1, 1, 1, 1];
    integer button_count = 5;
    integer first_button = 2;
    
    default
    {
        touch_start(integer n)
        {
            integer link = llDetectedLinkNumber(0);
            integer active = link - first_button;
    
            // If the touched button isn't actually a button, ignore this event.
            if (active < 0 || button_count <= active) return;
    
            // If this button is available...
            if (llList2Integer(buttons, active))
            {
                // Turn it off.
                buttons = llListReplaceList(buttons, [0], active, active);
            }
        }
    }

    And from there you can figure out how you want to re-enable the buttons. The simplest thing would be to use a timer to enable all of the buttons at once, but that's not very convenient. What I would do is have a similar list for timestamps, so that each button would have its own delay.

    Below is full example with color-changing buttons to indicate which one is available (white) or disabled (yellow).

    list timers  = [0, 0, 0, 0, 0];
    float delay = 10;
    
    list buttons = [1, 1, 1, 1, 1];
    integer button_count = 5;
    integer first_button = 2;
    
    default
    {
        state_entry()
        {
            llSetTimerEvent(5);
            llSetLinkPrimitiveParamsFast(LINK_SET, [
                PRIM_COLOR, ALL_SIDES, <1,1,1>, 1,
                PRIM_LINK_TARGET, LINK_ROOT,
                PRIM_COLOR, ALL_SIDES, <0.1, 0.1, 0.1>, 1
            ]);
        }
    
        touch_start(integer n)
        {
            integer link = llDetectedLinkNumber(0);
            integer active = link - first_button;
    
            // If the touched button isn't actually a button, ignore this event.
            if (active < 0 || button_count <= active) return;
    
            // If this button is available...
            if (llList2Integer(buttons, active))
            {
                // Turn it off and record time.
                buttons = llListReplaceList(buttons, [0], active, active);
                timers = llListReplaceList(timers, [llGetTime()], active, active);
                llSetLinkColor(link, <1,1,0>, ALL_SIDES);
            }
        }
    
        timer()
        {
            float time_now = llGetTime();
    
            integer i;
            while (i < button_count)
            {
                float last_active = llList2Float(timers, i);
                // Non-zero value is assumed to be a timestamp.
                if (last_active > 0 && time_now > last_active + delay)
                {
                    buttons = llListReplaceList(buttons, [1], i, i);
                    timers = llListReplaceList(timers, [0], i, i);
                    llSetLinkColor(first_button + i, <1,1,1>, ALL_SIDES);
                }
                ++i;
            }
        }
    }

    Looks something like this.

    • Like 2
  16. 30 minutes ago, Profaitchikenz Haiku said:

    I think the question was referring to the older wiki (non-SL) which had a list of library functions, then another list of areas of activity with the corresponding library function against it. The intention seemed to be "I want to do A,B & C to JKM", "Oh right, you want llDoABCtoJKM"

    The particular wiki has been gone for ages now but as I recall it only listed user-written library functions, not the Linden ones.

    http://wiki.secondlife.com/wiki/Category:LSL_User-Defined_Functions
    (And from that page) http://wiki.secondlife.com/wiki/Combined_Library

    It could also be that @John445 Bachman is simply asking for a list of all the built-in commands with a short plain-English description of what it does.

    • Like 1
  17. 1 hour ago, Profaitchikenz Haiku said:

    Are they faster just because they're a quarter the size of Mono? Or is there some other aspect to the way Mono scripts are loaded that is the reason?

    There is a distinct difference in the way LSO and Mono scripts are handled.

    LSO scripts will always take up 16KB memory.. even if there are no variables or events. They are always allocated the full 16KB of memory.

    Mono scripts have dynamic memory. While the maximum memory capacity is 64KB, the script will only take up a fraction of that in most cases.

    This is significant when a script needs to be transferred from one sim to the next. To do that, the current sim needs to figure out the current size of a script so that it can be stored for transfer (don't forget bytecode sharing, heap/stack memory). For LSO scripts, it's very easy since they're always guaranteed to be exactly 16KB. The destination sim suffers even more since they have to receive that information, allocate the space, and then initialize those scripts. Mono scripts are very slow to initialize and start up compared to LSO and it can be easily observed in your day-to-day interaction with scripts.

    1 hour ago, Profaitchikenz Haiku said:

    It seems to me that the need for larger scripts (and I accept there is a case for wanting more memory) is mostly for storing data, and in this case, perhaps there could be a more efficient way of storing data?

    No, there are quite a few things that are memory intensive without doing any long-term storage. HTTP requests, large llSetLinkPrimitiveParamsFast calls, multiple raycasts (I'm sure @animats's NPCs would benefit from more memory), general data processing, etc.

    • Thanks 1
×
×
  • Create New...