Jump to content

Isobeast

Resident
  • Posts

    68
  • Joined

  • Last visited

Posts posted by Isobeast

  1. Hey! how to make so that snow or rain particles do not pass through the roof of the house?

     

    I will add. You can, of course, just install the emitter at a sufficient distance, but I came across some overlays that do not allow particles to pass ... (or it seemed to me...)

     

     

    is it generally possible and I'm wondering how it works?

  2. 17 hours ago, Quistess Alpha said:

    It would be nice if it could do that, in a sort of naturalistic thinking it would make sense if it could do that, but the reality is sometimes LSL just can't do things that would "make sense" from a physical understanding of objects and actions. the changed event does not provide a key for who or what caused the change, all you know is that the change happened, and roughly what the change is.

    one way to get the person's name would be to have them need to touch the object (from which you could easily get their key and profile link) before it allows them to drop in a notecard. This would only be appropriate for a low-traffic situation though (if there is a reasonable probability that multiple people could want to use the dropbox at once, the other suggestions of finding the notecard creator's info might work)

     

    14 hours ago, Qie Niangao said:

    Here's a kind of sample sketch of a script in case it gives some hints about the housekeeping involved in recognizing what new notecard was dropped. It uses llGetInventoryCreator() as a placeholder, but I think @Quistess Alpha's suggestion to toggle into the llAllowInventoryDrop state, recording the key of the toucher, is probably better (although there's still no guarantee nobody snuck in and dropped inventory on somebody else's touch).

    
    list inventoryNotecards;
    
    list getCurrentNotecards()
    {
        list ncList;
        integer ncIdx = llGetInventoryNumber(INVENTORY_NOTECARD);
        while (0 <= --ncIdx)
            ncList += llGetInventoryName(INVENTORY_NOTECARD, ncIdx);
        return ncList;
    }
    
    default
    {
        state_entry()
        {
            inventoryNotecards = getCurrentNotecards();
            llAllowInventoryDrop(TRUE);
            llOwnerSay("starting with notecards in inventory:\n\t"+llDumpList2String(inventoryNotecards, "\n\t"));
        }
        changed(integer mask)
        {
            if (mask & CHANGED_ALLOWED_DROP)    // this event only fires if SOMEBODY WITHOUT OBJECT PERMS dropped in new inventory
            {
                list newInvNCs = getCurrentNotecards();
                // both lists should be sorted alphabetically; look for first new card (if any, but may be many)
                string foundNC = "";
                string testNC;
                integer ncIdx = llGetListLength(newInvNCs);
                while (("" == foundNC) && (0 <= --ncIdx))
                    if (llList2String(inventoryNotecards, ncIdx) != (testNC = llList2String(newInvNCs, ncIdx)))
                        foundNC = testNC;
                if ("" == foundNC)
                    llOwnerSay("no new notecard found from inventory drop, so must have added a non-notecard item");
                else
                {
                    llWhisper(0, "Thank you for submitting your notecard!");    // but won't hear this if they cammed-in from afar
                    key id = llGetInventoryCreator(foundNC);
                    llInstantMessage(llGetOwner(), "You've got mail created by secondlife:///app/agent/" + (string)id + "/inspect");
                    // That's pretty when received in-world (chat or IM) but hideous if the IM goes to email, 
                    // so if that's a concern may want to use ugly old username or something instead
                    inventoryNotecards = newInvNCs;
                }
            }
            else
            if (mask & CHANGED_INVENTORY)   // somebody WITH object perms added or removed inventory
                inventoryNotecards = getCurrentNotecards();
        }
    }

    Please note that the control-drag-and-drop gesture is unfamiliar enough that folks may accidentally stuff all kinds of transferable crud into the dropbox, This little script does nothing to protect itself from getting too many notecard names to fit in memory, but worse, you may get a frantic IM from somebody who lost their entire prized gacha collection to your dropbox.

    Thank you so much!

    @Qie Niangao Thank you for sharing such a great script, it is very kind of you! I am sure it will be useful not only for me, but also for many.

    • Like 1
  3. 1 hour ago, Qie Niangao said:

    Certainly llDetectedKey() won't work in a changed() event. The best that comes to mind is llGetInventoryCreator() for whichever notecard was deposited (and some recordkeeping of which notecards come and go). It's not great, though, because the notecard may be created by somebody different and then edited by the depositor before being dropped into inventory.

    Thanks a lot! It still can't show the avatar name as a profile link and give the name of the first item in the inventory I guess, so if I use INVENTORY_ALL , it shows my name as the script creator. I think I'm doing something stupid as always. XD

        changed(integer mask)
        {
            if (mask & (CHANGED_ALLOWED_DROP | CHANGED_INVENTORY))
                llWhisper(0, "Thank you for submitting your notecard!");
                llRequestAgentData(llGetInventoryCreator(llGetInventoryName( INVENTORY_ALL, 0)),DATA_NAME);
        }
        
        dataserver(key qid, string data)
        {
            llInstantMessage(llGetOwner(), "You've got mail from " + data);
        }

     

  4. 8 minutes ago, Coffee Pancake said:

    Thanks for the link! I've read, even tried examples, but I haven't found how to find out the sender's name.

    Perhaps the sender's name should be in the header or in the card itself? in addition, I would like it to work not only from the note card, but also from any other dropped object, so I'm wondering if it is possible to find out the link to the sender's profile, that is, the owner of the object that sent it, which kind of triggered the Changed event.

  5. Hey! I would like to create a Dropbox that will display something like the following chat message  "You've got mail from... (avatar's profile link here)".

    Is it possible to somehow find out and include in this message a link to the profile of the avatar who sent me the package? Something like that:

    string avatar(key id)
    {
        return "secondlife:///app/agent/" + (string) id + "/inspect";
    }
    
    changed(integer mask)
    {
        if (mask & (CHANGED_ALLOWED_DROP | CHANGED_INVENTORY))
            llWhisper(0, "Thank you for submitting your notecard!");
        llInstantMessage(llGetOwner(), "You've got mail from " + avatar(llDetectedKey(0)));
    }

    Thank's!

  6. 26 minutes ago, Wulfie Reanimator said:

    Try the scripts I posted and you'll see.

    Nope, URLs are released when the object derezzes. URLs are handled by the sim and there is a hard limit on how many URLs will be granted across all scripts in the region, so it would not make sense to "keep URLs alive" when the object goes away.

    I honestly did :3 

    Created two objects and placed scripts in them, after the line llOwnerSay(body) added llSay for tests, but when I click, only a message appears: "Sent request to URL", I figured this was happening because the script contains a sample url and I need to get mine somewhere in order to work?
    And did I understand correctly that I need to uncomment the line?

    // if (body == "trigger sound")
     

  7. 8 minutes ago, Quistessa said:

    You can use either the http method or email without premium, but you'll probably have problems either way if the object that plays the sound is something you rez and de-rez often (like for example a worn object).  I've not played with http requests much, maybe the requested URLs are stable? I would just recommend doing a lot of tests before trusting it in anything you might distribute widely.

    Thanks, but where can I get this URL and why is it unstable?

  8. 2 hours ago, Quistessa said:

    FWIW you can also use llEmail() for long-distance communication if the volume of messages is low.

    Scripts cannot hear llInstantMessages unfortunately. Only Real-live people and specialized bots using weird viewers can read those messages.

     

    Edit: for a HUD, you'll still run into problems, as attachments probably don't have very consistent UUIDs. Do your own tests to confirm though. Perhaps you could use a Key-Value Pair (only available to premium Residents :/) to keep the UUID and/or URL updated.

    Thank you! Unfortunately I don't have a premium, trying Wulfie's scripts, for tests using llSay. :)

  9. 33 minutes ago, Wulfie Reanimator said:

    This script goes in the object that wants to play sounds:

    
    key url_request;
    
    default
    {
        state_entry()
        {
            // When script starts, try to get a usable URL.
            url_request = llRequestURL();
        }
    
        http_request(key id, string method, string body)
        {
            if (id == url_request && method == URL_REQUEST_GRANTED)
            {
                // Our request for a usable URL was granted.
                // Other scripts can send requests to this URL.
                // If requests are made, http_request event will be triggered again.
                llOwnerSay("Listening at: " + body);
            }
            else
            {
                // Assume somebody made a request.
                llOwnerSay(body);
    
                // if (body == "trigger sound")
                //     llTriggerSound(sound, 1);
            }
        }
    }

    And this goes in the colliding object:

    
    default
    {
        // collision_start(integer n)
        touch_start(integer n)
        {
            // This URL is an example. The script needs some way to discover this.
            string url = "http://simhost-08e4294b960b4fa2c.agni.secondlife.io:12046/cap/f986cc2d-2f89-780b-c3d4-496c7ca6599e";
            llHTTPRequest(url, [HTTP_METHOD, "POST"], "trigger sound");
            llOwnerSay("Sent request to URL");
        }
    }

     

    Thank you!!! I do not deserve this! This is very kind of you! :3

    But what is it here  string url = "http://simhost-08e4294b960b4fa2c... here and where to get it? I tried slurl but it seems something different?

  10. 54 minutes ago, Wulfie Reanimator said:

    llRequestURL and then send llHTTPRequest to that.

    You need a way for the sender to know the receiver's URL, though. Depending on what you're doing, that might become very tricky.

    Thank you! I just need to play the sound snippet when someone collides an object in another sim. I touched the url topic a few times, looked through the examples from the wiki and did not understand anything ... XD

    And the option with the llInstantMessage does not make sense? At least in the most primitive way?

  11. Hi! Is there a way to trigger the sound of the hud attached on an avatar when another avatar colliding with an object in another sim? I kind of managed to use llRegionSay and listen event in the hud for simwide, but can I do it gridwide? For example somehow convert llInstantMessage to a trigger?

  12. 7 hours ago, Mollymews said:

    is not a good idea to mix them up

    doing wheelies with angular motor can be done fairly easily.  In your OP script you are applying way to much direct power. The better way is to apply some multiple of the current motor

    the original Linden motorcycle script is a good source to look at how linear and angular motors can work quite well together

    a modified version of this script is here.

    the mods are more about showing what happens on region crossings. But the basics of the Linden motorcycle engine are preserved

    Thanks for the great example! ;)

    • Like 1
  13. Back to the main topic, is there any other way to make the wheelie without changing linear/angular, for example, rotating the root prim and the entire linkset?

    Maybe I can use llApplyImpulse for this?

  14. 1 hour ago, Profaitchikenz Haiku said:

    I'm going to retire from answering request for help on this forum until I've worked out if I really am on the way downhill or if this is just a bad-luck-streak-in-dancing-school thing.

    Please do not! 😭

    • Like 2
  15. 15 hours ago, Profaitchikenz Haiku said:

    In passing, don't forget that in the expression 

    rate is being used as a divisor, so in the special case where you have come to a stop, don't try testing to see if the change is 10%, just do it. 

    Similarly, when starting from standstill, don't bother with the test, just apply the rate

    This then leads you to the combined expression

    
    if( rate == 0.0 || oldRate == 0.0 || (llFabs(rate - oldRate) > rate / 10.0) ) // do it
    else // ignore it

    The order in which those individual tests are made ensures that the division won't occur if rate is zero, because the test for zero is made first of all, and the logical OR || ensures a true result at that point, no further evaluation of the expression should occur.

    Perfect! Thanks for not leaving me alone with my problem!! 🚲👍🏻👍🏻👍🏻

    ( I hope I did everything right. One more question. How to display the value of the rate in the chat? I wanted to know how it changes and tried llOwnerSay(rate); but it turns out "Function call .." )

    That's what I got ..  may be useful to someone

                float WheelDiameter = 0.71403;
                
                vector vehdir = <1.0,0.0,0.0> * llGetRootRotation(); // Global direction of vehicle
                float speed = vehdir * llGetVel(); // Speed in fwd direction
                // Convert to wheel rotation rate in radians/sec
                float rate = speed / (WheelDiameter * PI);
                float oldRate = speed / (WheelDiameter * PI);
                
                oldRate = rate;
                
                rate += 0.5;
                
                if( rate == 0.0 || oldRate == 0.0 || (llFabs(rate - oldRate) > rate / 10.0) )
                {
                    llSetLinkPrimitiveParamsFast(PROP_PRIM, [PRIM_OMEGA, PROP_AXIS, rate * 5, 1, PRIM_LINK_TARGET, PROP_PRIM_2, PRIM_OMEGA, PROP_AXIS, rate * 5, 1]);
                }

     

  16. 6 hours ago, Profaitchikenz Haiku said:

    Try

    
    
    if ( llFabs(rate - oldRate) > rate / 10)

    You will obviously have to assign values to oldRate prior to this test

    Thanks a lot! ;)

    And how to assign these values? Will I need to make a list?

  17. 6 hours ago, animats said:

    Save the last value you set. If the new value is within 10% of the old, and is not zero, don't change the speed of the wheel.

    Thanks again!

    But I'm sure that I'm doing everything wrong ...

    rate++
    
    if (rate >= rate / 10)
    
    {
    
        llSetLinkPrimitiveParamsFast(PROP_PRIM, [PRIM_OMEGA, PROP_AXIS, rate * 5, 1, PRIM_LINK_TARGET, PROP_PRIM_2, PRIM_OMEGA, PROP_AXIS, rate * 5, 1]);
    
    }

     

×
×
  • Create New...