Home |
Add a script
|
||
|---|---|---|---|
| Category: | Contributor: | Description | |
| Particles | nick failight | engine effect.lsl | |
Particles
engine effect.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:Particles 3 // ARCHIVED BY:Ferd Frederix 4 5 6 //edited by nick fairlight 7 // Mask Flags - set to TRUE to enable 15 16 // Choose a pattern from the following: 17 // PSYS_SRC_PATTERN_EXPLODE 18 // PSYS_SRC_PATTERN_DROP 19 // PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY 20 // PSYS_SRC_PATTERN_ANGLE_CONE 21 // PSYS_SRC_PATTERN_ANGLE 22 integer pattern = PSYS_SRC_PATTERN_ANGLE_CONE; 23 24 // Select a target for particles to go towards 25 // "" for no target, "owner" will follow object owner 26 // and "self" will target this object 27 // or put the key of an object for particles to go to 28 key target = ""; 29 30 // Particle paramaters 31 float age = 1.6; //How long particles last 32 float maxSpeed = .1; //The fastest they will go 33 float minSpeed = .1; //The slowest they will go 34 string texture = ""; //Particle texture, if blank its set to delault orb type. 35 float startAlpha = 0; //don't change yet, not sure what this is. 36 float endAlpha = 1; //don't change yet, not sure what this is. 37 vector startColor = <0,1,0>; //Starting color stream 38 vector endColor = <.2,3,.0>; // Color of particles at end of stream 39 vector startSize = <.4,.4,.3>; //Size of particles at the start 40 vector endSize = <.1,.1,.1>; //Sizes of particles at end of stream 42 43 // System paramaters 44 float rate = .001; // How fast to emit particles 45 float radius = 0; // Radius to emit particles for BURST pattern 46 integer count = 1; // How many particles to emit per BURST 49 vector omega = <0,0,0>; // Rotation of ANGLE patterns around the source 50 float life = 0; //Not sure what this is yet 51 52 53 54 // Script variables 55 integer flags; 56 57 updateParticles() 58 { 59 if (target == "owner") target = llGetOwner(); 60 if (target == "self") target = llGetKey(); 61 if (glow) flags = flags | PSYS_PART_EMISSIVE_MASK; 62 if (bounce) flags = flags | PSYS_PART_BOUNCE_MASK; 63 if (interpColor) flags = flags | PSYS_PART_INTERP_COLOR_MASK; 64 if (interpSize) flags = flags | PSYS_PART_INTERP_SCALE_MASK; 65 if (wind) flags = flags | PSYS_PART_WIND_MASK; 66 if (followSource) flags = flags | PSYS_PART_FOLLOW_SRC_MASK; 67 if (followVel) flags = flags | PSYS_PART_FOLLOW_VELOCITY_MASK; 68 if (target != "") flags = flags | PSYS_PART_TARGET_POS_MASK; 69 70 71 72 llParticleSystem([ PSYS_PART_MAX_AGE,age, 73 PSYS_PART_FLAGS,flags, 74 PSYS_PART_START_COLOR, startColor, 75 PSYS_PART_END_COLOR, endColor, 76 PSYS_PART_START_SCALE,startSize, 77 PSYS_PART_END_SCALE,endSize, 78 PSYS_SRC_PATTERN, pattern, 79 PSYS_SRC_BURST_RATE,rate, 80 PSYS_SRC_ACCEL, push, 81 PSYS_SRC_BURST_PART_COUNT,count, 82 PSYS_SRC_BURST_RADIUS,radius, 83 PSYS_SRC_BURST_SPEED_MIN,minSpeed, 84 PSYS_SRC_BURST_SPEED_MAX,maxSpeed, 85 PSYS_SRC_TARGET_KEY,target, 86 PSYS_SRC_INNERANGLE,innerAngle, 87 PSYS_SRC_OUTERANGLE,outerAngle, 88 PSYS_SRC_OMEGA, omega, 89 PSYS_SRC_MAX_AGE, life, 90 PSYS_SRC_TEXTURE, texture, 91 PSYS_PART_START_ALPHA, startAlpha, 92 PSYS_PART_END_ALPHA, endAlpha 93 ]); 94 } 95 default 96 { 97 state_entry() 98 { 99 updateParticles();100 llSetTimerEvent(1);101 }102 103 timer()104 {105 106 }107 }108 109 // END //