Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Signs LumVision_Presentation_Script_v2  

LumVision_Presentation_Script_v2

This is my script for an in-world slide show. Rez a cube and fill it with textures followed by this script. If the textures are named to be sequential, this presentations script will display each texture in that order.

Touch the cube to start. A drop down menu will provide options to go back, go forward in the sequence of textures, or reset the script.

Category: Signs
By : Lum Pfohl
Created: 2011-01-22 Edited: 2011-01-22
Worlds: Second Life

the Zip file

Download all files for LumVision_Presentation_Script_v2
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. LumVision_Presentation_Script_v2_1.lsl
1 //
2 // LumVision-Presentation Script v 0.2
3 //
4 // Written by Lum Pfohl December 11, 2007
5 //
6 // January 02, 2008 - Added code to precache the next texture after a short time delay
7
8
9 // set to TRUE if you want debug messages written to chat screen
10 integer __debug = FALSE;
11 string __version_id = "LumVision-Presentation Script v 0.2";
12
13 // global variables
14 integer interval;
15 integer currentTexture = 0;
16 integer previousTexture = 0;
17 integer totalTextures = 0;
18 list textureList =[];
19 integer messageChannel = 999888;
20 list dynMenu =["Back", "Version", "Forward", "Reset"];
21
22 // this is a list of all the possible inventory types, as constants.
26
27 // this list is of the string names corresponding to the one above.
28 list list_names = ["None", "Texture", "Sound", "Landmark", "Clothing", "Object", "Notecard",
29 "Script", "Body Part", "Animation", "Gesture"];
30
31 default {
32 state_entry() {
33
34 // read in the textures in the prim and store it
36
37 integer j;
38
39 for (j = 0; j < typeCount; ++j) {
41 if(__debug) {
42 llWhisper(0, "Inventory " + invName);
43 }
44 textureList += invName;
45 ++totalTextures;
46 }
47
48 if(__debug) {
49 llWhisper(0, "Found " + (string) totalTextures + " textures");
50 }
51
52 llSetTexture(llList2String(textureList, 0), 0);
53
54
55 // initialize the channel on which the vendor will talk to the owner via dialog
56 messageChannel = (integer) llFrand(2000000000.0);
57 llListen(messageChannel, "", NULL_KEY, "");
58 // llOwnerSay((string)messageChannel);
59 currentTexture = 0;
60 }
61
62 on_rez(integer start_param) {
64 }
65
66
67 touch_start(integer total_number) {
68
69 if(llDetectedKey(0) == llGetOwner()) {
70 llDialog(llDetectedKey(0), "What do you want to do?", dynMenu, messageChannel);
71 }
72
73 }
74
75 // listen for for dialog box messages and respond to them as appropriate
76
77 listen(integer channel, string name, key id, string message) {
78
79 if(id != llGetOwner()) {
80 return;
81 }
82
83 if(message == "Version") {
84 llWhisper(0, __version_id);
85 return;
86 }
87
88 if(message == "Reset") {
90 }
91
92 if(message == "Back" && currentTexture > 0) {
93 previousTexture = currentTexture;
94 --currentTexture;
95 } else if(message == "Forward" && (currentTexture >= 0) && (currentTexture < totalTextures)) {
96 previousTexture = currentTexture;
97 ++currentTexture;
98
99 } else {
100 llDialog(llGetOwner(), "What do you want to do?", dynMenu, messageChannel);
101 return;
102 }
103
104 // If there are textures to apply, do so now. Otherwise - quietly
105 // do nothing.
106 if(totalTextures > 0) {
107
108 // Ensure that we do not go out of bounds with the index
109 if(currentTexture >= totalTextures) {
110 currentTexture = 0;
111 }
112 // Set the new prim texture
113 llSetTexture(llList2String(textureList, currentTexture), 0);
114
115 // set up so that in 3 seconds, we display the next image on a different face (hidden)
116 llSetTimerEvent(3.00);
117
118 llDialog(llGetOwner(), "What do you want to do?", dynMenu, messageChannel);
119 }
120 }
121
122 timer() {
123 // Cancel any further timer events
124 llSetTimerEvent(0.00);
125
126 // set the next texture (as a pre-cache) on the reverse face
127 integer nextTexture = currentTexture + 1;
128 if(nextTexture >= totalTextures) {
129 nextTexture = 0;
130 }
131 llSetTexture(llList2String(textureList, nextTexture), 1);
132 }
133
134 }

Back to the Best Free Tools in Second Life and OpenSim.