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 Chain_a_Person  

Chain_a_Person

Sends chains to a person so you can lead them around by a leash

Category: Particles
By : Ferd Frederix
Created: 2012-06-05 Edited: 2012-06-05
Worlds: Second Life

the Zip file

Download all files for Chain_a_Person
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Chain_a_Person_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
2 // Particle chain script
3 //
4 // This Script is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
5 //
6 // author: Ferd Frederix
7 // requires a chain texture
8
9 // /1 on to turn on
10 // /1 off to turn off
11 // /1 FirstName Lastname to send a chain to them from this object
12 // /1 Name Resident for new people
13
14 string texturename = "ChainLink";
15 string URL = "http://w-hat.com/name2key"; // name2key url
16 key reqid; // http request id
17 key AvatarKey;
18
19 StartChain(key person)
20 {
21 // MASK FLAGS: set to "TRUE" to enable
22 integer glow = FALSE; // Makes the particles glow
23 integer bounce = FALSE; // Make particles bounce on Z plane of objects
24 integer interpColor = FALSE; // Color - from start value to end value
25 integer interpSize = FALSE; // Size - from start value to end value
26 integer wind = TRUE; // Particles effected by wind
27 integer followSource = TRUE; // Particles follow the source
28 integer followVel = TRUE; // Particles turn to velocity direction
29
30
31
32 integer pattern = PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY; // PSYS_SRC_PATTERN_EXPLODE;
33
34 // Select a target for particles to go towards
35 // "" for no target, "owner" will follow object owner
36 // and "self" will target this object
37 // or put the key of an object for particles to go to
38
39
40
41 // PARTICLE PARAMETERS
42
43 float age = 5; // Life of each particle
44 float maxSpeed = 0.05; // Max speed each particle is spit out at
45 float minSpeed = 0.05; // Min speed each particle is spit out at
46 string texture = texturename; // Texture used for particles, default used if blank
47 float startAlpha = 0.8; // Start alpha (transparency) value
48 float endAlpha = 0.8; // End alpha (transparency) value
49 vector startColor = <0.75,0.85,1>; // Start color of particles <R,G,B>
50 vector endColor = <0.75,0.85,1>; // End color of particles <R,G,B> (if interpColor == TRUE)
51 vector startSize = <0.05,0.05,0.05>; // Start size of particles
52 vector endSize = <0.05,0.05,0.05>; // End size of particles (if interpSize == TRUE)
53 vector push = <0.05,0.0,0.0>; // Force pushed on particles
54
55 // SYSTEM PARAMETERS
56
57 float rate = .025; // How fast (rate) to emit particles
58 float radius = 0.75; // Radius to emit particles for BURST pattern
59 integer count = 4; // How many particles to emit per BURST
60 float outerAngle = 3*PI; // Outer angle for all ANGLE patterns PI/4
61 float innerAngle = 0.5; // Inner angle for all ANGLE patterns
62 vector omega = <0,0,0>; // Rotation of ANGLE patterns around the source
63 float life = 0; // Life in seconds for the system to make particles
64
65 // SCRIPT VARIABLES
66
67 integer flags;
68
69
70 flags = 0;
71
72 if(glow) flags = flags | PSYS_PART_EMISSIVE_MASK;
73 if(bounce) flags = flags | PSYS_PART_BOUNCE_MASK;
74 if(interpColor) flags = flags | PSYS_PART_INTERP_COLOR_MASK;
75 if(interpSize) flags = flags | PSYS_PART_INTERP_SCALE_MASK;
76 if(wind) flags = flags | PSYS_PART_WIND_MASK;
77 if(followSource) flags = flags | PSYS_PART_FOLLOW_SRC_MASK;
78 if(followVel) flags = flags | PSYS_PART_FOLLOW_VELOCITY_MASK;
79 if(person != "") flags = flags | PSYS_PART_TARGET_POS_MASK;
80
82 PSYS_PART_FLAGS,flags,
83 PSYS_PART_START_COLOR, startColor,
84 PSYS_PART_END_COLOR, endColor,
85 PSYS_PART_START_SCALE,startSize,
86 PSYS_PART_END_SCALE,endSize,
87 PSYS_SRC_PATTERN, pattern,
89 PSYS_SRC_ACCEL, push,
95 PSYS_SRC_INNERANGLE,innerAngle,
96 PSYS_SRC_OUTERANGLE,outerAngle,
97 PSYS_SRC_OMEGA, omega,
98 PSYS_SRC_MAX_AGE, life,
99 PSYS_SRC_TEXTURE, texture,
100 PSYS_PART_START_ALPHA, startAlpha,
101 PSYS_PART_END_ALPHA, endAlpha
102 ]);
103
104 }
105
106 StopChain()
107 {
109 }
110
111
112 default
113 {
114 on_rez(integer start_p)
115 {
117 }
118
120 {
121 llListen(1,llGetOwner(),"","");
122 StopChain();
123 }
124
125 listen(integer channel, string name, key id, string message)
126 {
127 if(0 == llSubStringIndex(message, "on"))
128 {
129 if(AvatarKey != NULL_KEY)
130 StartChain(AvatarKey);
131 else
132 StartChain(llGetOwner());
133 }
134 else if(0 == llSubStringIndex(message, "off"))
135 {
136 StopChain();
137 }
138 else
139 {
140 reqid = llHTTPRequest( URL + "?terse=1&name=" + llEscapeURL(message), [], "" );
141 }
142 }
143
144
145 http_response(key id, integer status, list meta, string body) {
146 if( id != reqid )
147 return;
148 if( status == 499 )
149 llOwnerSay("Timed out");
150 else if( status != 200 )
151 llOwnerSay("the internet exploded!!");
152 else if( (key)body == NULL_KEY )
153 llOwnerSay("No body by that name found");
154 else
155 {
156 AvatarKey = body;
157 StartChain(AvatarKey);
158 }
159 }
160 }

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