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
Swarm Swarming Bees  

Swarming Bees

Swarm of bees

Category: Swarm
By : Anonymous
Created: 2013-09-06 Edited: 2013-09-04
Worlds: Second Life

the Zip file

Download all files for Swarming Bees
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Script.lsl
1
2 //Swarming Bee's By: Frankwhiteaka Blanco
3 // TRUE = swarm bees on startup
4 // False = Listen on channel 0 for commands
5 integer bStartImmediately = FALSE;
6 StartSteam()
7 {
8 // MASK FLAGS: set to "TRUE" to enable
9 integer glow = FALSE; // Makes the particles glow
10 integer bounce = FALSE; // Make particles bounce on Z plane of objects
11 integer interpColor = TRUE; // Color - from start value to end value
12 integer interpSize = TRUE; // Size - from start value to end value
13 integer wind = FALSE; // Particles effected by wind
14 integer followSource = FALSE; // Particles follow the source
15 integer followVel = TRUE; // Particles turn to velocity direction
16
17
18
19 // Choose a pattern from the following:
20 // PSYS_SRC_PATTERN_EXPLODE
21 // PSYS_SRC_PATTERN_DROP
22 // PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY
23 // PSYS_SRC_PATTERN_ANGLE_CONE
24 // PSYS_SRC_PATTERN_ANGLE
25 integer pattern = PSYS_SRC_PATTERN_EXPLODE; // PSYS_SRC_PATTERN_EXPLODE;
26
27 // Select a target for particles to go towards
28 // "" for no target, "owner" will follow object owner
29 // and "self" will target this object
30 // or put the key of an object for particles to go to
31
32 key target = "";
33
34
35 // PARTICLE PARAMETERS
36
37 float age = 1; // Life of each particle
38 float maxSpeed = 1.5; // Max speed each particle is spit out at
39 float minSpeed = 1; // Min speed each particle is spit out at
40 string texture = "8ff51374-338a-9e0e-c7d6-fca4c722ff29"; // Texture used for particles, default used if blank
41 float startAlpha = 100; // Start alpha (transparency) value
42 float endAlpha = 100; // End alpha (transparency) value
43 vector startColor = <1,1,1>; // Start color of particles <R,G,B>
44 vector endColor = <1,1,1>; // End color of particles <R,G,B> (if interpColor == TRUE)
45 vector startSize = <.1,.1,.1>; // Start size of particles
46 vector endSize = <.1,.1,.1>; // End size of particles (if interpSize == TRUE)
47 vector push = <0.0,0.0,-2.0>; // Force pushed on particles
48
49 // SYSTEM PARAMETERS
50
51 float rate = 0.01; // How fast (rate) to emit particles
52 float radius = 0.25; // Radius to emit particles for BURST pattern
53 integer count = 120; // How many particles to emit per BURST
54 float outerAngle = 4*PI; // Outer angle for all ANGLE patterns PI/4
55 float innerAngle = 0; // Inner angle for all ANGLE patterns
56 vector omega = <0,0,0>; // Rotation of ANGLE patterns around the source
57 float life = 0; // Life in seconds for the system to make particles
58
59 // SCRIPT VARIABLES
60
61 integer flags;
62
63
64 flags = 0;
65
66 if(glow) flags = flags | PSYS_PART_EMISSIVE_MASK;
67 if(bounce) flags = flags | PSYS_PART_BOUNCE_MASK;
68 if(interpColor) flags = flags | PSYS_PART_INTERP_COLOR_MASK;
69 if(interpSize) flags = flags | PSYS_PART_INTERP_SCALE_MASK;
70 if(wind) flags = flags | PSYS_PART_WIND_MASK;
71 if(followSource) flags = flags | PSYS_PART_FOLLOW_SRC_MASK;
72 if(followVel) flags = flags | PSYS_PART_FOLLOW_VELOCITY_MASK;
73 if(target != "") flags = flags | PSYS_PART_TARGET_POS_MASK;
74
76 PSYS_PART_FLAGS,flags,
77 PSYS_PART_START_COLOR, startColor,
78 PSYS_PART_END_COLOR, endColor,
79 PSYS_PART_START_SCALE,startSize,
80 PSYS_PART_END_SCALE,endSize,
81 PSYS_SRC_PATTERN, pattern,
83 PSYS_SRC_ACCEL, push,
89 PSYS_SRC_INNERANGLE,innerAngle,
90 PSYS_SRC_OUTERANGLE,outerAngle,
91 PSYS_SRC_OMEGA, omega,
92 PSYS_SRC_MAX_AGE, life,
93 PSYS_SRC_TEXTURE, texture,
94 PSYS_PART_START_ALPHA, startAlpha,
95 PSYS_PART_END_ALPHA, endAlpha
96 ]);
97
98 }
99 StartSpray ()
100 {
101
102 }
103
104 StopSpray()
105 {
107 }
108
109
110
111 default
112 {
114 {
115 if(bStartImmediately==TRUE){
116 StartSteam();
117 } else {
118 llOwnerSay("bee (swarm|stop) to make bee's swarm");
119 llListen(0,"",NULL_KEY,"");
120 }
121 }
122
123 listen(integer channel, string name, key id, string message)
124 {
125
126 if(0 == llSubStringIndex(message, "bee swarm"))
127 {
128 StartSteam();
129
130 }
131 else if(0 == llSubStringIndex(message, "bee stop"))
132 {
133 StopSpray();
134 }
135 }
136 }
137

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