Jump to content

Question on Picture Frame Script


Prokofy Neva
 Share

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

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

Recommended Posts

This script below was made by Foolish Frost years ago to enable you to have a one-prim only picture "frame" that then displayed pictures.

So if you pop it into a prim, you will see an iron and wood template of a frame he made display on one face, and then if you put textures into the prim, you will see them display one by one.

But what I can't figure out is how to replace his frame texture with my own wooden one. I plugged in the UUID of my own texture into places in the script where it seemed required, one or both. But while it pops it in, then I can't get the other textures I put in the prim to display. So something is wrong but I don't know what.

 

****

 

float time = 30.0;

integer DISPLAY_ON_SIDE = 5; //Change this to change where the image will be displayed
integer current_texture = 0; //Current texture number in inventory being displayed (picture mode)
key BLANK = "5748decc-f629-461c-9a36-a35a221fe21f"; //Blank texture - Used when there are no textures to display in Picture mode

pictures() //Change mode to Picture Viewer
{
//Change prim to Light material while coloring face 0 black to prevent light-lag generation.
vector height = llGetScale();
llSetPrimitiveParams([PRIM_BUMP_SHINY,DISPLAY_ON_SIDE,PRIM_SHINY_NONE,PRIM_BUMP_NONE,PRIM_COLOR,DISPLAY_ON_SIDE,<0,0,0>,1.0,PRIM_MATERIAL,PRIM_MATERIAL_LIGHT]);
llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_BOX, PRIM_HOLE_SQUARE, <0.0, 1.0, 0.0>, 0.90, <0.0, 0.0, 0.0>, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, PRIM_SIZE, <height.x, height.x * 0.020, height.x * 0.720>]);
llSetColor(<0,0,0>,ALL_SIDES);
llSetColor(<1,1,1>,3);
llSetColor(<1,1,1>,5);
llSetTexture(BLANK,ALL_SIDES);
llSetTexture("3cb3fc81-b4dc-25c4-59e8-4be619d1fff6",3);
llScaleTexture(1, 1, ALL_SIDES);
llScaleTexture(-4.400, 1.200, DISPLAY_ON_SIDE);
llOffsetTexture(0.0, 0.0, ALL_SIDES);
llOffsetTexture(-0.705, 0.000, DISPLAY_ON_SIDE);

//Initilize variables
current_texture = 0;

//Set to first texture if available
integer check = llGetInventoryNumber(INVENTORY_TEXTURE);
if(check > 0)
display_texture(check);
else
{
llSetObjectDesc("No pictures found.");
llSetTexture(BLANK,DISPLAY_ON_SIDE);
}
}

display_texture(integer check) //Display texture and set name in description (picture mode)
{ //"Check" holds the number of textures in contents. The function uses "current_texture" to display.
string name = llGetInventoryName(INVENTORY_TEXTURE,current_texture);
//llSay(0,(string)llGetInventoryKey(name));
llSetTexture(name,DISPLAY_ON_SIDE);
llSetObjectDesc("Showing picture: "+name+" ("+(string)(current_texture+1)+"/"+(string)check+")");
}

next() //Change to next texture (picture mode)
{ //This function is used twice - by the menu and timer. Therefor, it is a dedicated function.
current_texture++;
integer check = llGetInventoryNumber(INVENTORY_TEXTURE);
if(check == 0)
{
llSetTexture(BLANK,DISPLAY_ON_SIDE);
current_texture = 0;
llSetObjectDesc("No pictures found.");
return;
}
if(check == current_texture)
current_texture = 0;

display_texture(check);
return;
}

 

default
{
state_entry()
{
pictures();
llSetTimerEvent(time);
}

touch_start(integer total_number)
{
llSetTimerEvent(0.1);
}

timer()
{
next(); //Next picture
llSetTimerEvent(time);
}

}

Link to comment
Share on other sites

In line 14

 edited to say that I changed the frame texture in the script, so the texture UUID below is not the same as yours.

 

float time = 30.0;integer DISPLAY_ON_SIDE = 5; //Change this to change where the image will be displayedinteger current_texture = 0; //Current texture number in inventory being displayed (picture mode)key BLANK = "5748decc-f629-461c-9a36-a35a221fe21f"; //Blank texture - Used when there are no textures to display in Picture modepictures() //Change mode to Picture Viewer{//Change prim to Light material while coloring face 0 black to prevent light-lag generation.vector height = llGetScale();llSetPrimitiveParams([PRIM_BUMP_SHINY,DISPLAY_ON_SIDE,PRIM_SHINY_NONE,PRIM_BUMP_NONE,PRIM_COLOR,DISPLAY_ON_SIDE,<0,0,0>,1.0,PRIM_MATERIAL,PRIM_MATERIAL_LIGHT]);llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_BOX, PRIM_HOLE_SQUARE, <0.0, 1.0, 0.0>, 0.90, <0.0, 0.0, 0.0>, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, PRIM_SIZE, <height.x, height.x * 0.020, height.x * 0.720>]);llSetColor(<0,0,0>,ALL_SIDES);llSetColor(<1,1,1>,3);llSetColor(<1,1,1>,5);llSetTexture(BLANK,ALL_SIDES);llScaleTexture(1, 1, ALL_SIDES);llScaleTexture(-4.400, 1.200, DISPLAY_ON_SIDE);llOffsetTexture(0.0, 0.0, ALL_SIDES);llOffsetTexture(-0.705, 0.000, DISPLAY_ON_SIDE);//Initilize variablescurrent_texture = 0;//Set to first texture if availableinteger check = llGetInventoryNumber(INVENTORY_TEXTURE);if(check > 0)display_texture(check);else{llSetObjectDesc("No pictures found.");llSetTexture(BLANK,DISPLAY_ON_SIDE);}}display_texture(integer check) //Display texture and set name in description (picture mode){ //"Check" holds the number of textures in contents. The function uses "current_texture" to display.string name = llGetInventoryName(INVENTORY_TEXTURE,current_texture);//llSay(0,(string)llGetInventoryKey(name));llSetTexture(name,DISPLAY_ON_SIDE);llSetObjectDesc("Showing picture: "+name+" ("+(string)(current_texture+1)+"/"+(string)check+")");}next() //Change to next texture (picture mode){ //This function is used twice - by the menu and timer. Therefor, it is a dedicated function.current_texture++;integer check = llGetInventoryNumber(INVENTORY_TEXTURE);if(check == 0){llSetTexture(BLANK,DISPLAY_ON_SIDE);current_texture = 0;llSetObjectDesc("No pictures found.");return;}if(check == current_texture)current_texture = 0;display_texture(check);return;} default{state_entry(){pictures();llSetTimerEvent(time);}touch_start(integer total_number){llSetTimerEvent(0.1);}timer(){next(); //Next picturellSetTimerEvent(time);}}

 

Link to comment
Share on other sites

Hi,

 

As I noted in my original post:

 

I plugged in the UUID of my own texture into places in the script where it seemed required, one or both.

 

I already did what you have done. And that's why I turned to the forums -- it didn't work.

The template texture I made obliterates the other textures, and they don't shine through. I did make them with the magic wand in Paint so that they have clear texture in the middle. But something is wrong.

Link to comment
Share on other sites

It seems like your texture, while you think it is clear in the middle, doesn't really have transparency there.

I've just checked the script and it works fine if you change the frame texture to another one with proper transparency.

You're welcome to send me a copy (can we attach pics to PM's?) and I'll check (and if needed fix) it.

Link to comment
Share on other sites

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...