Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Texture UUID from remote

Over Sleeper
I Dream in LSL
Join date: 12 Jan 2006
Posts: 141
08-12-2006 21:44
I have this script that cycles through the etxtures that are in my picture viewer. What I would like to do is not have the textures in the viewer but have them remote somewhere so I can change them without having to send all my friends ew pictures to put in. Is there a way to do that? If not, then how can I just use the Texture UUID's instead of putting the in the prim. I have more than one so I need to list several in the script somehow and get it to read them.

Any help is thankful from me.

CODE
default
{
state_entry()
{
llSetTimerEvent(10);
}
timer()
{
integer number = llGetInventoryNumber(INVENTORY_TEXTURE);
float rand = llFrand(number);
integer choice = (integer)rand;
string name = llGetInventoryName(INVENTORY_TEXTURE, choice);
if (name != "")
llSetTexture(name, ALL_SIDES);
}
}
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
08-12-2006 21:55
You can plug a UUID into the llSetTexture() function... like llSetTexture("UUID-HERE", ALL_SIDES);

You could also create a server prim which would reside on your property, not to be de-rezed or moved out of sim. The server could contain a notecard with a list of all the texture UUIDs you wish to display. The remote viewers could have an update button which would llEmail() your server and request the UUID for the notecard. The remote viewer would finally read the notecard and store a list of texture UUIDs to display in sequence.

Note, you want to protect the server because it's UUID will change every time it is re-rezzed. And since your email communications between viewer-server require this UUID, it's best to prevent the server UUID from being changed.
Over Sleeper
I Dream in LSL
Join date: 12 Jan 2006
Posts: 141
08-12-2006 22:06
Cool,

I think I understand how to read the notecards...does it matter if I am using a UUID instead of a notecard name?

In my code, it currently looks for the inventory items, how to get it to look inthat notecard UUID?
Xixao Dannunzio
Owner, X3D Enterprises
Join date: 20 Mar 2006
Posts: 114
08-12-2006 23:21
We meet again, Over Sleeper ;)

Here's your script:
CODE

string gName = "Textures";
integer gLine = 0;
key gQueryID;

default {
state_entry() {
gQueryID = llGetNotecardLine(gName, gLine);
llSetTimerEvent(10);
}

dataserver(key query_id, string data) {
if (query_id == gQueryID) {
if (data != EOF) {
llSetTexture(data, ALL_SIDES);
}else{
gLine = 0;
gQueryID = llGetNotecardLine(gName, gLine);
}
}
}

timer()
{
++gLine;
gQueryID = llGetNotecardLine(gName, gLine);
}
}



Set that in your object, and add a notecard named "Textures". Set the notecard up as follows:
CODE

xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx


Replace "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" with the UUID for each texture. One per line, no blank lines.

Enjoy ;)



Edit
Just noticed the "remote" part of that. If they're in the same sim, create your 'remote' object, and set this in it:

CODE

string gName = "Textures";
integer channel = -44;
integer gLine = 0;
key gQueryID;

default {
state_entry() {
gQueryID = llGetNotecardLine(gName, gLine);
llSetTimerEvent(10);
}

dataserver(key query_id, string data) {
if (query_id == gQueryID) {
if (data != EOF) {
llShout(channel, data);
}else{
gLine = 0;
gQueryID = llGetNotecardLine(gName, gLine);
}
}
}

timer()
{
++gLine;
gQueryID = llGetNotecardLine(gName, gLine);
}
}



Then add this script to the item displaying the textures:
CODE

integer channel = -44;

default {
state_entry() {
llListen(channel, "", NULL_KEY, "");
}

listen(integer channel, string name, key id, string msg)
{
llSetTexture(msg, ALL_SIDES);
}
}



Use the same notecard in the 'remote' object.
Laerdal Woodget
Registered User
Join date: 27 Feb 2007
Posts: 5
You've caught my attention...
03-06-2007 15:02
From: Xixao Dannunzio
If they're in the same sim, create your 'remote' object, and set this in it...


What about if they are NOT in the same sim?
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
03-07-2007 01:48
From: Laerdal Woodget
What about if they are NOT in the same sim?



You could email them the UUID's

Something else to be aware off, I think this only works with full mod items, if you try to get the key of a restricted item using llGetInventoryKey it will return NULL_KEY.