Difference between revisions of "PSYS Template"
BETLOG Hax (talk | contribs) m |
Kireji Haiku (talk | contribs) m (some reformatting to improve readability and added LSL TIp with reference to llLinkParticleSystem) |
||
Line 1: | Line 1: | ||
{{LSL Header}} | {{LSL Header}} | ||
====PSYS Template==== | ====PSYS Template==== | ||
--[[User:BETLOG Hax|BETLOG Hax]] | {{LSL Tip|You might want to use [[llLinkParticleSystem]] instead of [[llParticleSystem]] dependant upon the desired effects.}} | ||
--[[User:BETLOG Hax|BETLOG Hax]] SLT: July 9th 2009 | |||
All of the flags for making particles in a script with important inter-relationship comments only. | All of the flags for making particles in a script with important inter-relationship comments only. | ||
Line 7: | Line 8: | ||
(declaring a bunch of variables instead of just learning to read the actual flag names is stupid) | (declaring a bunch of variables instead of just learning to read the actual flag names is stupid) | ||
<lsl> | <lsl> | ||
integer | integer hasParticleEffect = TRUE; | ||
// | |||
list particle_effects() | |||
{ | |||
return | |||
[PSYS_PART_FLAGS, ( 0 | |||
| PSYS_PART_INTERP_COLOR_MASK | |||
| PSYS_PART_INTERP_SCALE_MASK | |||
| PSYS_PART_EMISSIVE_MASK | |||
// | PSYS_PART_WIND_MASK | |||
// | PSYS_PART_BOUNCE_MASK | |||
// | PSYS_PART_FOLLOW_SRC_MASK //disables BURST_RADIUS | |||
// | PSYS_PART_FOLLOW_VELOCITY_MASK | |||
// | PSYS_PART_TARGET_POS_MASK //target TARGET_KEY | |||
// | PSYS_PART_TARGET_LINEAR_MASK //requires TARGET_KEY disables ACCEL, BURST_RADIUS | |||
), | |||
PSYS_PART_START_COLOR, <1.0, 0.5, 0.0>, | |||
PSYS_PART_START_ALPHA, 1.0, | |||
PSYS_PART_END_COLOR, <0.3, 0.0, 0.0>, | |||
PSYS_PART_END_ALPHA, 0.0, | |||
PSYS_PART_START_SCALE, <0.5, 0.5, 0>, | |||
PSYS_PART_END_SCALE, <0.5, 0.5, 0>, | |||
PSYS_PART_MAX_AGE, 1.0, | |||
PSYS_SRC_ACCEL, ZERO_VECTOR, | |||
PSYS_SRC_PATTERN, 8, | |||
// DROP (1), EXPLODE (2), ANGLE (4), ANGLE_CONE (8), ANGLE_CONE_EMPTY (10) | |||
// 1 - disables BURST_RADIUS, BURST_SPEED_MIN, BURST_SPEED_MAX | |||
// 4/8/10 - requires ANGLE_BEGIN, ANGLE_END | |||
PSYS_SRC_TEXTURE, "", | |||
PSYS_SRC_BURST_RATE, 0.05, | |||
PSYS_SRC_BURST_PART_COUNT, 4, | |||
PSYS_SRC_BURST_RADIUS, 1.0, | |||
PSYS_SRC_BURST_SPEED_MIN, 0.0, | |||
PSYS_SRC_BURST_SPEED_MAX, 0.1, | |||
PSYS_SRC_MAX_AGE, 0.0, | |||
PSYS_SRC_TARGET_KEY, NULL_KEY, | |||
PSYS_SRC_OMEGA, ZERO_VECTOR, | |||
PSYS_SRC_ANGLE_BEGIN, 0.5, | |||
PSYS_SRC_ANGLE_END, 0.5]; | |||
} | |||
toggle_particles() | |||
{ | |||
hasParticleEffect = !hasParticleEffect; | |||
if (hasParticleEffect) | |||
// { | |||
llParticleSystem( particle_effects() ); | |||
// } | |||
else | |||
// { | |||
llParticleSystem([]); | |||
// } | |||
} | |||
default | default | ||
{ | { | ||
on_rez(integer start_param) | on_rez(integer start_param) | ||
{ | { | ||
llResetScript(); | |||
} | } | ||
state_entry() | state_entry() | ||
{ | { | ||
toggle_particles(); | |||
} | } | ||
touch_start(integer num_detected) | |||
{ | |||
toggle_particles(); | |||
{ | |||
} | } | ||
} | } | ||
</lsl> | </lsl> | ||
[[Category:LSL Examples]] | [[Category:LSL Examples]] |
Revision as of 13:23, 29 October 2012
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
PSYS Template
Important: You might want to use llLinkParticleSystem instead of llParticleSystem dependant upon the desired effects. |
--BETLOG Hax SLT: July 9th 2009
All of the flags for making particles in a script with important inter-relationship comments only.
(declaring a bunch of variables instead of just learning to read the actual flag names is stupid)
<lsl>
integer hasParticleEffect = TRUE;
list particle_effects() {
return [PSYS_PART_FLAGS, ( 0 | PSYS_PART_INTERP_COLOR_MASK | PSYS_PART_INTERP_SCALE_MASK | PSYS_PART_EMISSIVE_MASK
// | PSYS_PART_WIND_MASK // | PSYS_PART_BOUNCE_MASK // | PSYS_PART_FOLLOW_SRC_MASK //disables BURST_RADIUS // | PSYS_PART_FOLLOW_VELOCITY_MASK // | PSYS_PART_TARGET_POS_MASK //target TARGET_KEY // | PSYS_PART_TARGET_LINEAR_MASK //requires TARGET_KEY disables ACCEL, BURST_RADIUS
), PSYS_PART_START_COLOR, <1.0, 0.5, 0.0>, PSYS_PART_START_ALPHA, 1.0, PSYS_PART_END_COLOR, <0.3, 0.0, 0.0>, PSYS_PART_END_ALPHA, 0.0, PSYS_PART_START_SCALE, <0.5, 0.5, 0>, PSYS_PART_END_SCALE, <0.5, 0.5, 0>, PSYS_PART_MAX_AGE, 1.0, PSYS_SRC_ACCEL, ZERO_VECTOR, PSYS_SRC_PATTERN, 8,
// DROP (1), EXPLODE (2), ANGLE (4), ANGLE_CONE (8), ANGLE_CONE_EMPTY (10) // 1 - disables BURST_RADIUS, BURST_SPEED_MIN, BURST_SPEED_MAX // 4/8/10 - requires ANGLE_BEGIN, ANGLE_END
PSYS_SRC_TEXTURE, "", PSYS_SRC_BURST_RATE, 0.05, PSYS_SRC_BURST_PART_COUNT, 4, PSYS_SRC_BURST_RADIUS, 1.0, PSYS_SRC_BURST_SPEED_MIN, 0.0, PSYS_SRC_BURST_SPEED_MAX, 0.1, PSYS_SRC_MAX_AGE, 0.0, PSYS_SRC_TARGET_KEY, NULL_KEY, PSYS_SRC_OMEGA, ZERO_VECTOR, PSYS_SRC_ANGLE_BEGIN, 0.5, PSYS_SRC_ANGLE_END, 0.5];
}
toggle_particles() {
hasParticleEffect = !hasParticleEffect;
if (hasParticleEffect)
// {
llParticleSystem( particle_effects() );
// }
else
// {
llParticleSystem([]);
// } }
default {
on_rez(integer start_param) { llResetScript(); }
state_entry() { toggle_particles(); }
touch_start(integer num_detected) { toggle_particles(); }
} </lsl>