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 Chains  

Chains

Sends particle chains to another prim, like for a drawbridge

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

the Zip file

Download all files for Chains
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. chain script.lsl
Get file # 2. [9380 bytes] chain.png

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
2
3
4 // sends particle chains to the owner
5 // Particle System 1.0
6
7 StartSteam()
8 {
9 // MASK FLAGS: set to "TRUE" to enable
10 integer glow = FALSE; // Makes the particles glow
11 integer bounce = FALSE; // Make particles bounce on Z plane of objects
12 integer interpColor = FALSE; // Color - from start value to end value
13 integer interpSize = FALSE; // Size - from start value to end value
14 integer wind = TRUE; // Particles effected by wind
15 integer followSource = TRUE; // Particles follow the source
16 integer followVel = TRUE; // Particles turn to velocity direction
17
18
19
20 // Choose a pattern from the following:
21 // PSYS_SRC_PATTERN_EXPLODE
22 // PSYS_SRC_PATTERN_DROP
23 // PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY
24 // PSYS_SRC_PATTERN_ANGLE_CONE
25 // PSYS_SRC_PATTERN_ANGLE
26 integer pattern = PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY; // PSYS_SRC_PATTERN_EXPLODE;
27
28 // Select a target for particles to go towards
29 // "" for no target, "owner" will follow object owner
30 // and "self" will target this object
31 // or put the key of an object for particles to go to
32
33 //key target = "2d180e40-017a-a88a-76cd-ec84c773dac5";
34 // key target = "e32b8b3e-ebab-06fe-590d-df4bcceeb73b";
35 key target = llGetOwner();
36 // PARTICLE PARAMETERS
37
38 float age = 5; // Life of each particle
39 float maxSpeed = 0.05; // Max speed each particle is spit out at
40 float minSpeed = 0.05; // Min speed each particle is spit out at
41 string texture = "chain"; // Texture used for particles, default used if blank
42 float startAlpha = 0.8; // Start alpha (transparency) value
43 float endAlpha = 0.8; // End alpha (transparency) value
44 vector startColor = <0.75,0.85,1>; // Start color of particles <R,G,B>
45 vector endColor = <0.75,0.85,1>; // End color of particles <R,G,B> (if interpColor == TRUE)
46 vector startSize = <0.05,0.05,0.05>; // Start size of particles
47 vector endSize = <0.05,0.05,0.05>; // End size of particles (if interpSize == TRUE)
48 vector push = <0.05,0.0,0.0>; // Force pushed on particles
49
50 // SYSTEM PARAMETERS
51
52 float rate = .025; // How fast (rate) to emit particles
53 float radius = 0.75; // Radius to emit particles for BURST pattern
54 integer count = 4; // How many particles to emit per BURST
55 float outerAngle = 3*PI; // Outer angle for all ANGLE patterns PI/4
56 float innerAngle = 0.5; // Inner angle for all ANGLE patterns
57 vector omega = <0,0,0>; // Rotation of ANGLE patterns around the source
58 float life = 0; // Life in seconds for the system to make particles
59
60 // SCRIPT VARIABLES
61
62 integer flags;
63
64
65 flags = 0;
66
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 StartSpray ()
101 {
102
103
104
105 }
106
107 StopSpray()
108 {
110 }
111
112
113
114 default
115 {
116
117 changed(integer change)
118 {
119 if(change & CHANGED_OWNER)
121
122 }
123
124
126 {
127 StartSteam();
128 // llOwnerSay(llGetKey());
129 }
130
131 listen(integer channel, string name, key id, string message)
132 {
133
134 if(0 == llSubStringIndex(message, "chain on"))
135 {
136 StartSteam();
137
138 }
139 else if(0 == llSubStringIndex(message, "chain off"))
140 {
141 StopSpray();
142 }
143 }
144 }

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