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
Particles Fog_ground  

Fog_ground

Fog_ground.lsl

Category: Particles
By : Anonymous
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Fog_ground
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Fog_ground_1.lsl
1
2 // Lillie's Fog
3
4 integer running=TRUE;
5
6 // Mask Flags - set to TRUE to enable
7 integer glow = TRUE; // Make the particles glow
8 integer bounce = FALSE; // Make particles bounce on Z plan of object
9 integer interpColor = TRUE; // Go from start to end color
10 integer interpSize = TRUE; // Go from start to end size
11 integer wind = FALSE; // Particles effected by wind
12 integer followSource = TRUE; // Particles follow the source
13 integer followVel = TRUE; // Particles turn to velocity direction
14
15 // Choose a pattern from the following:
16 // PSYS_SRC_PATTERN_EXPLODE
17 // PSYS_SRC_PATTERN_DROP
18 // PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY
19 // PSYS_SRC_PATTERN_ANGLE_CONE
20 // PSYS_SRC_PATTERN_ANGLE
21 integer pattern = PSYS_SRC_PATTERN_ANGLE_CONE;
22
23 // Select a target for particles to go towards
24 // "" for no target, "owner" will follow object owner
25 // and "self" will target this object
26 // or put the key of an object for particles to go to
27 key target = "self";
28
29 // Particle paramaters
30 float age = 100; // Life of each particle <-- invrease that value for larger fog
31 float maxSpeed = 1; // Max speed each particle is spit out at
32 float minSpeed = 1; // Min speed each particle is spit out at
33 string texture; // Texture used for particles, default used if blank
34 float startAlpha = 0.4; // Start alpha (transparency) value
35 float endAlpha = 0.05; // End alpha (transparency) value
36 vector startColor = <.8,.8,.8>; // Start color of particles <R,G,B>
37 vector endColor = <.7,0.7,0.7>; // End color of particles <R,G,B> (if interpColor == TRUE)
38 vector startSize = <2, 2, 2>; // Start size of particles
39 vector endSize = <4.0,4.0,0.0>; // End size of particles (if interpSize == TRUE)
40 vector push = <0,0,0>; // Force pushed on particles
41
42 // System paramaters
43 float rate = .5; // How fast (rate) to emit particles
44 float radius = 3; // Radius to emit particles for BURST pattern
45 ////////////////////////////////////////////////////////////////////
46 integer count = 10; // How many particles to emit per BURST <-- increase that value for more tense fog
47 ////////////////////////////////////////////////////////////////////
48 float outerAngle = 1.57; // Outer angle for all ANGLE patterns
49 float innerAngle = 1.58; // Inner angle for all ANGLE patterns
50 vector omega = <0,0,1>; // Rotation of ANGLE patterns around the source
51 float life = 0; // Life in seconds for the system to make particles
52
53 // Script variables
54 integer flags;
55
56 FOGParticles()
57 {
58 if(target == "owner") target = llGetOwner();
59 if(target == "self") target = llGetKey();
60 if(glow) flags = flags | PSYS_PART_EMISSIVE_MASK;
61 if(bounce) flags = flags | PSYS_PART_BOUNCE_MASK;
62 if(interpColor) flags = flags | PSYS_PART_INTERP_COLOR_MASK;
63 if(interpSize) flags = flags | PSYS_PART_INTERP_SCALE_MASK;
64 if(wind) flags = flags | PSYS_PART_WIND_MASK;
65 if(followSource) flags = flags | PSYS_PART_FOLLOW_SRC_MASK;
66 if(followVel) flags = flags | PSYS_PART_FOLLOW_VELOCITY_MASK;
67 if(target != "") flags = flags | PSYS_PART_TARGET_POS_MASK;
68
70 PSYS_PART_FLAGS,flags,
71 PSYS_PART_START_COLOR, startColor,
72 PSYS_PART_END_COLOR, endColor,
73 PSYS_PART_START_SCALE,startSize,
74 PSYS_PART_END_SCALE,endSize,
75 PSYS_SRC_PATTERN, pattern,
77 PSYS_SRC_ACCEL, push,
83 PSYS_SRC_ANGLE_BEGIN,innerAngle,
84 PSYS_SRC_ANGLE_END,outerAngle,
85 PSYS_SRC_OMEGA, omega,
86 PSYS_SRC_MAX_AGE, life,
87 PSYS_SRC_TEXTURE, texture,
88 PSYS_PART_START_ALPHA, startAlpha,
89 PSYS_PART_END_ALPHA, endAlpha
90 ]);
91 }
92
93 default
94 {
96 {
97 //llSetText("",<0,0,0>,0);
98 running=TRUE;
99 llWhisper(0,"Fog on ...");
100 FOGParticles();
101 }
102 touch_start(integer num_detected)
103 {
104 if(running==TRUE)
105 {
106 running=FALSE;
107 llWhisper(0,"Fog off ...");
109 }
110 else
111 {
112 running=TRUE;
113 llWhisper(0,"Fog on ...");
114 FOGParticles();
115 }
116 }
117 }
118 // END //

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