Jump to content

Referencing textures via UUID


SimplifyKidd
 Share

You are about to reply to a thread that has been inactive for 2044 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I want to create an object that can set the texture of a linked object's face (using llSetLinkTexture) by referencing the texture's UUID - ie without actually including the texture inside the object.

My script and object works just fine for me but when someone else buy's my object the llSetLinkTexture command does not seem to work. It's like they don't have access to my textures. I have tried setting the "Group" property to "Share" on the texture (in my inventory) but that does not seem to help. 

Is it not possible to make my textures available for the llSetLinkTexture command without including the textures in the object?

Link to comment
Share on other sites

This "my script won't work when others use it" problem in most cases has something to do with llGetOwner.

From the wiki: "When the owner of an object changes, code that depends on this function's return value will not automatically update for the new owner or be automatically re-evaluated. ... Detection of owner change can be achieved with the changed event in conjunction with the CHANGED_OWNER flag."

So, to make sure your script will work after it's given out to other people, make sure the script will reset itself. Code example is in the wiki.

  • Like 3
Link to comment
Share on other sites

The textures in your inventory that you are going to allow users to view via the UUID will need their permissions setting to allow "transfer", in my experience. I assume that is because somebody else viewing a texture of mine is in some ways having it transferred to them, though only on a temporary basis.

Ignore my waffling, as Wulfie says below permissions are bypassed in this case.

 

Edited by Profaitchikenz Haiku
correcting incorrect statement
  • Like 1
Link to comment
Share on other sites

3 hours ago, Profaitchikenz Haiku said:

The textures in your inventory that you are going to allow users to view via the UUID will need their permissions setting to allow "transfer", in my experience. I assume that is because somebody else viewing a texture of mine is in some ways having it transferred to them, though only on a temporary basis.

This is false. Texture UUIDs bypass the permission system entirely, in every case. This is intentional and applies to sounds as well, but not animations, scripts, or objects.

  • Like 3
Link to comment
Share on other sites

If so I stand corrected, a change must have happened since 2012/3 when I was working on two projects with other people and we had to set the permissions as I stated otherwise we each saw grey faces where the other person's texture UUID should have been displayed.

 

I just went back to the chat logs for the time I was working on Robin's books and although I can find where I told her to change the permissions to get the texture UUID to show, I can't find any earlier logs recording my discovering why I thought that was necessary. I've struck through the incorrect statements above to avoid google giving people misleading hits.

Edited by Profaitchikenz Haiku
accuracy
  • Like 1
Link to comment
Share on other sites

The script is fairly simple. It basically sets some textures based on the content of an object. The idea is to make a trading card album  that shows the trading cards that you have put into the album. I identify the cards in the album by their name, ie all cards have a name that ends with the card number. That number correspond to a position in the list of texture uuids that I have in the variable "Textures". Then there is a simple menu to "navigate" between "pages" in the album.

integer Page;
integer Card;
integer CardSlot;
string CardNumber;
list Textures;
list buttons;
string dialogInfo;
key ToucherID;
integer dialogChannel;
integer listenHandle;

show_page(integer PageNumber)
{
  integer Pocket;
    
  for (Pocket = 1; Pocket <= 6; Pocket++)
  {
    if (PageNumber*6+Pocket < 10) 
    {
        CardNumber = "0" + (string)(PageNumber*6+Pocket);
    }
    else
    {
        CardNumber = (string)(PageNumber*6+Pocket);
    }

    if  (llGetInventoryKey("TPL Trading Card " + CardNumber)) 
    {
        llSetLinkTexture(8-Pocket, llList2Key(Textures,PageNumber*6+Pocket-1), 4);
    }
    else
    {
        llSetLinkTexture(8-Pocket, "b7c32455-6642-59b4-2265-312cb281914a", 4);
    }
    
  }
}

default
{
    changed(integer change)
    {
        if (change & CHANGED_INVENTORY)
        {
          show_page(Page);
        }
    }
        
    state_entry()
    {
        llAllowInventoryDrop(TRUE);
        Page = 0;
        CardSlot = 1;
        Textures = ["3d271494-2ba3-5272-100b-b9e406685b7b",
                    "187e47ee-0f7a-f0ab-9bc4-86092ce2b1a4",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "44aa463b-9bb0-7356-36a7-0c55a000caf3",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "b99340f3-5c19-ce37-de55-51016e2dbd54",
                    "c00cd56a-d847-0b47-9d08-f8924ccd29e2",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "20238f28-1518-ca52-770e-d531e1fd5210",
                    "6546fa01-0e71-bf9b-7b70-86c44a5ef692",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "4dc8b43d-44ea-81c4-21ae-e762b043e2a6",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "28c86214-28ca-7da4-e7fb-3b3dc734e98a",
                    "3a8b4a77-31f0-b0ae-6499-4fe1a10a44e5",
                    "d500342d-c3e3-0a1c-b2a9-5f74fbad51c3",
                    "897c32e0-d0b0-8d26-e781-47571efb308f",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "e11e7d09-2362-fecb-5745-1d709042a05d",
                    "8faea0fa-e5a5-6dbf-395f-e4b0c4951fc1",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "3cba3bc8-cc82-de0a-221a-049635a3c83a",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "56b0b319-09e2-3c0e-2f1e-b883cf58fdcf",
                    "db22e6bc-6122-8185-b185-328d2e13aa00",
                    "99821c47-ab22-ded0-dc83-a9c713a6228e",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "40919944-ed91-37f7-6318-3264653e8442",
                    "8ebda523-2c81-bce6-5954-7a2c165d7e29",
                    "b7c32455-6642-59b4-2265-312cb281914a",
                    "b7c32455-6642-59b4-2265-312cb281914a"];
        buttons = ["<--","Quit","-->","First","Instructions","Last"];
        dialogInfo = "Drop your Twin Peaks Laboratory trading cards into the album content and then navigate your trading card album to view your cards.\nNow viewing page " + (string)(Page+1) + " of 9.";
        show_page(Page);
    }

    touch_start(integer total_number)
    {
        llSetAlpha(0, ALL_SIDES);
        ToucherID = llDetectedKey(0);
        llListenRemove(listenHandle);
        listenHandle = llListen(dialogChannel, "", ToucherID, "");
        dialogInfo = "Drop your Twin Peaks Laboratory trading cards into the album content and then navigate your trading card album to view your cards.\nNow viewing page " + (string)(Page+1) + " of 9.";
        llDialog(ToucherID, dialogInfo, buttons, dialogChannel);
        llSetTimerEvent(100.0); // Here we set a time limit for responses
    }

    listen(integer channel, string name, key id, string message)
    {
        if (message == "-")
        {
            llDialog(ToucherID, dialogInfo, buttons, dialogChannel);
            return;
        }


      if (message == "<--")
      {
        Page--;
        if (Page < 0) Page = 8;
        Card = CardSlot + Page*6;
        show_page(Page);
        dialogInfo = "Drop your Twin Peaks Laboratory trading cards into the album content and then navigate your trading card album to view your cards.\nNow viewing page " + (string)(Page+1) + " of 9.";
        llDialog(ToucherID, dialogInfo, buttons, dialogChannel);
        return;
      }
      else if (message == "-->")
      {
        Page++;
        if (Page > 😎 Page = 0;
        Card = CardSlot + Page*6;
        show_page(Page);
        dialogInfo = "Drop your Twin Peaks Laboratory trading cards into the album content and then navigate your trading card album to view your cards.\nNow viewing page " + (string)(Page+1) + " of 9.";
        llDialog(ToucherID, dialogInfo, buttons, dialogChannel);
        return;
      }
      else if (message == "First")
      {
        Page = 0;
        Card = CardSlot + Page*6;
        show_page(Page);
        dialogInfo = "Drop your Twin Peaks Laboratory trading cards into the album content and then navigate your trading card album to view your cards.\nNow viewing page " + (string)(Page+1) + " of 9.";
        llDialog(ToucherID, dialogInfo, buttons, dialogChannel);
        return;
      }
      else if (message == "Last")
      {
        Page = 8;
        Card = CardSlot + Page*6;
        show_page(Page);
        dialogInfo = "Drop your Twin Peaks Laboratory trading cards into the album content and then navigate your trading card album to view your cards.\nNow viewing page " + (string)(Page+1) + " of 9.";
        llDialog(ToucherID, dialogInfo, buttons, dialogChannel);
        return;
      }
      else if (message == "Instructions")
      {
        llGiveInventory(ToucherID, "Collecting Twin Peaks Laboratory trading cards");
        return;
      }
      else if (message == "Quit")
      {
        llSay(0,"Closing the album...");
        llSetAlpha(1, ALL_SIDES);
        return;
      }
        else
        {
            // do any other action here
        }
        llListenRemove(listenHandle);
        //  stop timer since the menu was clicked
        llSetTimerEvent(0);
    }
 
    timer()
    {
    //  stop timer
        llSetTimerEvent(0);
 
        llListenRemove(listenHandle);
        llWhisper(0, "Sorry. You snooze; you lose.");
    }

    
}
 

Link to comment
Share on other sites

Thanks.    There's nothing that leaps out at me as a problem, either.    Where specifically does it break down?    For instance, does the user see a menu at all?  Do any of the menu commands work (e.g. will it give out the notecard?).   

Have you tried sticking some llOwnerSay messages to try to pinpoint the problem area?

I suspect (and this is no more than an educated guess) that the problem may be to do with 

if  (llGetInventoryKey("TPL Trading Card " + CardNumber)) 

I don't know what inventory type TPL Trading Card# is but reading inventory keys can depend on the owner permissions of the item in question, and there are some oddities with reading the keys of empty notecards, too.

Since the purpose of the test seems simply to be to establish that the item TPL Trading Card# is present in the object's inventory, try changing it to if (llGetInventoryType("TPL Trading Card "+CardNumber) == INVENTORY_NOTECARD) or whatever type it is.   

  • Like 1
Link to comment
Share on other sites

Just a thought, in your Changed event, try adding a changed_owner and forcing a script reset, then seeing if they now see the textures update?

Your project is very similar in concept to a Tarot Quest treasure hunt I wrote back in 2015, instead of inventory_drop the book holder added a card by getting in close proximity to each of the hidden cards, but I had populated the list of texture UUIDs in the assignment section, not state_entry as you have done.

Failing that, I suggest your best way to investigate this is make up a much simpler object with the list of UUIDS and a touch event, each touch increments a counter and updates a face with one of the UUIDs, once you've got that working you should know what the trouble is in your trading card script.

 

Edited by Profaitchikenz Haiku
typos, what else?
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2044 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...