Home |
Add a script
|
||
|---|---|---|---|
| Category: | Contributor: | Description | |
| Particles | Ferd Frederix | Haert shower when two people are near | |
This script will spray a tall shower of red hearts when two or more avatars are near.
The Script - paste into a prim and click the prim.
Download this script - Please use this link to get this script. If you see all the code on one long line, please use Wordpad or another editor, such as LSLEdit.exe. The .LSL file you will download is an ordinary text file.

This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License unless stated otherwise in the script below), by Fred Beckhusen, aka Ferd Frederix.
NC - No Commerce clause means that the sale of the script is NOT allowed. This means you cannot sell my scripts but you can give them away if they are FREE. This script may be included in a prim or other object and the object itself sold. Putting my script in a prim and selling it on marketplace or anywhere else is not allowed (except for free).
BY - You must leave author credits intact in any script you use or republish.
--ooo------///-----|(------ooo------///-----|(------ooo----
1 // Created by Ama Omega 3-7-2004 2 // Updated by Jopsy Pendragon 5-11-2004 3 // sensor for 2 people added by Ferd Frederix 10-15-2011 4 5 6 // SECTION ONE: APPEARANCE -- These settings affect how each particle LOOKS. 8 vector startColor = <1,0,0>; // RGB color, black<0,0,0> to white<1,1,1>(*) 9 vector endColor = <1,0,0>; // 10 float startAlpha = 1.0; // 0.0 to 1.0(*), lower = more transparent 11 float endAlpha = 1.0; // 12 vector startSize = <0.1,0.1,0>; // <0.04,0.04,0>(min) to <10,10,0>(max>, <1,1,0>(*) 14 key texture = "419c3949-3f56-6115-5f1c-1f3aa85a4606"; // Texture used for particles. Texture must be in prim's inventory. 15 16 // SECTION TWO: FLOW -- These settings affect how Many, how Quickly, and for how Long particles are created. 17 // Note, 18 integer count = 5; // Number of particles created per burst, 1(*) to 4096 19 float rate = 0.1; // Delay between bursts of new particles, 0.0 to 60, 0.1(*) 20 float age = 3.0; // How long each particle lives, 0.1 to 60, 10.0(*) 21 float life = 0.0; // When to stop creating new particles. never stops if 0.0(*) 22 23 // SECTION THREE: PLACEMENT -- Where are new particles created, and what direction are they facing? 24 float radius = .30; // 0.0(default) to 64? Distance from Emitter where new particles are created. 26 float outerAngle = 0.0; // "tilt", for ANGLE patterns, 0(default) to TWO_PI, can use PI_BY_TWO or PI as well. 28 // PSYS_SRC_PATTERN_EXPLODE (sends particles in all directions) 29 // PSYS_SRC_PATTERN_DROP (ignores minSpeed and maxSpeed. Don't bother with count>1 ) 30 // PSYS_SRC_PATTERN_ANGLE_CONE (set innerangle/outerange to make rings/cones of particles) 31 // PSYS_SRC_PATTERN_ANGLE (set innerangle/outerangle to make flat fanshapes of particles) 32 vector omega = <0,0,0>; // How much to rotate the emitter around the <X,Y,Z> axises. <0,0,0>(*) 33 // Warning, there's no way to RESET the emitter direction once you use Omega!! 34 // You must attach the script to a new prim to clear the effect of omega. 35 36 // SECTION FOUR: MOVEMENT -- How do the particles move once they're created? 37 integer followSource = FALSE; // TRUE or FALSE(*), Particles move as the emitter moves, (TRUE disables radius!) 41 float minSpeed = 1.3; // 0.01 to ? Min speed each particle is spit out at, 1.0(*) 42 float maxSpeed = 1.5; // 0.01 to ? Max speed each particle is spit out at, 1.0(*) 43 vector push = <0,0,-0.6>; // Continuous force pushed on particles, use small settings for long lived particles 44 key target = ""; // Select a target for particles to arrive at when they die 45 // can be "self" (emitter), "owner" (you), "" or any prim/persons KEY. 46 47 // Script variables 48 49 integer flags; 50 list sys; 51 52 updateParticles() 53 { 54 flags = 0; 55 if (target == "owner") target = llGetOwner(); 56 if (target == "self") target = llGetKey(); 57 if (glow) flags = flags | PSYS_PART_EMISSIVE_MASK; 58 if (bounce) flags = flags | PSYS_PART_BOUNCE_MASK; 59 if (startColor != endColor) flags = flags | PSYS_PART_INTERP_COLOR_MASK; 60 if (startSize != endSize) flags = flags | PSYS_PART_INTERP_SCALE_MASK; 61 if (wind) flags = flags | PSYS_PART_WIND_MASK; 62 if (followSource) flags = flags | PSYS_PART_FOLLOW_SRC_MASK; 63 if (followVel) flags = flags | PSYS_PART_FOLLOW_VELOCITY_MASK; 64 if (target != "") flags = flags | PSYS_PART_TARGET_POS_MASK; 65 sys = [ PSYS_PART_MAX_AGE,age, 66 PSYS_PART_FLAGS,flags, 67 PSYS_PART_START_COLOR, startColor, 68 PSYS_PART_END_COLOR, endColor, 69 PSYS_PART_START_SCALE,startSize, 70 PSYS_PART_END_SCALE,endSize, 71 PSYS_SRC_PATTERN, pattern, 72 PSYS_SRC_BURST_RATE,rate, 73 PSYS_SRC_ACCEL, push, 74 PSYS_SRC_BURST_PART_COUNT,count, 75 PSYS_SRC_BURST_RADIUS,radius, 76 PSYS_SRC_BURST_SPEED_MIN,minSpeed, 77 PSYS_SRC_BURST_SPEED_MAX,maxSpeed, 78 PSYS_SRC_TARGET_KEY,target, 79 PSYS_SRC_INNERANGLE,innerAngle, 80 PSYS_SRC_OUTERANGLE,outerAngle, 81 PSYS_SRC_OMEGA, omega, 82 PSYS_SRC_MAX_AGE, life, 83 PSYS_SRC_TEXTURE, texture, 84 PSYS_PART_START_ALPHA, startAlpha, 85 PSYS_PART_END_ALPHA, endAlpha 86 ]; 87 float newrate = rate; 88 if (newrate == 0.0) newrate=.01; 89 if ( (age/rate)*count < 4096) llParticleSystem(sys); 90 else { 91 llInstantMessage(llGetOwner(),"Your particle system creates too many concurrent particles."); 92 llInstantMessage(llGetOwner(),"Reduce count or age, or increase rate."); 93 llParticleSystem( [ ] ); 94 } 95 } 96 97 98 integer switch=0; 99 key name;100 101 default102 {103 state_entry()104 {105 llWhisper(0,"touch prim to activcate or deactivate");106 name = llGetOwner();107 }108 109 touch_start(integer total_number)110 {111 if(switch==0)112 {113 switch=1;115 llWhisper(0,"Hearts on");116 }117 else if(switch==1)118 {119 switch=0;120 llSensorRemove();121 llWhisper(0,"Hearts off");122 llParticleSystem( [ ] );123 }124 }125 127 {128 if (total_number > 1 )129 updateParticles(); // 2 or more causes this \130 }131 132 133 no_sensor()134 {135 llParticleSystem( [ ] );136 }137 138 139 }