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 tropfen  

tropfen

tropfen.lsl

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

the Zip file

Download all files for tropfen
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. tropfen_1.lsl
1
2 //This is an updated version of a normal particle script- James Hanner
3 // Mask Flags - set to TRUE to enable
4 integer glow = TRUE; // Make the particles glow
5 integer bounce = FALSE; // Make particles bounce on Z plane of object
6 integer interpColor = TRUE; // Go from start to end color
7 integer interpSize = TRUE; // Go from start to end size
8 integer wind = FALSE; // Particles effected by wind
9 integer followSource = TRUE; // Particles follow the source
10 integer followVel = FALSE; // Particles turn to velocity direction
11
12 //Set these as the channel and message to use to turn on and off the system
13 integer ch = 42;
14 string messageon = "";
15 string messageoff = "";
16
17 // Choose a pattern from the following:
18 // PSYS_SRC_PATTERN_EXPLODE
19 // PSYS_SRC_PATTERN_DROP
20 // PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY
21 // PSYS_SRC_PATTERN_ANGLE_CONE
22 // PSYS_SRC_PATTERN_ANGLE
23 integer pattern = PSYS_SRC_PATTERN_DROP;
24
25 // Select a target for particles to go towards
26 // "" for no target, "owner" will follow object owner
27 // and "self" will target this object
28 // and "detected" to use the nearest person
29 // or put the key of an object for particles to go to
30 key target = "";
31
32 // Particle paramaters
33 float age = 4; // Life of each particle
34 float maxSpeed = 15; // Max speed each particle is spit out at
35 float minSpeed = 1.5; // Min speed each particle is spit out at
36 string texture = "28adc6ed-a359-1512-68a9-6a2b4b77c7b7"; // Texture used for particles, default used if blank
37 float startAlpha = .7; // Start alpha (transparency) value
38 float endAlpha = .4; // End alpha (transparency) value
39 vector startColor = <.8,.8,.9>; // Start color of particles <R,G,B>
40 vector endColor = <1,.6,.2>; // End color of particles <R,G,B> (if interpColor == TRUE)
41 vector startSize = <.13,.13,.13>; // Start size of particles
42 vector endSize = <0.11,0.11,0.11>; // End size of particles (if interpSize == TRUE)
43 vector push = <0, 0, -3>; // Force pushed on particles
44
45 // System paramaters
46 float rate = 1; // How fast (rate) to emit particles
47 float radius = 0.2; // Radius to emit particles for BURST pattern
48 integer count = 1; // How many particles to emit per BURST
49 float outerAngle = 0; // Outer angle for all ANGLE patterns float outerAngle = 1.54
50 float innerAngle = 0; // Inner angle for all ANGLE patterns float innerAngle = 1.55
51 vector omega = <0,0,0>; // Rotation of ANGLE patterns around the source
52 float life = 0; // Life in seconds for the system to make particles
53
54 // Script variables
55 integer pre = 2; //Adjust the precision of the generated list.
56
57 integer flags;
58 list sys;
59 integer type;
60 vector tempVector;
61 rotation tempRot;
62 string tempString;
63 integer i;
64
65 string float2String(float in)
66 {
67 return llGetSubString((string)in,0,pre - 7);
68 }
69
70 updateParticles()
71 {
72 flags = 0;
73 if(target == "detected") target = llDetectedKey(0);
74 if(target == "owner") target = llGetOwner();
75 if(target == "self") target = llGetKey();
76 if(glow) flags = flags | PSYS_PART_EMISSIVE_MASK;
77 if(bounce) flags = flags | PSYS_PART_BOUNCE_MASK;
78 if(interpColor) flags = flags | PSYS_PART_INTERP_COLOR_MASK;
79 if(interpSize) flags = flags | PSYS_PART_INTERP_SCALE_MASK;
80 if(wind) flags = flags | PSYS_PART_WIND_MASK;
81 if(followSource) flags = flags | PSYS_PART_FOLLOW_SRC_MASK;
82 if(followVel) flags = flags | PSYS_PART_FOLLOW_VELOCITY_MASK;
83 if(target != "") flags = flags | PSYS_PART_TARGET_POS_MASK;
84 sys = [ PSYS_PART_MAX_AGE,age,
85 PSYS_PART_FLAGS,flags,
86 PSYS_PART_START_COLOR, startColor,
87 PSYS_PART_END_COLOR, endColor,
88 PSYS_PART_START_SCALE,startSize,
89 PSYS_PART_END_SCALE,endSize,
90 PSYS_SRC_PATTERN, pattern,
92 PSYS_SRC_ACCEL, push,
98 PSYS_SRC_ANGLE_BEGIN,innerAngle,
99 PSYS_SRC_ANGLE_END,outerAngle,
100 PSYS_SRC_OMEGA, omega,
101 PSYS_SRC_MAX_AGE, life,
102 PSYS_SRC_TEXTURE, texture,
103 PSYS_PART_START_ALPHA, startAlpha,
104 PSYS_PART_END_ALPHA, endAlpha
105 ];
106
108 }
109
110 default
111 {
114 {
115 updateParticles(); //Start making particles
116 llListen(ch, "", NULL_KEY, messageoff);
117 }
118
119 listen(integer channel, string name, key id, string message)
120 {
121 state off; //Switch to the off state
122 }
123 }
124
125 state off
126 {
128 {
129 llParticleSystem([]); //Stop making particles
130 llListen(ch, "", NULL_KEY, messageon);
131 }
132
133 listen(integer channel, string name, key id, string message)
134 {
135 state default;
136 }
137 }// END //

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