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 blood  

blood

blood!.lsl

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

the Zip file

Download all files for blood
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. blood_1.lsl
1
2 //////////////////////////////////////////////////////////////////
3 //////////////////////////////////////////////////////////////////
4 //// eltee Statosky's Particle Creation Engine 1.0
5 //// 01/09/2004
6 //// *PUBLIC DOMAIN*
7 //// Free to use
8 //// Free to copy
9 //// Free to poke at
10 //// Free to hide in stuff you sell
11 //// Just please leave this header intact
12 //////////////////////////////////////////////////////////////////
13 //////////////////////////////////////////////////////////////////
14 string texturer = "e08ab401-2945-29f7-0797-a6c67a405b5b";
15 integer effectFlags=0;
16 integer running=TRUE;
17 key owner;
18
19 ///////////////////////////////////////////////////////
20 // Color Secelection Variables
21 ///////////////////////////////////////////////////////
22 // Interpolate between startColor and endColor
23 integer colorInterpolation = TRUE;
24 // Starting color for each particle
25 vector startColor = <1,1,1>;
26 // Ending color for each particle
27 vector endColor = <1, 1, 1>;
28 // Starting Transparency for each particle (1.0 is solid)
29 float startAlpha = 0.8;
30 // Ending Transparency for each particle (0.0 is invisible)
31 float endAlpha = 0.3;
32 // Enables glow around particles
33 integer glowEffect = TRUE;
34
35
36 ///////////////////////////////////////////////////////
37 // Size & Shape Selection Variables
38 ///////////////////////////////////////////////////////
39 // Interpolate between startSize and endSize
40 integer sizeInterpolation = TRUE;
41 // Starting size of each particle
42 vector startSize = <0.5, 0.5, 0.5>;
43 // Ending size of each particle
44 vector endSize = <0.5, 0.5, 0.5>;
45 // Turns particles to face their movement direction
46 integer followVelocity = TRUE;
47 // Texture the particles will use ("" for default)
48 string texture = texturer;
49
50
51 ///////////////////////////////////////////////////////
52 // Timing & Creation Variables Variables
53 ///////////////////////////////////////////////////////
54 // Lifetime of one particle (seconds)
55 float particleLife = 2.0;
56 // Lifetime of the system 0.0 for no time out (seconds)
57 float SystemLife = 0.0;
58 // Number of seconds between particle emissions
59 float emissionRate = 0.20;
60 // Number of particles to releast on each emission
61 integer partPerEmission = 5;
62
63
64 ///////////////////////////////////////////////////////
65 // Angular Variables
66 ///////////////////////////////////////////////////////
67 // The radius used to spawn angular particle patterns
68 float radius = 0.0;
69 // Inside angle for angular particle patterns
70 float innerAngle = 0;
71 // Outside angle for angular particle patterns
72 float outerAngle = 0;
73 // Rotational potential of the inner/outer angle
74 vector omega = <2.0, 2.0, 0.2>;
75
76
77 ///////////////////////////////////////////////////////
78 // Movement & Speed Variables
79 ///////////////////////////////////////////////////////
80 // The minimum speed a particle will be moving on creation
81 float minSpeed = 0.0;
82 // The maximum speed a particle will be moving on creation
83 float maxSpeed = 0.1;
84 // Global acceleration applied to all particles
85 vector acceleration = <0.0, 0.0, -0.5>;
86 // If true, particles will be blown by the current wind
87 integer windEffect = FALSE;
88 // if true, particles 'bounce' off of the object's Z height
89 integer bounceEffect = FALSE;
90 // If true, particles spawn at the container object center
91 integer followSource = TRUE;
92 // If true, particles will move to expire at the target
93 //integer followTarget = TRUE;
94 // Desired target for the particles (any valid object/av key)
95 // target Needs to be set at runtime
96 key target = "";
97
98
99 ///////////////////////////////////////////////////////
100 //As yet unimplemented particle system flags
101 ///////////////////////////////////////////////////////
102 integer randomAcceleration = TRUE;
103 integer randomVelocity = TRUE;
104 integer particleTrails = TRUE;
105
106 ///////////////////////////////////////////////////////
107 // Pattern Selection
108 ///////////////////////////////////////////////////////
109 // Uncomment the pattern call you would like to use
110 // Drop parcles at the container objects' center
111 //integer pattern = PSYS_SRC_PATTERN_DROP;
112 // Burst pattern originating at objects' center
113 //integer pattern = PSYS_SRC_PATTERN_EXPLODE;
114 // Uses 2D angle between innerAngle and outerAngle
115 // integer pattern = PSYS_SRC_PATTERN_ANGLE;
116 // Uses 3D cone spread between innerAngle and outerAngle
117 integer pattern = PSYS_SRC_PATTERN_EXPLODE ;
118 //
119 //integer pattern = PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY
120
121
122
123 setParticles()
124 {
125 // Here is where to set the current target
126 // llGetKey() targets this script's container object
127 // llGetOwner() targets the owner of this script
128 // Feel free to insert any other valid key
129 target="";
130 // The following block of if statements is used to construct the mask
131 if(colorInterpolation) effectFlags = effectFlags|PSYS_PART_INTERP_COLOR_MASK;
132 if(sizeInterpolation) effectFlags = effectFlags|PSYS_PART_INTERP_SCALE_MASK;
133 if(windEffect) effectFlags = effectFlags|PSYS_PART_WIND_MASK;
134 if(bounceEffect) effectFlags = effectFlags|PSYS_PART_BOUNCE_MASK;
135 if(followSource) effectFlags = effectFlags|PSYS_PART_FOLLOW_SRC_MASK;
136 if(followVelocity) effectFlags = effectFlags|PSYS_PART_FOLLOW_VELOCITY_MASK;
137 if(target!="") effectFlags = effectFlags|PSYS_PART_TARGET_POS_MASK;
138 if(glowEffect) effectFlags = effectFlags|PSYS_PART_EMISSIVE_MASK;
139 //Uncomment the following selections once they've been implemented
140 // if(randomAcceleration) effectFlags = effectFlags|PSYS_PART_RANDOM_ACCEL_MASK;
141 // if(randomVelocity) effectFlags = effectFlags|PSYS_PART_RANDOM_VEL_MASK;
142 // if(particleTrails) effectFlags = effectFlags|PSYS_PART_TRAIL_MASK;
144 PSYS_PART_FLAGS, effectFlags,
145 PSYS_SRC_PATTERN, pattern,
146 PSYS_PART_START_COLOR, startColor,
147 PSYS_PART_END_COLOR, endColor,
148 PSYS_PART_START_ALPHA, startAlpha,
149 PSYS_PART_END_ALPHA, endAlpha,
150 PSYS_PART_START_SCALE, startSize,
151 PSYS_PART_END_SCALE, endSize,
152 PSYS_PART_MAX_AGE, particleLife,
153 PSYS_SRC_ACCEL, acceleration,
154 PSYS_SRC_TEXTURE, texture,
155 PSYS_SRC_BURST_RATE, emissionRate,
156 PSYS_SRC_INNERANGLE, innerAngle,
157 PSYS_SRC_OUTERANGLE, outerAngle,
158 PSYS_SRC_BURST_PART_COUNT, partPerEmission,
161 PSYS_SRC_BURST_SPEED_MAX, maxSpeed,
162 PSYS_SRC_MAX_AGE, SystemLife,
163 PSYS_SRC_TARGET_KEY, target,
164 PSYS_SRC_OMEGA, omega ]);
165 }
166
167 default
168 {
169 on_rez(integer start)
170 {
171 owner = llGetOwner();
172 }
174 {
175 llSetBuoyancy(0.0);
176 llCollisionSound("",0.0);
180 }
181 collision_start(integer detected)
182 {
183 integer type = llDetectedType(0);
184 key person = llDetectedKey(0);
185 if(type & AGENT)
186 {
187 if(person != owner)
188 {
189 llSetForce(<0,0,0>, TRUE);
190 running=TRUE;
191 setParticles();
192 llTriggerSound("hit", 0.7);
193 llSetBuoyancy(-0.1);
194 llSleep(1.0);
195 running=FALSE;
197 llSetStatus(STATUS_PHANTOM, TRUE);
198 llDie();
199 }
200 }
201 else
202 {llDie();}
203 }
204 land_collision(vector pos)
205 {
207 llSetStatus(STATUS_PHANTOM, TRUE);
208 llDie();
209
210 }
211
212
213
214 }
215 // END //

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