Jump to content

Tattooshop

Resident
  • Posts

    365
  • Joined

  • Last visited

Posts posted by Tattooshop

  1. 22 minutes ago, Rolig Loon said:

    You could trigger it in any event you wish:  timer, listen, link_message, .... It all depends on what you are trying to do.

    I tried

    default
    {
        touch_start(integer total_number)
        {
            return "secondlife:///app/agent/" + (string)id + "/about";
        }
    }

    but it says "Return statement type does not match function return type".

  2. And one more question for all lovers of furry BG Solarian avatars. Why are there seams on the head of this avatar (even on an ultra graphic if it depends on it)?

    ...

    I asked the group and they told me that at a low height everything looks better and no seams are visible. I wonder why this happens and will it ever be fixed?

     

  3. Hello everybody! is it possible to use the script to open the profile window of your own avatar? Please dont ask me why i need it! :D

    Not just picture, the one with groups, about, give item etc...

  4. maybe I came up with a new trick!

    7 minutes ago, Pamela Galli said:

    Then I have no clue what you mean by this: “ I unwrap two cubes to different textures”

     

    32 minutes ago, ChinRey said:

    I think you're confusing UV maps with materials here. A mesh in SL can only have one UV map but it can have up to eight different materials/faces.

    Yay! I managed to do it! I created a new map and used it twice for glass and for wood. Renamed in a window of UV maps and voila! The second texture did not appear! Although the UV does not look right, but in my case it works. Maybe I came up with a new trick! :D Thanks for participation!

    Untitled.png

  5. 1 minute ago, ChinRey said:

    I think you're confusing UV maps with materials here. A mesh in SL can only have one UV map but it can have up to eight different materials/faces.

    Hi! Yes, that’s the whole problem that you can’t use two maps. The glass and the door were different separate objects and had separate UV maps and textures. All glass on a separate texture and the wood on another. Now when I try to link them into one object, a second UV appears in UV maps window. However, this does not happen when I do this experiment with cubes.

  6. 1 hour ago, Pamela Galli said:

    i Am not sure what you are asking, but you need to delete one of the UVs. 

    Hello! when I remove one of the UVs glass for example, I lose it and then I can not apply a texture on it so that it matches. I need to save both UVs and at the same time link the door and glass together.

  7. Hello! I’m trying to upload model and I need to separate the door (it is linked) so that it can move. But the problem is that the door glass and the door itself are on different textures. How to link them so as not to spoil the UV? I separated the door and the glass, linked them together, but either a UV of the glass or the door itself is displayed. It should also be two different materials. At the same time, two textures are visible in the UV maps window. Which is bad as you know.
    Why if, for example, I unwrap two cubes to different textures and link them into one object, only one UV is displayed below?

    Need the same effect.
    Maybe I can somehow "reunwrap" everything to the same places?

    1.png

    2.png

  8. 34 minutes ago, Alwin Alcott said:

    why you think the answers section about issues in SL has a answer why a shop closes?

    this is because I’m new here and did not spend years on this site and did not even know about the existence of this category, but chose from the list the most suitable one in my opinion. I answered your question. can you answer mine now?

    • Like 2
  9. 12 hours ago, Profaitchikenz Haiku said:
    
    // further enhancements would be to check there are actually some list entries before setting 
    // the timer to a non-zero value
                                

     

    This part is very interesting how to do it? Something like

    getSlides();
    
    if index !=0
    
    {
    
    llSetTimerEvent(3);
    
    index=0;
    
    newSlide();
    
    }

    ?

  10. 12 hours ago, Profaitchikenz Haiku said:

    Yes, it is possible to modify it, empty the list, then at startup call a small routine that counts how many textures there are in the object and adds each name to the list.

     

    Thank you so much! It works as a dream!

    list slides = [];
    
    getSlides()
    {
        integer ii;
        integer iiMax = llGetInventoryNumber(INVENTORY_TEXTURE);
        string name;
    
        for (ii = 0; ii < iiMax; ii++)
        {
            name = llGetInventoryName(INVENTORY_TEXTURE, ii);
            slides += [name];
        }
    }
    
    integer index;
    
    newSlide()
    {
        string texture = llList2String(slides, index);
        llSetTexture(texture, 1);
        index++;
        if (index >= llGetListLength(slides))
            index = 0;
    }
    
    default
    
    {
        state_entry()
        {
            getSlides();
            llSetTimerEvent(3);
            index = 0;
            newSlide();
        }
    
        /*        touch_start(integer num)
            {
                index = 0;
                newSlide();
                llSay(0,"Starting slide show over");
            }*/
    
        timer()
        {
            newSlide();
        }
        
        changed(integer change)
        {
            llResetScript();
        }
    }

     

  11. Hello! is it possible to mod this slideshow script so that you don't have to make a list and it will automatically use textures from the content? And also what is  index here and what for?

    Thanks in advance!

    list slides =
    
        ["Texture01", "Texture02", "Texture03", "Texture04"]; /* Textures names list*/
    
    integer index;
    
    
    
    newSlide()
    
    {
    
        string texture = llList2String(slides, index);
    
        llSetTexture(texture, 1);
    
        index++;
    
        if (index >= llGetListLength(slides))
    
            index = 0;
    
    }
    
    
    
    default
    
    {
    
        state_entry()
    
        {
    
            llSetTimerEvent(3);
    
            index = 0;
    
            newSlide();
    
        }
    
    
    
        touch_start(integer num)
    
        {
    
            index = 0;
    
            newSlide();
    
            llSay(0, "Starting slide show over");
    
        }
    
    
    
        timer()
    
        {
    
            newSlide();
    
        }
    
    }

     

     

  12. 10 minutes ago, Profaitchikenz Haiku said:

    I just repeated the test but now using collision events, and only the last detected position I was t as chatted out, so collisions store none or one, and it's always the last one.

     

    I've realised that the sequence of the touch events being stored can be quite useful. Imagine you have a number pad and you tap away at the numeric keys, then realise this thing isn't responding, and you tap a cancel key. When it does come back to life, it will record the first of many keys, but also the last, which you can test for, and if it's cancel, take appropriate action, but it does mean shifting the touch processing out into a function instead of within the event.

    Thank you very much! Your method works for me and i even managed to make this version for linked detector and light.

    /* Light with detector V.2 - For linked detector and light */
    
    vector LIGHT_COLOR = < 1.0, 1.0, 1.0 > ; // Light color lsl RGB
    integer LIGHT_PRIM = 2; // Light prim number or LINK_THIS
    integer LIGHT_FACE = ALL_SIDES; // Light face number or ALL_SIDES
    
    integer lightOn = 0;
    
    default
    {
        state_entry()
        {
            llVolumeDetect(TRUE); // Starts llVolumeDetect
    
            /* If detect is TRUE, VolumeDetect is enabled, physical object and avatars can pass through the object. */
    
        }
    
        collision_start(integer num)
        {
            if (lightOn == 0)
            {
                // On
                llSetLinkPrimitiveParamsFast(LIGHT_PRIM,
                    [PRIM_GLOW, LIGHT_FACE, 1,
                        PRIM_POINT_LIGHT, TRUE,
                        LIGHT_COLOR 
                        , 1.0 
                        , 10.0 
                        , 0.2 
                    ]);
                lightOn = 1;
                llSetTimerEvent(5.0);
            }
        }
    
        timer()
        {
            llSetTimerEvent(0.0); // stop any repeating
            llSetLinkPrimitiveParamsFast(LIGHT_PRIM,
                [PRIM_GLOW, ALL_SIDES, FALSE, PRIM_POINT_LIGHT, FALSE,
                    ZERO_VECTOR, 0.0, 0.0, 0
                ]);
            lightOn = 0;
        }
    }

     

    • Like 1
  13. @Profaitchikenz Haiku@Fenix Eldritch Hello! Thank you very much! Here my codes:

     

    // Detector script
    
    default
    {
        state_entry()
        {
            llVolumeDetect(TRUE); 
            /* If detect is TRUE, VolumeDetect is enabled, physical object and avatars can pass through the object. */
        }
    
        collision_start(integer num)
        {
            llSay(-1234567, "light_on"); /* And here you are telling anyone listening on channel -1234567 on command. */
        }
    }
    // Light script
    
    vector LIGHT_COLOR = < 1.0, 1.0, 1.0 > ; // Light color lsl RGB
    integer LIGHT_PRIM = 0; // Light prim number or LINK_THIS
    integer LIGHT_FACE = ALL_SIDES; // Light face number or ALL_SIDES
    
    default
    {
        state_entry()
        {
            llListen(-1234567, "", "", ""); /* Listen to anybody saying anything on channel -1234567 */
        }
        
        listen(integer channel, string name, key id, string msg)
        {
            if (msg == "light_on") /* That is, if the message was light_on */ 
            { 
            // On
            llSetLinkPrimitiveParamsFast(LIGHT_PRIM,
                [PRIM_GLOW, LIGHT_FACE, 1,
                    PRIM_POINT_LIGHT, TRUE,
                    LIGHT_COLOR 
                    , 1.0 
                    , 10.0
                    , 0.2 
                ]);
            llSleep(5); // Off Timer
    
            // Off
            llSetLinkPrimitiveParamsFast(LIGHT_PRIM,
                [PRIM_GLOW, ALL_SIDES, FALSE, PRIM_POINT_LIGHT, FALSE,
                    ZERO_VECTOR 
                    , 0.0 
                    , 0.0 
                    , 0 
                ]);               
            }
        }
    }

     

  14. Hello! I make a couple of scripts - sender detector and listener lamp script. when you go through the phantom wall, a collision detector is triggered and a message is transmitted through the channel to turn on the light. The listener turns on the light and off it after a while. But if you go through the wall very fast for several times in a row, the timer adds up and the light glows for a longer time. Is it possible to make the detector not work if the light is already on? As timer i use llSleep().  Thanks!

  15. 20 hours ago, Fritigern Gothly said:

    Well, it's best to create a new app key for each new project and I saw that you kept my example key.

    Imagine you have two different HUDs for two different things. For example, a HUD for shoes that you made, and a HUD for fancy elf ears that you also made. The last thing you want is for your elf ears to get the textures that should go to your shoes. Giving both items a different app key would make sure that will not happen.

    So for the shoes you could do 123456 for the app key, and for the ears you could do 123457, or 3287465, or 11118888848 or some other number. Just to make sure that the channel will be different for each project. 

    The rest looks good-ish to me, although there are a few issues. 

    1. You should define a global variable for CHANNEL. So place "integer CHANNEL;" a few lines above "default".
    2. Remove "integer CHANNEL = Key2AppChan(llGetOwner(), AppKey);" from inside the touch_stgart() event. It's not needed and will confuse the script.
    3. Remove "integer" from the "integer CHANNEL ... " line inside the state_entry() events, the script already knows that it's supposed to be an integer.
    4. Do read the comments that I added. They will give you some information that you need 🙂 

     

    Thank you very much! Hopefully done it correct.

    // Sender HUD 2.0
    
    integer AppKey = 654321; // This is the app key. Create your own app key and make it different for each different project. 
    // Make sure the HUD and the other object share the same app key!
    integer CHANNEL;
    integer Key2AppChan(key ID, integer App)
    {
        return 0x80000000 | ((integer)("0x" + (string) ID) ^ App);
    }
    
    default
    {
        state_entry()
        {
            CHANNEL = Key2AppChan(llGetOwner(), AppKey); // Calculate the channel, based on owner ID and the appkey which we've defined earlier. 
            // ADD THE REST OF YOUR CODE HERE
        }
    
        touch_start(integer total_number)
        {
            llSay(CHANNEL, "Touched");
        }
    }
    // Receiver HUD 2.0
    
    integer AppKey = 654321; // This is the app key. Create your own app key and make it different for each different project. 
    // Make sure the HUD and the other object share the same app key!
    integer CHANNEL;
    integer Key2AppChan(key ID, integer App)
    {
        return 0x80000000 | ((integer)("0x" + (string) ID) ^ App);
    }
    
    default
    {
        state_entry()
        {
            CHANNEL = Key2AppChan(llGetOwner(), AppKey); // Calculate the channel, based on owner ID and the appkey which we've defined earlier. 
            llListen(CHANNEL, "", "", ""); // Listen to anybody saying anything on CHANNEL 
            // ADD THE REST OF YOUR CODE HERE
        }
        listen(integer channel, string name, key id, string msg) 
        {
            if (msg == "Touched")
            {
                llSay(0, "Hello!");
            }
        }
    }

     

  16. So I made these simple examples based on your code. It works! But still maybe I am doing something wrong?

    SENDER

    // SENDER
    
    integer AppKey = 123456; // This is the app key. Create your own app key and make it different for each different project. 
    // Make sure the HUD and the other object share the same app key!
    
    integer Key2AppChan(key ID, integer App)
    {
        return 0x80000000 | ((integer)("0x" + (string) ID) ^ App);
    }
    
    default
    {
        state_entry()
        {
            integer CHANNEL = Key2AppChan(llGetOwner(), AppKey); // Calculate the channel, based on owner ID and the appkey which we've defined earlier. 
            llOwnerSay("I am going to listen on channel " + (string) CHANNEL);
    
            // ADD THE REST OF YOUR CODE HERE
        }
    
    
        touch_start(integer total_number)
        {
            integer CHANNEL = Key2AppChan(llGetOwner(), AppKey);
            llSay(CHANNEL, "Touched");
        }
    }

    LISTENER

    // LISTENER
    
    integer AppKey = 123456; // This is the app key. Create your own app key and make it different for each different project. 
    // Make sure the HUD and the other object share the same app key!
    
    integer Key2AppChan(key ID, integer App)
    {
        return 0x80000000 | ((integer)("0x" + (string) ID) ^ App);
    }
    
    default
    {
        state_entry()
        {
            integer CHANNEL = Key2AppChan(llGetOwner(), AppKey); // Calculate the channel, based on owner ID and the appkey which we've defined earlier. 
            llOwnerSay("I am going to listen on channel " + (string) CHANNEL);
            llListen(CHANNEL, "", "", ""); 
    
            // ADD THE REST OF YOUR CODE HERE
        }
        listen(integer channel, string name, key id, string msg)
        {
            if (msg == "Touched")
            {
                llSay(0, "Hello!");
            }
        }
    }

     

  17. 7 hours ago, Fritigern Gothly said:

    I use a little bit of code to calculate the channel based on the owner's UUID. 

    See http://wiki.secondlife.com/wiki/UUID2Channel for that specific code.
    I usually use the one with the app key, to make sure that each of my projects get a different channel number so that, for example, a texture HUD will not try to use a dance HUD or whatever. It also makes it very unlikely that my HUD will try to control your lights.

    Here's some example code:
     

    
    integer AppKey = 123456;    // This is the app key. Create your own app key and make it different for each different project. 
                                // Make sure the HUD and the other object share the same app key!
    
    integer Key2AppChan(key ID, integer App) {
        return 0x80000000 | ((integer)("0x"+(string)ID) ^ App);
    }
    
    default
    {
        state_entry()
        {
            integer CHANNEL = Key2AppChan(llGetOwner(), AppKey);     // Calculate the channel, based on owner ID and the appkey which we've defined earlier. 
            llOwnerSay("I am going to listen on channel "+(string)CHANNEL);
          	
          	// ADD THE REST OF YOUR CODE HERE
        }
    }

     

    Hello! Thank you very much for this example! It goes to Sender HUD? And what goes to listener object? Will be additional changes? For example now its:

        state_entry()
        {
            llListen(-1234567, "", "", "");
        }
        listen(integer channel, string name, key id, string msg)
        {
            if (msg == "run1true") 
            {
                lightsOn();
                // Turn the light ON
            }
            
            if (msg == "run1false") 
            {
                lightsOff();
                // Turn the light OFF 
            }
        }

     

  18. 13 hours ago, Kardargo Adamczyk said:

    looks something like this:

    
         listen(integer channel, string name, key id, string message)
        {
            if (llGetOwner() == llGetOwnerKey(id) ) 
            {
                if (message == "turn on")
                {
                    //turn on your light here
                }
                else if (message == "turn off")
                {
                    //turn off your light here
                }
            }
        }

     

     

    Thank you very much! It works!

    • Like 1
  19. Hello all and Merry Christmas!

    So I am scripting a HUD here turning on/off wearable lights. Lights have state entry, listener and timer events. 

    But there is a problem. When some one else wearing the lights nearby, I can control them from my HUD. And it not supposed to be.

    How to avoid it? If its Owner detect how it should look like? And the most important - if its owner detect - where it goes? Which event, HUD or lights?

    Thanks!

×
×
  • Create New...