|
Wolfgang Zhichao
Registered User
Join date: 6 Jan 2007
Posts: 10
|
04-02-2007 05:29
Hello all,
I have searched the forum for any hint of what i am looking for.
Basiclt, i want to have a prim that holds all my images and i can click th cycle through them (perhaps with a forward and backwards option) and once i find the texture i want, i pres a "send" button and it sends it to another prim.
basicly i am making a cheap photo studio for a friend. i have made it with a background and floor that if you touch the background, the texture of BOTH background and floor change to the same image, and if you touch the floor, it will change just the floor image.
It would be nice to be able to choose the background instead of it being random from the contents of the prim.
|
|
Sys Slade
Registered User
Join date: 15 Feb 2007
Posts: 626
|
04-02-2007 06:05
Here's soemthing I knocked up quickly. In the receiving prim: string currtext="";
default{ changed(integer change){ if(change & CHANGED_INVENTORY){ integer invc=llGetInventoryNumber(INVENTORY_TEXTURE); if(invc==2){ // texture added llRemoveInventory(currtext); currtext=llGetInventoryName(INVENTORY_TEXTURE,0); llSetTexture(currtext,ALL_SIDES); }else if(currtext=="" && invc==1){ // first texture added currtext=llGetInventoryName(INVENTORY_TEXTURE,0); llSetTexture(currtext,ALL_SIDES); } } } touch_start(integer total_number){ if(llDetectedKey(0)==llGetOwner()) llOwnerSay(llGetKey()); } }
Touch that prim to get the key, which you will need for the next prim. In the sender: integer textcount; integer currtext; key otherobj="cbad02c2-90b5-8617-0355-8160d8e04728"; // the key from other prim
default{ state_entry(){ textcount=llGetInventoryNumber(INVENTORY_TEXTURE); }
touch_start(integer total_number){ llGiveInventory(otherobj,llGetInventoryName(INVENTORY_TEXTURE,currtext)); currtext++; if(currtext>=textcount) currtext=0; } }
Drop the textures you want in the sender prim, then touch it to change the texture on the receiver.
|
|
Learjeff Innis
musician & coder
Join date: 27 Nov 2006
Posts: 817
|
04-02-2007 11:11
You can do this without a script in the receiving prim, as long as the texture is copy/modify to the owner of the object, something like this: ... textureKey = llGetInventoryKey(textureName); llSetLinkTexture(primNum, textureKey)
where primNum is the link number of the receiving prim.
|
|
Sys Slade
Registered User
Join date: 15 Feb 2007
Posts: 626
|
04-02-2007 12:10
Yep, linked prims would work better. Only look at my script if the prims are not linked.
|
|
Wolfgang Zhichao
Registered User
Join date: 6 Jan 2007
Posts: 10
|
thanks
04-07-2007 05:49
thanks all for the script! i have come to the conclusion that i can not script...lol i have tried but i just flat cant. now, building is another story, i'm getting better at that....  and is there a way to preview the texture before sending it to the display prim? basicly here is what i have done. i hae made a cheap 2 prim background photo studio. i have found a script that changes the texture in linked prims and a script for changing texture in a single prim. i places the changed linked texture script in the wall part and added all my textures to that part, then put the change single prim texture script in the floor and added textures to that. it works good, and looks good. when i touch the background wall, the texture on the floor and the wall change to the same texture, if i need to change the floor texture to something else, i can touch the floor and it will change just the floor and the wall texture will remail as i choose...but i have to cycle through all the textures to find just the one i want and because its random, it alot of the time will show me the same texture several times. i'm looking for something that i can cycle through the textures in a prim, find the one i want, then send it to the wall/floor prims to change it.
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
04-07-2007 06:32
From: Wolfgang Zhichao thanks all for the script! i have come to the conclusion that i can not script...lol i have tried but i just flat cant. now, building is another story, i'm getting better at that....  and is there a way to preview the texture before sending it to the display prim? basicly here is what i have done. i hae made a cheap 2 prim background photo studio. i have found a script that changes the texture in linked prims and a script for changing texture in a single prim. i places the changed linked texture script in the wall part and added all my textures to that part, then put the change single prim texture script in the floor and added textures to that. it works good, and looks good. when i touch the background wall, the texture on the floor and the wall change to the same texture, if i need to change the floor texture to something else, i can touch the floor and it will change just the floor and the wall texture will remail as i choose...but i have to cycle through all the textures to find just the one i want and because its random, it alot of the time will show me the same texture several times. i'm looking for something that i can cycle through the textures in a prim, find the one i want, then send it to the wall/floor prims to change it. You already have all the components you need to do this. Just add 2 new prims as 'preview' panes on a controller and then a select button to send the texture requests to the other prims.
|