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
Water Animated-Water  

Animated-Water

Cell Animation and Self Delete

Category: Water
By : Auryn Beorn
Created: 2013-12-13 Edited: 2013-12-13
Worlds: Second Life

the Zip file

Download all files for Animated-Water
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Cell Animation and Self Delete.lsl
Get file # 2. How to create ZERO LAG animated water.txt
Get file # 3. Rotate Smooth and Self Delete.lsl
Get file # 4. Smooth and Self Delete.lsl
Get file # 5. Stop Animated Texture and Self Delete.lsl
Get file # 6. Stop Linked Animated Texture and Self Delete.lsl
1 // [Black Tulip] Anim - Cell Animation & Self Delete
2 // Auryn Beorn - Please don't sell this script! - It's OK to GIVE it FOR FREE
3
4 // Drop me in the prim you want the texture cell animated - I'll clean up after animating
5
6
7 // Need to do changes? Modify the values below in INVENTORY
8 // Then save your script and drop it in the prim you want the texture animated
9
10 integer face = ALL_SIDES; // Face you want animated - ALL_SIDES for all the prim faces
11 float rate = 10.0; // Rate - Low values: Slow - High values: Quick
12
13 integer columns = 3;
14 integer rows = 4;
15
16
17 // No need to change anything from here
18
19 default
20 {
22 {
23 llSetTextureAnim(ANIM_ON | LOOP, face, columns, rows, 0.0, columns * rows, rate);
25 }
26 }

Animated-Water

How to create ZERO LAG animated water

Category: Water
By : Auryn Beorn
Created: 2013-12-13 Edited: 2013-12-13
Worlds: Second Life

1 ----------------------------------------------------------------------------------------------------------
2 :: How to create ZERO LAG animated water ::
3 ----------------------------------------------------------------------------------------------------------
4 By Auryn Beorn (2012)
5
6 ----------------------------------------------------------------------------------------------------------
7 TABLE OF CONTENTS
8
9 PLEASE, SHARE THIS BOX FOR FREE!
10 CREATING ANIMATED WATER ON SL - THE MAIN IDEA
11 CREATING ANIMATED WATER ON SL - THE DETAILS
12 ANIMATED WATER - SLIDING
13 ANIMATED WATER - RIPPLES, WAVES (CELL ANIMATION)
14
15 IMPORTANT NOTES
16 ----------------------------------------------------------------------------------------------------------
17
18 ----------------------------------------------------------------------------------------------------------
19 PLEASE, SHARE THIS BOX FOR FREE!
20 ----------------------------------------------------------------------------------------------------------
21 Creating animated water in SL is a very basic skill that, sadly, the way it's usually performed, contributes in increasing the server side lag. This is by not being aware of the following fact: the scripts to animate water CAN be removed. Instead, they are left in the prims, and thus, SL has plenty of animated water with (unnecessary) scripts which add to server side lag.
22
23 For this reason, I've developed this document, that will teach you how to create zero-lag animated water and put together several animate texture scripts that include a self delete function.
24
25 For the same reason, I want that the content of the folder is FREELY DISTRIBUTED, all together.
26 Please, SHARE with your fellow builders all the contents of this folder, and tell them to do the same.
27
28 If you have questions, please feel free to contact me asking about how to do it.
29
30 The following contents are ALLOWED to be distributed FOR FREE:
31
32 This documentation:
33 [Black Tulip] How to create ZERO LAG animated water
34
35 Scripts:
36 [Black Tulip] Anim - Smooth & Self Delete
37 [Black Tulip] Anim - Rotate Smooth & Self Delete
38 [Black Tulip] Anim - Cell Animation & Self Delete
39 [Black Tulip] Anim - Stop Animated Texture & Self Delete
40
41 Sample Water Textures:
42 [Black Tulip] Sample Water - Seamless (Sliding)
43 [Black Tulip] Sample Water Cols: 3 - Rows: 4 (Cell Animation)
44 [Black Tulip] Sample Water Cols: 4 - Rows: 4 (Cell Animation)
45
46 Thanks for your concern in creating a prettier SL with less lag.
47 ----------------------------------------------------------------------------------------------------------
48 CREATING ANIMATED WATER ON SL - THE MAIN IDEA
49 ----------------------------------------------------------------------------------------------------------
50 The effect of water in SL is usually achieved by using, what we call "animated water." Then particles could also be used to enhance parts like where the water falls against the ground or rocks. For the purposes of this document, which is to create a simple guide for builders creating ZERO LAG animated water, we will focus in using animated textures.
51
52 We may use two specific ways of animating textures in order to get water flowing (rivers/waterfalls/etc) or waving/rippling water (pools/ponds/etc). Both of these ways require a script to start the animation for the texture, and that is true, but, what perhaps you didn't know is...
53
54 ... that once you have your animated prim, you CAN DELETE the script from the primitive.
55
56 What do we achieve with this? We achieve NOT increasing the server side lag due to the existence of scripts inworld. Animated water DOES NOT NEED that scripts remain in the prims: DELETE THEM.
57
58 So this will be the general procedure that we will follow in order to get a primitive with an animated texture to emulate running water.
59
60 - Build your primitive, resize, rotate, etc
61 - Apply on it the water texture you want for it
62 - Drop one of the scripts from this box, depending of the specific kind of animated water we want
63
64 ----------------------------------------------------------------------------------------------------------
65 CREATING ANIMATED WATER ON SL - THE DETAILS
66 ----------------------------------------------------------------------------------------------------------
67 Make sure of being at a place where you can rez.
68
69 Now rez a box. For this you can click the "Build" button at the bottom of your viewer or, alternatively, click CTRL 4. Either case, the edit window will show up, and the mouse pointer will change its icon to a magic wand. Click on the ground, and you'll see the box appearing (if there's lag, this could take a few seconds to appear.)
70
71 Now, under the "General" tab of the edit window, give this box the following name:
72
73 My Water Prim - Test
74
75 Depending on the type of water, you will need one or other texture, and also one or other script.
76
77 If you want water flowing, as you would expect it from a waterfall or a river, you will need to use an appropriate texture and the script to make the water to slide. This is explained under the "Animated Water - Sliding" subsection.
78
79 If you want water waving, or rippling, as you would expect it from a pool or a pond, you will need to use a different kind of texture and another script to make the water to "wave" or "ripple". This is explained under the "Animated Water - Ripples, waves (Cell Animation)" subsection.
80
81 Both subsections explain you how to tweak the corresponding script if you wish to change the speed in the animation, as well as the number of frames for the "cell animation" case.
82
83 If the script does not compile... DON'T DROP IT IN THE PRIM!
84 You will know this because you will see a "Syntax Error" appearing.
85
86 Consider asking for help in groups that offer assistance to creators, if you don't know how to fix this.
87
88 ----------------------------------------------------------------------------------------------------------
89 ANIMATED WATER - SLIDING
90 ----------------------------------------------------------------------------------------------------------
91
92 Edit your "My Water Prim - Test" box. Click the "Texture" tab of the edit window and drop in here the "[Black Tulip] Sample Water - Seamless (Sliding)" texture. This is a seamless texture that will look good no matter which direction you want the texture to flow: you changed that by changing the texture rotation to 0, 90, 180 or 270 degrees.
93
94 Click now the "Content" tab of the edit window and drop the "[Black Tulip] Anim - Smooth & Self Delete" script inside the primitive. It will animate the texture and then self delete.
95
96 If the water is not flowing in the direction you wish to see it, proceed this way:
97
98 Click the "Texture" tab of the edit window.
99 Change the number in the "Rotation" edit box. It's 0 by default in boxes.
100 Interesting values here are:
101 0, 90, 180, 270
102
103 When you have the one you like, close the edit window.
104
105 WATER IS FLOWING TOO FAST/SLOW? HOW CAN I CHANGE THIS?
106
107 Open the "[Black Tulip] Anim - Smooth & Self Delete" from your folder in your inventory.
108 Look for the line saying:
109
110 float rate = 0.025; // Rate - Low values: Slow - High values: Quick
111
112 Change this 0.025 to any other number of seconds you wish. 1.0, 2.25, 0.53...
113
114 Click the "Save" button or hit CTRL S to get the script to save and compile. Once you get the message telling you that the script has compiled, drop it inside the primitive. This will refresh the rate of the animation and self delete again the script.
115
116 ----------------------------------------------------------------------------------------------------------
117 ANIMATED WATER - RIPPLES, WAVES (CELL ANIMATION)
118 ----------------------------------------------------------------------------------------------------------
119
120 Edit your "My Water Prim - Test" box. Click the "Texture" tab of the edit window and drop in here the "[Black Tulip] Sample Water Cols: 3 - Rows: 4 (Cell Animation)" texture. This is a texture containing 12 cells, distributed in 3 columns and 4 rows, that make a total of 12 frames that will be played one after the other to create the illusion of the water rippling.
121
122 Click now the "Content" tab of the edit window and drop the "[Black Tulip] Anim - Cell Animation & Self Delete" script inside the primitive. It will animate the texture and then self delete. You can now close the edit window.
123
124 WATER IS FLOWING TOO FAST/SLOW? HOW CAN I CHANGE THIS?
125 Refer to the previous subsection - Procedure is the same here.
126
127 MY TEXTURE HAS A DIFFERENT NUMBER OF COLUMNS/ROWS - WHAT DO I HAVE TO CHANGE IN THE SCRIPT?
128
129 Open the "[Black Tulip] Anim - Cell Animation & Self Delete" from your folder in your inventory.
130 Look for the lines saying:
131
132 integer columns = 3;
133 integer rows = 4;
134
135 Change those numbers to the number of columns and rows your texture has.
136
137 Those numbers can't contain decimals. An example, the following is NOT correct:
138
139 integer columns = 3.24; // This is WRONG
140 integer rows = 4.75; // This is WRONG
141
142 but the following:
143
144 integer columns = 4;
145 integer rows = 5;
146
147 is CORRECT (and what you would change this to, if your texture had 4 columns and 5 rows - which total 20 frames for your animation.)
148
149 Click the "Save" button or hit CTRL S to get the script to save and compile. Once you get the message telling you that the script has compiled, drop it inside the primitive. This will refresh the rate of the animation and self delete again the script.
150
151 There it is another texture in this folder to help you in practicing with this:
152
153 [Black Tulip] Sample Water Cols: 4 - Rows: 4 (Cell Animation)
154
155 This one has 4 columns and 4 rows. So you should change the numbers in the "[Black Tulip] Anim - Cell Animation & Self Delete" script to:
156
157 integer columns = 4;
158 integer rows = 4;
159
160 save the script, and then drop it into the primitive.
161
162 ----------------------------------------------------------------------------------------------------------
163 IMPORTANT NOTES
164 ----------------------------------------------------------------------------------------------------------
165
166 NOTE: As of 2012-05-29, there's still a bug that will stop the animation on a copied primitive by using the SHIFT COPY technique to duplicate a primitive. You may use a workaround here: Take a copy of your scriptless animated primitive into your inventory, then rez a new copy. The animation is preserved on rez if you have removed the script to activate it.
167
168 More information, here: http://jira.secondlife.com/browse/SVC-3925
169
170 NOTE: To animate water, you won't need to rotate this texture as it's animated, usually, but to complete the collection of scripts with the most used animated texture effects, this box also contains a script named "[Black Tulip] Anim - Rotate Smooth & Self Delete".
171
172 NOTE: If you want to STOP the effect of animating a texture, use the script named "[Black Tulip] Anim - Stop Animated Texture & Self Delete". Edit the prim, drop the script. It will stop any texture animation that could be running.
173
174 NOTE: To STOP all the animated textures in a linked object, use the "[Black Tulip] Anim - Stop Linked Animated Texture & Self Delete" script instead.
175
176
177 All the scripts in this box self delete. Please USE and SHARE them!
178
179 -- Auryn Beorn

Animated-Water

Rotate Smooth and Self Delete

Category: Water
By : Auryn Beorn
Created: 2013-12-13 Edited: 2013-12-13
Worlds: Second Life

1 // [Black Tulip] Anim - Rotate Smooth & Self Delete
2 // Auryn Beorn - Please don't sell this script! - It's OK to GIVE it FOR FREE
3
4 // Drop me in the prim you want the texture rotating - I'll clean up after animating
5
6
7 // Need to do changes? Modify the values below in INVENTORY
8 // Then save your script and drop it in the prim you want the texture animated
9
10 integer face = ALL_SIDES; // Face you want animated - ALL_SIDES for all the prim faces
11 float rate = 0.025; // Rate - Low values: Slow - High values: Quick
12
13
14
15 // No need to change anything from here
16
17 default
18 {
20 {
21 llSetTextureAnim(ANIM_ON | LOOP | SMOOTH | ROTATE, face, 1, 1, 0.0, TWO_PI, rate);
23 }
24 }

Animated-Water

Stop Linked Animated Texture and Self Delete

Category: Water
By : Auryn Beorn
Created: 2013-12-13 Edited: 2013-12-13
Worlds: Second Life

1 // [Black Tulip] Anim - Stop Linked Animated Texture & Self Delete
2 // Auryn Beorn - Please don't sell this script! - It's OK to GIVE it FOR FREE
3
4 // Drop me in the object you want ALL the animated textures to stop - I'll clean up on my own
5
6
7 default
8 {
10 {
11 llSetLinkTextureAnim(LINK_SET, FALSE, ALL_SIDES, 1, 1, 0.0, 0.0, 0.1);
13 }
14 }

Animated-Water

Smooth and Self Delete

Category: Water
By : Auryn Beorn
Created: 2013-12-13 Edited: 2013-12-13
Worlds: Second Life

1 // [Black Tulip] Anim - Smooth & Self Delete
2 // Auryn Beorn - Please don't sell this script! - It's OK to GIVE it FOR FREE
3
4 // Drop me in the prim you want the texture sliding - I'll clean up after animating
5
6
7 // Need to do changes? Modify the values below in INVENTORY
8 // Then save your script and drop it in the prim you want the texture animated
9
10 integer face = ALL_SIDES; // Face you want animated - ALL_SIDES for all the prim faces
11 float rate = 0.025; // Rate - Low values: Slow - High values: Quick
12
13
14
15 // No need to change anything from here
16
17 default
18 {
20 {
21 llSetTextureAnim(ANIM_ON | LOOP | SMOOTH, face, 1, 1, 0.0, 0.0, rate);
23 }
24 }

Animated-Water

Stop Animated Texture and Self Delete

Category: Water
By : Auryn Beorn
Created: 2013-12-13 Edited: 2013-12-13
Worlds: Second Life

1 // [Black Tulip] Anim - Stop Animated Texture & Self Delete
2 // Auryn Beorn - Please don't sell this script! - It's OK to GIVE it FOR FREE
3
4 // Drop me in the prim you want the animated texture to stop - I'll clean up on my own
5
6
7 default
8 {
10 {
11 llSetTextureAnim(FALSE, ALL_SIDES, 1, 1, 0.0, 0.0, 0.1);
13 }
14 }

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