Jump to content

MIVIMEX

Resident
  • Posts

    177
  • Joined

  • Last visited

Posts posted by MIVIMEX

  1. Hello! I have a question. I'm building a boat and there must be a refrigerator with a door with lighting on/off when door is open/close. I want to add such a lines to script, but I do not know where. Advise please! THANK YOU!

    LINES TO ADD:

     /////////////////ON
    
    llSetPrimitiveParams([PRIM_POINT_LIGHT,TRUE,<1.0, 1.0, 1.0>,1.0,15,0.750, 
    PRIM_GLOW, ALL_SIDES, 0.4]); 
       
       
       
    ///////////////// OFF
      
       llSetPrimitiveParams([PRIM_POINT_LIGHT,FALSE,<1.0, 1.0, 1.0>,1.0,15,0.750, PRIM_GLOW, ALL_SIDES, 0.0]);   

    DOOR SCRIPT (For vehicles)

    //------------------------------------------------------
    // Timeless Linked Door Script by Timeless Prototype
    //------------------------------------------------------
    // The latest version of this script can always be found
    // in the Library section of the wiki:
    // http://www.secondlife.com/badgeo/
    // This script is free to use, but whereever it is used
    // the SCRIPT's permissions MUST be set to:
    // [x] Next owner can modify
    // [x] Next owner can copy
    // [x] Next owner can transfer
    // [x] Allow anyone to copy
    // [x] Share with group
    
    //------------------------------------------------------
    // USAGE INSTRUCTIONS FOR EVERYDAY USE:
    //------------------------------------------------------
    // Say the following commands on channel 0:
    // 'unlock'     - Unlocks all doors in range.
    // 'lock'       - Locks all doors in range and allows
    //                only the permitted users to open it.
    // To open the door, either Touch it, Walk into it or
    // say 'open' or say 'close'.
    
    //------------------------------------------------------
    // USAGE INSTRUCTIONS FOR BUILDERS:
    //------------------------------------------------------
    // 1. Copy and paste this script into the door prim and
    //    change the settings (see further down).
    // 2. The door prim must be linked to at least one other
    //    prim (could be linked to the house for example).
    // 3. The door prim MUST NOT be the root prim.
    // 4. Use Edit Linked Parts to move, rotate and size the
    //    door prim for the closed state.
    // 5. When ready, stand close to the door and say
    //    '/door closed' (this records the closed door
    //    position, rotation and size to the object's
    //    name and description).
    // 6. Use the Edit Linked parts to move, rotate and size
    //    the door prim for the opened state.
    // 7. When ready, stand close to the door and say
    //    '/door opened' (this records the opened door
    //    position, rotation and size).
    // 8. Once recorded it will not accept these commands
    //    again. If you do need to redo the settings then
    //    delete the Name and Description of the door prim
    //    (these are where the position information is
    //    stored), and then follow the steps above again.
    //    Note: deleting the object name won't save, so set
    //    the object name to 'Object' to reset the object
    //    name.
    
    //------------------------------------------------------
    // Change these settings to suit your needs.
    //------------------------------------------------------
    // To mute any/all of the sounds set the sound string(s)
    // to "" (empty string).
    // To get the UUID of a sound, right click on the sound
    // in your inventory and choose "Copy Asset UUID", then
    // paste the UUID in here.
    string      doorOpenSound       = "9a076511-9aa8-f50d-e34c-1396a07a66a9";
    string      doorCloseSound      = "876d3492-b8b8-7745-f5ae-dc5176ec6105";
    string      confirmedSound      = "69743cb2-e509-ed4d-4e52-e697dc13d7ac";
    string      accessDeniedSound   = "58da0f9f-42e5-8a8f-ee51-4fac6c247c98";
    string      doorBellSound       = ""; // Setting to empty stops door announcements too.
    float       autoCloseTime       = 0.0; // 0 seconds to disable auto close.
    integer     allowGroupToo       = TRUE; // Set to FALSE to disallow same group access to door.
    list        allowedAgentUUIDs   = ["e032aea2-9489-40d3-87b3-713300ead4cc"]; // Comma-separated, quoted list of avatar UUIDs who are allowed access to this door.
    integer     listenChannel       = 0;
    
    
    //------------------------------------------------------
    // Leave the rest of the settings alone, these are
    // handled by the script itself.
    //------------------------------------------------------
    integer     isLocked              = FALSE; // Only when the door is locked do the permissions apply.
    integer     isOpen              = TRUE;
    vector      openPos             = ZERO_VECTOR;
    rotation    openRot             = ZERO_ROTATION;
    vector      openScale           = ZERO_VECTOR;
    vector      closedPos           = ZERO_VECTOR;
    rotation    closedRot           = ZERO_ROTATION;
    vector      closedScale         = ZERO_VECTOR;
    key         openerKey           = NULL_KEY;
    key         closerKey           = NULL_KEY;
    integer     isSetup             = FALSE;
    integer     listenHandle        = 0;
    string      avatarName          = "";
    
    mySayName(integer channel, string objectName, string message)
    {
        string name = llGetObjectName();
        llSetObjectName(objectName);
        llSay(0, "/me " + message);
        llSetObjectName(name);
    }
    
    mySay(integer channel, string message)
    {
        string name = llGetObjectName();
        llSetObjectName("Door");
        llSay(0, message);
        llSetObjectName(name);
    }
    
    myOwnerSay(string message)
    {
        string name = llGetObjectName();
        llSetObjectName("Door");
        llOwnerSay(message);
        llSetObjectName(name);
    }
    
    mySoundConfirmed()
    {
        if (confirmedSound != "")
        {
            llTriggerSound(confirmedSound, 1.0);
        }
    }
    
    mySoundAccessDenied()
    {
        if (accessDeniedSound != "")
        {
            llTriggerSound(accessDeniedSound, 1.0);
        }
    }
    
    myGetDoorParams()
    {
        isSetup = FALSE;
        if (llSubStringIndex(llGetObjectDesc(), "door;") == 0 && llSubStringIndex(llGetObjectName(), "door;") == 0)
        {
            list nameWords = llParseString2List(llGetObjectName(), [";"], []);
            list descWords = llParseString2List(llGetObjectDesc(), [";"], []);
            if (llGetListLength(nameWords) != 4 || llGetListLength(descWords) != 4)
            {
                myOwnerSay("The door prim's name and/or description has invalid syntax and/or number of parameters. Delete the door prim's name and description and setup the door prim again.");
            }
            else
            {
                openPos = (vector)llList2String(nameWords, 1);
                openRot = (rotation)llList2String(nameWords, 2);
                openScale = (vector)llList2String(nameWords, 3);
                closedPos = (vector)llList2String(descWords, 1);
                closedRot = (rotation)llList2String(descWords, 2);
                closedScale = (vector)llList2String(descWords, 3);
                isSetup = TRUE;
            }
        }
    }
    
    mySetDoorParams(vector openPos, rotation openRot, vector openScale, vector closedPos, rotation closedRot, vector closedScale)
    {
        llSetObjectName("door;" +
            (string)openPos + ";" +
            (string)openRot + ";" +
            (string)openScale);
        llSetObjectDesc("door;" +
            (string)closedPos + ";" +
            (string)closedRot + ";" +
            (string)closedScale);
        isSetup = TRUE;
    }
    
    integer myPermissionCheck(key id)
    {
        integer hasPermission = FALSE;
        if (isLocked == FALSE)
        {
            hasPermission = TRUE;
        }
        else if (llGetOwnerKey(id) == llGetOwner())
        {
            hasPermission = TRUE;
        }
        else if (allowGroupToo == TRUE && llSameGroup(id))
        {
            hasPermission = TRUE;
        }
        else if (llListFindList(allowedAgentUUIDs, [(string)id]) != -1)
        {
            hasPermission = TRUE;
        }
        return hasPermission;
    }
    
    myOpenDoor()
    {
        isOpen = FALSE;
        myToggleDoor();
    }
    
    myCloseDoor()
    {
        isOpen = TRUE;
        myToggleDoor();
    }
    
    myToggleDoor()
    {
        if (isSetup == FALSE)
        {
            myOwnerSay("The door prim has not been configured yet. Please read the usage instructions in the door script.");
        }
        else if (llGetLinkNumber() == 0 || llGetLinkNumber() == 1)
        {
            myOwnerSay("The door prim must be linked to at least one other prim and the door prim must not be the root prim");
        }
        else
        {
            isOpen = !isOpen;
            if (isOpen)
            {
                if (doorBellSound != "")
                {
                    llTriggerSound(doorBellSound, 1.0);
                    if (avatarName != "")
                    {
                        mySayName(0, avatarName, "is at the door.");
                        avatarName = "";
                    }
                }
                if (doorOpenSound != "")
                {
                    llTriggerSound(doorOpenSound, 1.0);
                }
                llSetPrimitiveParams([ PRIM_POSITION, openPos, PRIM_ROTATION, ZERO_ROTATION * openRot / llGetRootRotation(), PRIM_SIZE, openScale ]);
                // Door API.
                llMessageLinked(LINK_SET, 255, "cmd|door|opened", NULL_KEY);
            }
            else
            {
                if (doorCloseSound != "")
                {
                    llTriggerSound(doorCloseSound, 1.0);
                }
                llSetPrimitiveParams([ PRIM_POSITION, closedPos, PRIM_ROTATION, ZERO_ROTATION * closedRot / llGetRootRotation(), PRIM_SIZE, closedScale ]);
                // Door API.
                llMessageLinked(LINK_SET, 255, "cmd|door|closed", NULL_KEY);
            }
            
            llSetTimerEvent(0.0);
            if (isOpen == TRUE && autoCloseTime != 0.0)
            {
                llSetTimerEvent(autoCloseTime);
            }
        }
    }
    
    default
    {
        state_entry()
        {
            listenHandle = llListen(listenChannel, "", NULL_KEY, "");
            myGetDoorParams();
        }
    
        touch_start(integer total_number)
        {
            if (myPermissionCheck(llDetectedKey(0)) == TRUE)
            {
                avatarName = llDetectedName(0);
                myToggleDoor();
            }
            else
            {
                mySoundAccessDenied();
            }
        }
        
        timer()
        {
            myCloseDoor();
        }
        
        link_message(integer sender_num, integer num, string str, key id)
        {
            // Door API. The API is here in case you want to create PIN entry keypads or whatever.
            if (num == llGetLinkNumber())
            {
                if (str == "cmd|door|doOpen")
                {
                    myOpenDoor();
                }
                else if (str == "cmd|door|doClose")
                {
                    myCloseDoor();
                }
            }
            if (str == "cmd|door|discover")
            {
                llMessageLinked(LINK_SET, 255, "cmd|door|discovered|" + (string)llGetKey(), id);
            }
        }
        
        listen(integer channel, string name, key id, string message)
        {
            // Performance note: it's quicker to compare the strings than to compare permissions each time anyone says anything on this channel.
            if (message == "open")
            {
                if (myPermissionCheck(id) == TRUE)
                {
                    // Only open the door if the person is quite close to this door.
                    openerKey = id;
                    closerKey = NULL_KEY;
                    avatarName = name;
                    llSensor(name, id, AGENT, 5.0, TWO_PI);
                }
                else
                {
                    mySoundAccessDenied();
                }
            }
            else if (message == "close")
            {
                if (myPermissionCheck(id) == TRUE)
                {
                    openerKey = NULL_KEY;
                    closerKey = id;
                    avatarName = name;
                    // Only close the door if the person is quite close to this door.
                    llSensor(name, id, AGENT, 5.0, TWO_PI);
                }
                else
                {
                    mySoundAccessDenied();
                }
            }
            else if (message == "lock")
            {
                if (myPermissionCheck(id) == TRUE)
                {
                    isLocked = TRUE;
                    mySoundConfirmed();
                }
                else
                {
                    mySoundAccessDenied();
                }
            }
            else if (message == "unlock")
            {
                if (myPermissionCheck(id) == TRUE)
                {
                    isLocked = FALSE;
                    mySoundConfirmed();
                }
                else
                {
                    mySoundAccessDenied();
                }
            }
            else if (message == "/door opened" && llSubStringIndex(llGetObjectName(), "door;") == -1)
            {
                if (llGetOwnerKey(id) == llGetOwner())
                {
                    mySoundConfirmed();
                    openPos = llGetLocalPos();
                    openRot = llGetLocalRot();
                    openScale = llGetScale();
                    isOpen = TRUE;
                    if (! (closedPos == ZERO_VECTOR && closedRot == ZERO_ROTATION && closedScale == ZERO_VECTOR))
                    {
                        mySetDoorParams(openPos, openRot, openScale, closedPos, closedRot, closedScale);
                    }
                }
                else
                {
                    mySoundAccessDenied();
                }
            }
            else if (message == "/door closed" && llSubStringIndex(llGetObjectDesc(), "door;") == -1)
            {
                if (llGetOwnerKey(id) == llGetOwner())
                {
                    mySoundConfirmed();
                    closedPos = llGetLocalPos();
                    closedRot = llGetLocalRot();
                    closedScale = llGetScale();
                    isOpen = FALSE;
                    if (! (openPos == ZERO_VECTOR && openRot == ZERO_ROTATION && openScale == ZERO_VECTOR))
                    {
                        mySetDoorParams(openPos, openRot, openScale, closedPos, closedRot, closedScale);
                    }
                }
                else
                {
                    mySoundAccessDenied();
                }
            }
        }
        
        sensor(integer num_detected)
        {
            if (openerKey != NULL_KEY)
            {
                integer i;
                for (i = 0; i < num_detected; i++)
                {
                    if (llDetectedKey(i) == openerKey && myPermissionCheck(llDetectedKey(i)) == TRUE)
                    {
                        myOpenDoor();
                    }
                }
                openerKey = NULL_KEY;
            }
            else
            {
                integer i;
                for (i = 0; i < num_detected; i++)
                {
                    if (llDetectedKey(i) == closerKey && myPermissionCheck(llDetectedKey(i)) == TRUE)
                    {
                        myCloseDoor();
                    }
                }
                closerKey = NULL_KEY;
            }
        }
    
    //------------------------------------------------------
    // Uncomment the following code if you particularly want
    // collisions to affect the door state.    
    //------------------------------------------------------
    
    //    collision_start(integer num_detected)
    //    {
    //        integer i;
    //        for (i = 0; i < num_detected; i++)
    //        {
    //            if (myPermissionCheck(llDetectedKey(i)) == TRUE)
    //            {
    //                avatarName = llDetectedName(i);
    //                myOpenDoor();
    //            }
    //            else if (llDetectedType(i) & AGENT)
    //            {
    //                mySoundAccessDenied();
    //            }
    //        }
    //    }
    
    } // End of default state and end of script

     

     

     

  2. HELLO! I'm trying to create an exploding barrel and now I made such a mesh. But I have a problem with baking AO shadows texture. On the sides of the barrel where the ribs are visible strips. This is despite the fact that the cylinder 24 VERTS, the SMOOTH is switched on. I can of course make a blur in the photo editor, but how can I make the blur in the settings of baking? Is this possible? Please advise.

    Thank you so much!

    Безымянный.png

    BARREL AO 1.png

  3. @Fionalein  @Berksey

    Thank you so MUCH! Your help was invaluable to meWith your support, I managed to create the required script.

    5 hours ago, Berksey said:

    EDIT: Sent you a straw dummy inworld. It doesn't die at the end, just makes an explosion and asks for a reset, but you can easily make the script into what you want, or get useful things from it. Read the notecard inside for full instructions on how it works. ^-^

    Thank you for being so kind and sending me your straw dummy. It is beautiful!

  4. @Fionalein  @Wulfie Reanimator  @Lucia Nightfire

    Hello! Thanks to everyone who responded to my question!!!
    I used the recommended script but I do not know exactly where to add sound and particles. The script that I got plays sound with every hit of a bullet, particles also go constantly (this my fault-bad particles system). But I need it to happen only when an explosion occurs when HP is at zero. I tried to reduce HP or increase the damage but it did not help. Please advise where to put the system of particles and sound to work only when the explosion? Thanks again!

    integer hit_value = 10;//How much health we loose each time we are hit.
    integer health_value = 100;//Our total health
    
    // My example sound...
    string sound = "b36b6ef4-c125-8660-89a8-73648ba69ba4";
    
    
    default{
    //
        state_entry(){
            llSetText("Health: "+(string)health_value, llGetColor(0), 1.0);
            //Show our default health value  
        }  
    //
        collision_start(integer total_number){
            integer i;
            for( i = 0; i < total_number; i++ ){
                if(llDetectedType(i) & AGENT) return;
                //Check if its an object or avatar/agent hitting us, if avatar, return/stop here.
                health_value -= hit_value;
                // Detect a collision from an object, we remove our hit value
                llSetText("Health: "+(string)health_value, llGetColor(0), 1.0);
                // Set floating text to show how much health we have left.
                if(health_value == 0 || health_value < 0) state lldie;
     // I added This ...
     llTriggerSound(sound, 1.0);
    
    //And this...
     llParticleSystem([PSYS_PART_MAX_AGE,0.88,
    PSYS_PART_FLAGS, 259,
    PSYS_PART_START_COLOR, <0.80900, 0.61643, 0.19086>,
    PSYS_PART_END_COLOR, <0.95090, 0.23954, 0.04910>,
    PSYS_PART_START_SCALE,<0.80000, 0.80337, 0.00000>,
    PSYS_PART_END_SCALE,<0.90828, 0.90234, 0.00000>,
    PSYS_SRC_PATTERN, 2,
    PSYS_SRC_BURST_RATE,0.55,
    PSYS_SRC_BURST_PART_COUNT,33,
    PSYS_SRC_BURST_RADIUS,0.55,
    PSYS_SRC_BURST_SPEED_MIN,0.72,
    PSYS_SRC_BURST_SPEED_MAX,3.33,
    PSYS_SRC_ANGLE_BEGIN, 1.35,
    PSYS_SRC_ANGLE_END, 1.35,
    PSYS_SRC_MAX_AGE, 0.0,
    PSYS_SRC_TEXTURE, "74e8631c-33a9-bc1a-03d3-ede886272a21",
    PSYS_PART_START_ALPHA, 0.61,
    PSYS_PART_END_ALPHA, 0.05,
    PSYS_PART_START_GLOW, 0.10,
    PSYS_PART_END_GLOW, 0.00]);
     
                // Check how much health is left after removing hit value, if 0 or less.. die.
            }    
        }
    //
    }
     
    state lldie{
    //
        state_entry(){
          
            
            llSetText("Health: "+(string)health_value, llGetColor(0), 1.0);
            //Update our text, to show we have no health left.
            llDie();
            llSay(0,"/me is Dead!..");
        }
    //
    }

     

  5. Hello! I'm trying to create a script of an exploding barrel. I want the object (the barrel - a single mesh object) to explode when bullets hit it - throwing out the explosion particles, making a sound, maybe becoming physical and flying off to the side and self destruct. Have any ideas? Thank you!

     

    If I ask to scripters - how much could it cost to write such a script these days?

  6. @angeoco @Chic Aeon  @Nalates Urriah

    Thank you very much to everyone who took part! Tried everything you advised me. I put about the same values of the gloss. I used both prim light and windlight. I am very satisfied with the result. At settings CalWL the skin looks perfect. I'm convinced that the skin is all right. It's probably just that they are different manufacturers and the head and body are different meshes with different structures. Also think it's just a small shadow.

    Snapshot_001.png

    • Thanks 2
  7. 4 hours ago, Chic Aeon said:

    check the shine and shimmer on the Maitreya body (and any glossiness on your head) as they could certainly cause this problem.

    thanks for informative answer! but now i got following question. what settings of the viewer should be to make it more visible which shimmer I put on my head and body? (pardon my noobility, i think it calls "windlights") i can of course just turn the shimmer off , but I want to keep a small gloss ("evenly")
     

  8. Hello! Help please customize the mesh avatar! Head of Catwa Catya, body of Mitreya Lara. Skin Glam Affair Rina. The problem is that I can not connect the head with the body without a visible transition on the neck. how to do it? if it's the settings, then what should they be?

    Thanks for any help!

     

    Сan it be matter of specularity? if you set the same values, the transition disappears?

     

    Snapshot_001.png

  9. 46 minutes ago, Rolig Loon said:

    It's going to vary a bit depending on how laggy the region is, but the best way to find out is to set up two prims that are, say, 20m apart and see how long it takes to walk between them.  If you want to know exactly how long, put the same script in each one and listen...

     

    @Rolig Loon 

    Thank you! it was a very interesting experiment!
    I have numbers when walking: 

    [10:33] Object: Collision at 88436.000000
    [10:34] Object: Collision at 88442.420000
    = ~   ̶6̶   3 meters per second


    Then I translated the meters per second in kilometers per hour and I got such a value:  ̶2̶1̶   12 kph! (  ̶a̶s̶ ̶f̶o̶r̶ ̶m̶e̶ ̶i̶t̶'̶s̶ ̶s̶o̶ ̶f̶a̶s̶t̶!̶ ̶) Its ok!

     

    24 minutes ago, angeoco said:

    According to my home-made navigation HUD, which calculates speed from avatar positions over time, walking is about 3.2 m/s, running is about 5.12 m/s, and flying is about 16 m/s.

    @angeoco

    Thank you!

    I will have something to think about!

     

  10. 16 minutes ago, Rolig Loon said:

    ...

    There are two ways to do it. One way is to use a scripting function, llPreloadSound

    ...

     

    @Rolig Loon

    Thank you for answer!

    Yes, I'm using script with scripting function llPreloadSound. But how to explain that some sound files start to play faster than others even for different people?

  11. Hello! A question about full lenght songs. Why do some sound files start to play faster than others? I use the usual music player, but I have to wait for the song to be loaded. Some songs are played almost immediately, others have to wait. And does not depend on that for the first or the tenth time I listen to the song. On what does it depend? Any help please! 

    Thanks!

  12. Hello! Help please with particles! I build a boat and I want to make such a wake on the water, which starts from the very nose and goes around the boats's hull. I saw it inworld so I believe its possible, I just dont know how. Particles does not go through the hull.  They are slightly spraying forward and then circling the boat.

    But my particles go through without encountering obstacles. How can I simulate such particle wake?

    I have a particle script generator. I'm playing with sliders but I can not find the right one yet. Maybe someone has done this before and just tell the right parameter? This would greatly help.

    Untitled-1.png

    ezgif.com-video-to-gif.gif

    (Animation shows my particles going through obstacle)

  13. Hello! Help, please, with particles. I have a script, but it always emits particles in one direction, no matter how I rotate the object. How to make the emission change the direction when the object rotates (attached or rezzed)? Is this difficult? Thank you!

     

    ---------+---------

     

    The problem solved. Just had to use 'cone' instead of 'angle'.

  14. Hello! I bought a beard and it consists of two parts. Beard and mustache. But I want to link them in one object. I can not link them attached. If I rez them and link on the ground, it turns out not exactly I want, I have to adjust the new linked attached beard. The mustache also consists of several parts and they lose shape. Advise please, how to link them without lose shape? Thank you!
     

  15. 26 minutes ago, Fionalein said:

    you already have a script taht gives you depth in hovertext.... just combine both scripts... an experienced scriptor should be able to do so on a lazy afternoon... optimzing it for sale might be another thing =^.^=

    Ok, thanks, I will try to combine them. I also posted on a scripter wanted forum. If anyone interested, please, let me know!

×
×
  • Create New...