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 Fireworks  

Fireworks

Ama Omega Particle Script 0.lsl

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

the Zip file

Download all files for Fireworks
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Fireworks_1.lsl
1
2 // Particle Script 0.5
3 // Created by Ama Omega
4 // 3-26-2004
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 plane 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 = TRUE; // 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_EXPLODE;
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 = 1; // Life of each particle
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 = 1; // Start alpha (transparency) value
35 float endAlpha = 0.1; // End alpha (transparency) value
36 vector startColor = <0,1,0>; // Start color of particles <R,G,B>
37 vector endColor = <1,0,0>; // End color of particles <R,G,B> (if interpColor == TRUE)
38 vector startSize = <1,1,1>; // Start size of particles
39 vector endSize = <1,0,1>; // End size of particles (if interpSize == TRUE)
40 vector push = <0,0,0>; // Force pushed on particles
41
42 // System paramaters
43 float rate = 1.5; // How fast (rate) to emit particles
44 float radius = 1; // Radius to emit particles for BURST pattern
45 integer count = 1; // How many particles to emit per BURST
46 float outerAngle = 1.54; // Outer angle for all ANGLE patterns
47 float innerAngle = 1.55; // Inner angle for all ANGLE patterns
48 vector omega = <0,0,0>; // Rotation of ANGLE patterns around the source
49 float life = 0; // Life in seconds for the system to make particles
50
51 // Script variables
52 integer pre = 2; //Adjust the precision of the generated list.
53
54 integer flags;
55 list sys;
56 integer type;
57 vector tempVector;
58 rotation tempRot;
59 string tempString;
60 integer i;
61
62 string float2String(float in)
63 {
64 return llGetSubString((string)in,0,pre - 7);
65 }
66
67 updateParticles()
68 {
69 flags = 0;
70 if(target == "owner") target = llGetOwner();
71 if(target == "self") target = llGetKey();
72 if(glow) flags = flags | PSYS_PART_EMISSIVE_MASK;
73 if(bounce) flags = flags | PSYS_PART_BOUNCE_MASK;
74 if(interpColor) flags = flags | PSYS_PART_INTERP_COLOR_MASK;
75 if(interpSize) flags = flags | PSYS_PART_INTERP_SCALE_MASK;
76 if(wind) flags = flags | PSYS_PART_WIND_MASK;
77 if(followSource) flags = flags | PSYS_PART_FOLLOW_SRC_MASK;
78 if(followVel) flags = flags | PSYS_PART_FOLLOW_VELOCITY_MASK;
79 if(target != "") flags = flags | PSYS_PART_TARGET_POS_MASK;
80 sys = [ PSYS_PART_MAX_AGE,age,
81 PSYS_PART_FLAGS,flags,
82 PSYS_PART_START_COLOR, startColor,
83 PSYS_PART_END_COLOR, endColor,
84 PSYS_PART_START_SCALE,startSize,
85 PSYS_PART_END_SCALE,endSize,
86 PSYS_SRC_PATTERN, pattern,
88 PSYS_SRC_ACCEL, push,
94 PSYS_SRC_INNERANGLE,innerAngle,
95 PSYS_SRC_OUTERANGLE,outerAngle,
96 PSYS_SRC_OMEGA, omega,
97 PSYS_SRC_MAX_AGE, life,
98 PSYS_SRC_TEXTURE, texture,
99 PSYS_PART_START_ALPHA, startAlpha,
100 PSYS_PART_END_ALPHA, endAlpha
101 ];
102
104 }
105
106 default
107 {
109 {
110 updateParticles();
111 }
112
114 {
115 llWhisper(0,"...Generating List...");
116 for (i=1;i<42;i+=2)
117 {
118 type = llGetListEntryType(sys,i);
119 if(type == TYPE_FLOAT)
120 {
121 tempString = float2String(llList2Float(sys,i));
122 sys = llDeleteSubList(sys,i,i);
123 sys = llListInsertList(sys,[tempString],i);
124 }
125 else if(type == TYPE_VECTOR)
126 {
127 tempVector = llList2Vector(sys,i);
128 tempString = "<" + float2String(tempVector.x) + ","
129 + float2String(tempVector.y) + ","
130 + float2String(tempVector.z) + ">";
131 sys = llDeleteSubList(sys,i,i);
132 sys = llListInsertList(sys,[tempString],i);
133 }
134 else if(type == TYPE_ROTATION)
135 {
136 tempRot = llList2Rot(sys,i);
137 tempString = "<" + float2String(tempRot.x) + ","
138 + float2String(tempRot.y) + ","
139 + float2String(tempRot.z) + ","
140 + float2String(tempRot.s) + ">";
141 sys = llDeleteSubList(sys,i,i);
142 sys = llListInsertList(sys,[tempString],i);
143 }
144 else if(type == TYPE_STRING || type == TYPE_KEY)
145 {
146 tempString = "\"" + llList2String(sys,i) + "\"";
147 sys = llDeleteSubList(sys,i,i);
148 sys = llListInsertList(sys,[tempString],i);
149 }
150 }
151 sys = llListSort(sys,2,TRUE);
152 if(target == "") sys = llDeleteSubList(sys,38,39);
153 else if(target == llGetKey() )
154 sys = llListInsertList(llDeleteSubList(sys,39,39),["llGetKey()"],39);
155 else if(target == llGetOwner() )
156 sys = llListInsertList(llDeleteSubList(sys,39,39),["llGetOwner()"],39);
157 if(texture == "") sys = llDeleteSubList(sys,24,25);
158 if(!interpSize) sys = llDeleteSubList(sys,12,13);
159 if(!interpColor) sys = llDeleteSubList(sys,6,7);
160
161 llWhisper(0,"[" + llList2CSV(llList2List(sys,0,21)) + ",");
162 llWhisper(0,llList2CSV(llList2List(sys,22,-1)) + "]");
163 }
164 }// END //

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