Home |
Add a script
|
||
|---|---|---|---|
| Category: | Contributor: | Description | |
| Particles | Anonymous | tropfen.lsl | |
Tropical
tropfen.lsl
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.
1 // CATEGORY:Particles 2 // DESCRIPTION:Tropical 3 // ARCHIVED BY:Ferd Frederix 4 5 //This is an updated version of a normal particle script- James Hanner 6 // Mask Flags - set to TRUE to enable 14 15 //Set these as the channel and message to use to turn on and off the system 16 integer ch = 42; 17 string messageon = ""; 18 string messageoff = ""; 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_DROP; 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 // and "detected" to use the nearest person 32 // or put the key of an object for particles to go to 33 key target = ""; 34 35 // Particle paramaters 36 float age = 4; // Life of each particle 37 float maxSpeed = 15; // Max speed each particle is spit out at 38 float minSpeed = 1.5; // Min speed each particle is spit out at 39 string texture = "28adc6ed-a359-1512-68a9-6a2b4b77c7b7"; // Texture used for particles, default used if blank 40 float startAlpha = .7; // Start alpha (transparency) value 41 float endAlpha = .4; // End alpha (transparency) value 42 vector startColor = <.8,.8,.9>; // Start color of particles <R,G,B> 44 vector startSize = <.13,.13,.13>; // Start size of particles 46 vector push = <0, 0, -3>; // Force pushed on particles 47 48 // System paramaters 49 float rate = 1; // How fast (rate) to emit particles 50 float radius = 0.2; // Radius to emit particles for BURST pattern 51 integer count = 1; // How many particles to emit per BURST 54 vector omega = <0,0,0>; // Rotation of ANGLE patterns around the source 55 float life = 0; // Life in seconds for the system to make particles 56 57 // Script variables 58 integer pre = 2; //Adjust the precision of the generated list. 59 60 integer flags; 61 list sys; 62 integer type; 63 vector tempVector; 64 rotation tempRot; 65 string tempString; 66 integer i; 67 69 { 70 return llGetSubString((string)in,0,pre - 7); 71 } 72 73 updateParticles() 74 { 75 flags = 0; 76 if(target == "detected") target = llDetectedKey(0); 77 if (target == "owner") target = llGetOwner(); 78 if (target == "self") target = llGetKey(); 79 if (glow) flags = flags | PSYS_PART_EMISSIVE_MASK; 80 if (bounce) flags = flags | PSYS_PART_BOUNCE_MASK; 81 if (interpColor) flags = flags | PSYS_PART_INTERP_COLOR_MASK; 82 if (interpSize) flags = flags | PSYS_PART_INTERP_SCALE_MASK; 83 if (wind) flags = flags | PSYS_PART_WIND_MASK; 84 if (followSource) flags = flags | PSYS_PART_FOLLOW_SRC_MASK; 85 if (followVel) flags = flags | PSYS_PART_FOLLOW_VELOCITY_MASK; 86 if (target != "") flags = flags | PSYS_PART_TARGET_POS_MASK; 87 sys = [ PSYS_PART_MAX_AGE,age, 88 PSYS_PART_FLAGS,flags, 89 PSYS_PART_START_COLOR, startColor, 90 PSYS_PART_END_COLOR, endColor, 91 PSYS_PART_START_SCALE,startSize, 92 PSYS_PART_END_SCALE,endSize, 93 PSYS_SRC_PATTERN, pattern, 94 PSYS_SRC_BURST_RATE,rate, 95 PSYS_SRC_ACCEL, push, 96 PSYS_SRC_BURST_PART_COUNT,count, 97 PSYS_SRC_BURST_RADIUS,radius, 98 PSYS_SRC_BURST_SPEED_MIN,minSpeed, 99 PSYS_SRC_BURST_SPEED_MAX,maxSpeed,100 PSYS_SRC_TARGET_KEY,target,101 PSYS_SRC_ANGLE_BEGIN,innerAngle, 102 PSYS_SRC_ANGLE_END,outerAngle,103 PSYS_SRC_OMEGA, omega,104 PSYS_SRC_MAX_AGE, life,105 PSYS_SRC_TEXTURE, texture,106 PSYS_PART_START_ALPHA, startAlpha,107 PSYS_PART_END_ALPHA, endAlpha108 ];109 110 llParticleSystem(sys);111 }112 113 default114 { 116 state_entry()117 {118 updateParticles(); //Start making particles120 }121 123 {124 state off; //Switch to the off state125 }126 }127 128 state off129 {130 state_entry()131 {132 llParticleSystem([]); //Stop making particles134 }135 137 {138 state default;139 }140 }// END //