|
Robert Gylling
Registered User
Join date: 20 Aug 2006
Posts: 13
|
10-29-2006 21:41
i accidentally posted this in the other scripting forum, im reposting and modifying it due to my reading of the rules etc etc
i have a friend whos getting married in SL soon, and i want to make for her a fancy picture frame that can cycle between several snapshots i have of the couple
i can make the frame myself, but i have ZERO experiance with scripting, and i was wondering if someone could help me with it...
i work long hours and 6 days a week, so its doubtful ill be able to meet in game, tho i would be glad to work with them through IMs
but if possable, i want to accually LEARN the script, not just cut and paste it...
tho im more then willing to do that if i need to
edit: also, if anyone knows of a link to a page that explains how to make the script i need, that would be very apreciated
i have no $L so i am unable to buy the script, thats why im MAKING the gift in the first place lol
|
|
grumble Loudon
A Little bit a lion
Join date: 30 Nov 2005
Posts: 612
|
10-29-2006 22:36
The lowest prim picture frame is a cube that is tapered and then squashed. Next you need to find out the side number. You can use ctrl-alt-shift-t while the editor has "Select texture" and you have one side face selected. If you use negitive taper, Side zero will be the side you want. integer g_number =0; default() { touch_start(integer num_detected){ // Then you need to get the texure key or name. string TextureName = llGetInventoryName(INVENTORY_TEXTURE, g_number); ++g_number; if (TextureName == ""){ g_number = 0; }else{ //Then you can aply it to a side using llSetTexture(TextureName, side from editor); }; } }
Also DO NOT have it cycling by itself since SL has a Sim Side memory leak and the more textures you show, the slower it gets. It is better to have it touch activated since this allows the person to decide when to move to the next image.
|
|
ArchTx Edo
Mystic/Artist/Architect
Join date: 13 Feb 2005
Posts: 1,993
|
10-30-2006 17:46
I sent you a prim with this slide veiwer script, just add photos to the prim and it rotates thru them. This slide viewer does cycle by itself, I don't know what a "Sim Side Memory leak" is exactly, but I had two of these slide viewers running in my house for months without noticing any problems. I never noticed any slowdown. integer gPicIndex = 0; integer gBalance = 0; integer gTotalPics; integer switchspeed = 10; //Set seconds before next picture here
flip() { string picName = llGetInventoryName(INVENTORY_TEXTURE, gPicIndex); llSetTexture(picName, ALL_SIDES); integer picNumber = gPicIndex + 1; }
flipForward() { if (gPicIndex < gTotalPics - 1) gPicIndex++; else gPicIndex = 0; flip(); }
flipBackward() { if (gPicIndex > 0) gPicIndex--; else gPicIndex = gTotalPics - 1; flip(); }
default { state_entry() { gTotalPics = llGetInventoryNumber(INVENTORY_TEXTURE); flip(); llListen(0, "", llGetOwner(), ""); llListen(69, "", "", ""); llSetTimerEvent(switchspeed); } timer() { flipForward(); llSetTimerEvent(switchspeed); } }
_____________________
 VRchitecture Model Homes at http://slurl.com/secondlife/Shona/60/220/30 http://www.slexchange.com/modules.php?name=Marketplace&MerchantID=2240 http://shop.onrez.com/Archtx_Edo
|
|
grumble Loudon
A Little bit a lion
Join date: 30 Nov 2005
Posts: 612
|
10-31-2006 02:39
Note: When using the one-prim frame, you do not need a seperate prim to hold the images. The images and the script all go into the one-prim frame and update face zero. If you can't figure out which prim face is which, just drop the script in and see which one changes and then taper and squash. Change flip() { string picName = llGetInventoryName(INVENTORY_TEXTURE, gPicIndex); llSetTexture(picName, ALL_SIDES);
to flip() { string picName = llGetInventoryName(INVENTORY_TEXTURE, gPicIndex); llSetTexture(picName, 0);
|