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 Gush_Blood  

Gush_Blood

Gush_Blood

Category: Particles
By : Ferd Frederix
Created: 2013-09-06 Edited: 2011-06-13
Worlds: Second Life

the Zip file

Download all files for Gush_Blood
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Gush_Blood_1.lsl

This script by Ferd Frederix may be used in any manner, modified, and republished.  Unless specified otherwise, my scripts are always free and open source.  Objects made with these scripts may be sold with no restrictions.  All I ask is that you point others to this location should they ask you about it and to not sell this script, unless it is for $0 L. Please help improve my work by reporting bugs and improvements.

1 // TRUE = Gush blood on startup
2 // False = Listen on channel 0 for commands
3 integer bStartImmediately = FALSE;
4 StartSteam()
5 {
6 // MASK FLAGS: set to "TRUE" to enable
7 integer glow = TRUE; // Makes the particles glow
8 integer bounce = FALSE; // Make particles bounce on Z plane of objects
9 integer interpColor = TRUE; // Color - from start value to end value
10 integer interpSize = TRUE; // Size - from start value to end value
11 integer wind = FALSE; // Particles effected by wind
12 integer followSource = FALSE; // Particles follow the source
13 integer followVel = TRUE; // Particles turn to velocity direction
14
15
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_ANGLE; // PSYS_SRC_PATTERN_EXPLODE;
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 // or put the key of an object for particles to go to
29
30 key target = "";
31
32
33 // PARTICLE PARAMETERS
34
35 float age = 2.4; // Life of each particle
36 float maxSpeed = 20.0; // Max speed each particle is spit out at
37 float minSpeed = 10; // Min speed each particle is spit out at
38 string texture = "0498c309-5306-43cd-82a2-ae31d096cdef"; // Texture used for particles, default used if blank
39 float startAlpha = 0.5; // Start alpha (transparency) value
40 float endAlpha = 0.5; // End alpha (transparency) value
41 vector startColor = <1,0,0>; // Start color of particles <R,G,B>
42 vector endColor = <0.6,0,0>; // End color of particles <R,G,B> (if interpColor == TRUE)
43 vector startSize = <1.0,2.0,1.0>; // Start size of particles
44 vector endSize = <1,2,1.0>; // End size of particles (if interpSize == TRUE)
45 vector push = <0.0,0.0,-5.0>; // Force pushed on particles
46
47 // SYSTEM PARAMETERS
48
49 float rate = 0.1; // How fast (rate) to emit particles
50 float radius = 0.25; // Radius to emit particles for BURST pattern
51 integer count = 40; // How many particles to emit per BURST
52 float outerAngle = 4*PI; // Outer angle for all ANGLE patterns PI/4
53 float innerAngle = 0.5; // Inner angle for all ANGLE patterns
54 vector omega = <0,0,0>; // Rotation of ANGLE patterns around the source
55 float life = 0; // Life in seconds for the system to make particles
56
57 // SCRIPT VARIABLES
58
59 integer flags;
60
61
62 flags = 0;
63
64 if(glow) flags = flags | PSYS_PART_EMISSIVE_MASK;
65 if(bounce) flags = flags | PSYS_PART_BOUNCE_MASK;
66 if(interpColor) flags = flags | PSYS_PART_INTERP_COLOR_MASK;
67 if(interpSize) flags = flags | PSYS_PART_INTERP_SCALE_MASK;
68 if(wind) flags = flags | PSYS_PART_WIND_MASK;
69 if(followSource) flags = flags | PSYS_PART_FOLLOW_SRC_MASK;
70 if(followVel) flags = flags | PSYS_PART_FOLLOW_VELOCITY_MASK;
71 if(target != "") flags = flags | PSYS_PART_TARGET_POS_MASK;
72
74 PSYS_PART_FLAGS,flags,
75 PSYS_PART_START_COLOR, startColor,
76 PSYS_PART_END_COLOR, endColor,
77 PSYS_PART_START_SCALE,startSize,
78 PSYS_PART_END_SCALE,endSize,
79 PSYS_SRC_PATTERN, pattern,
81 PSYS_SRC_ACCEL, push,
87 PSYS_SRC_INNERANGLE,innerAngle,
88 PSYS_SRC_OUTERANGLE,outerAngle,
89 PSYS_SRC_OMEGA, omega,
90 PSYS_SRC_MAX_AGE, life,
91 PSYS_SRC_TEXTURE, texture,
92 PSYS_PART_START_ALPHA, startAlpha,
93 PSYS_PART_END_ALPHA, endAlpha
94 ]);
95
96 }
97 StartSpray ()
98 {
99
100 }
101
102 StopSpray()
103 {
105 }
106
107
108
109 default
110 {
112 {
113 if(bStartImmediately==TRUE){
114 StartSteam();
115 } else {
116 llOwnerSay("spray (on|off) to gush blood");
117 llListen(0,"",NULL_KEY,"");
118 }
119 }
120
121 listen(integer channel, string name, key id, string message)
122 {
123
124 if(0 == llSubStringIndex(message, "spray on"))
125 {
126 StartSteam();
127
128 }
129 else if(0 == llSubStringIndex(message, "spray off"))
130 {
131 StopSpray();
132 }
133 }
134 }

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