Join us in Phaze Demesnes or follow us:

Home   Show All
Category: Contributor: Creator
Bling Blingonblingoffscript  

Blingonblingoffscript

Bling-on-bling-off-script.lsl

Category: Bling
By : Stormy Roentgren
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life + OpenSim

the Zip file

Download all files for Blingonblingoffscript
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Blingonblingoffscript_1.lsl
1
2
3 //BLING PARTICLES FOR BLINGY JEWELS AND STUFF Adapted by Stormy Roentgren
4
5 //For those not knowing how to alter particle scripts, the parameters you'll want to alter here (if you choose to) are the "float rate" and the start and end sizes.
6
7 // Channel to listen for "bling on" "bling off" commands
8 integer channel = 7;
9
10 // Particle Script 0.3
11 // Created by Ama Omega
12 // 10-10-2003
13
14 // Mask Flags - set to TRUE to enable
15 integer glow = TRUE; // Make the particles glow
16 integer bounce = FALSE; // Make particles bounce on Z plan of object
17 integer interpColor = TRUE; // Go from start to end color
18 integer interpSize = TRUE; // Go from start to end size
19 integer wind = FALSE; // Particles effected by wind
20 integer followSource = FALSE; // Particles follow the source
21 integer followVel = TRUE; // Particles turn to velocity direction
22
23 // Choose a pattern from the following:
24 // PSYS_SRC_PATTERN_EXPLODE
25 // PSYS_SRC_PATTERN_DROP
26 // PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY
27 // PSYS_SRC_PATTERN_ANGLE_CONE
28 // PSYS_SRC_PATTERN_ANGLE
29 integer pattern = PSYS_SRC_PATTERN_EXPLODE;
30
31 // Select a target for particles to go towards
32 // "" for no target, "owner" will follow object owner
33 // and "self" will target this object
34 // or put the key of an object for particles to go to
35 key target = "";
36
37 // Particle paramaters
38 float age = .2; // Life of each particle
39 float maxSpeed = .1; // Max speed each particle is spit out at
40 float minSpeed = .1; // Min speed each particle is spit out at
41 string texture; // Texture used for particles, default used if blank
42 float startAlpha = 10; // Start alpha (transparency) value
43 float endAlpha = 10; // End alpha (transparency) value
44 vector startColor = <1,1,1>; // Start color of particles <R,G,B>
45 vector endColor = <1,1,1>; // End color of particles <R,G,B> (if interpColor == TRUE)
46 vector startSize = <.04,.25,.01>; // Start size of particles
47 vector endSize = <.03,.25,.01>; // End size of particles (if interpSize == TRUE)
48 vector push = <0,0,0>; // Force pushed on particles
49
50 // System paramaters
51 float rate = 5; // How fast (rate) to emit particles
52 float radius = .0; // Radius to emit particles for BURST pattern
53 integer count = 5; // How many particles to emit per BURST
54 float outerAngle = 1.54; // Outer angle for all ANGLE patterns
55 float innerAngle = 1.55; // Inner angle for all ANGLE patterns
56 vector omega = <0,0,10>; // 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 integer flags;
61
62 updateParticles()
63 {
64 flags = 0;
65 if (target == "owner") target = llGetOwner();
66 if (target == "self") target = llGetKey();
67 if (glow) flags = flags | PSYS_PART_EMISSIVE_MASK;
68 if (bounce) flags = flags | PSYS_PART_BOUNCE_MASK;
69 if (interpColor) flags = flags | PSYS_PART_INTERP_COLOR_MASK;
70 if (interpSize) flags = flags | PSYS_PART_INTERP_SCALE_MASK;
71 if (wind) flags = flags | PSYS_PART_WIND_MASK;
72 if (followSource) flags = flags | PSYS_PART_FOLLOW_SRC_MASK;
73 if (followVel) flags = flags | PSYS_PART_FOLLOW_VELOCITY_MASK;
74 if (target != "") flags = flags | PSYS_PART_TARGET_POS_MASK;
75
77 PSYS_PART_FLAGS,flags,
78 PSYS_PART_START_COLOR, startColor,
79 PSYS_PART_END_COLOR, endColor,
80 PSYS_PART_START_SCALE,startSize,
81 PSYS_PART_END_SCALE,endSize,
82 PSYS_SRC_PATTERN, pattern,
84 PSYS_SRC_ACCEL, push,
90 PSYS_SRC_INNERANGLE,innerAngle,
91 PSYS_SRC_OUTERANGLE,outerAngle,
92 PSYS_SRC_OMEGA, omega,
93 PSYS_SRC_MAX_AGE, life,
94 PSYS_SRC_TEXTURE, texture,
95 PSYS_PART_START_ALPHA, startAlpha,
96 PSYS_PART_END_ALPHA, endAlpha
97 ]);
98 }
99
100 // Small change made by Compulov Weeks on 2006-09-14... will listen on
101 // channel 7 for "bling on" or "bling off" to activate and deactivate
102
103 default
104 {
105 on_rez(integer start_param)
106 {
108 }
109
111 {
112 llListen(channel, "", llGetOwner(), "");
113 }
114
115 listen(integer channel, string name, key id, string message)
116 {
117 if (message == "bling off")
118 {
119 llOwnerSay("Turning bling off");
121 }
122
123 else if (message == "bling on")
124 {
125 llOwnerSay("Turning bling on");
126 updateParticles();
127 }
128 }
129 } // end