Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

particle blasts?

Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
01-05-2008 12:28
i have been working on this scrit for a few hours now, im trying ot make a partile blast as in when you activate it, it will fire a shockwave of partiles to eather side of you, i cant seem to be able to get anywhere near to that affect, can anyone help me out on trying ot figure this out

here is my script so far

CODE

particles()
{
float occilation = 2.0;
float maxsysage = 0.0;
float maxspeed = 2.5;
float minspeed = 1.25;
float burstrad = 0.0;
integer burstcount = 20;
float burstrate = 0.01;
float outangle = 0.90;
float inangle = 1;
vector omega = <0.0,0.0,0.0>;
float startalph = 0.75;
float endalph = 0.015;
vector startscale = <2.0,2.0,2.0>;
vector endscale = <3.0,3.0,3.0>;
float maxage = 3;
vector accel = <0.0, 0.0, 0>;
string texture = "7f70a931-6300-8dbc-caca-8b09a9c2cf11";

list particle_parameters = [
PSYS_PART_FLAGS,
PSYS_PART_INTERP_COLOR_MASK |
PSYS_PART_INTERP_SCALE_MASK |
//PSYS_PART_FOLLOW_VELOCITY_MASK |
PSYS_PART_WIND_MASK,FALSE|
PSYS_SRC_PATTERN,
PSYS_SRC_PATTERN_ANGLE_CONE,
PSYS_PART_START_COLOR, <1.0,0,0>,
PSYS_PART_START_ALPHA, startalph,
PSYS_PART_END_COLOR, <0, 0,0>,
PSYS_PART_END_ALPHA, endalph,
PSYS_PART_START_SCALE, startscale,
PSYS_PART_END_SCALE, endscale,
PSYS_PART_MAX_AGE, maxage,
PSYS_SRC_ACCEL, accel,
PSYS_SRC_TEXTURE, texture,
PSYS_SRC_BURST_RATE, burstrate,
PSYS_SRC_ANGLE_BEGIN, inangle,
PSYS_SRC_ANGLE_END, outangle,
PSYS_SRC_BURST_PART_COUNT, burstcount,
PSYS_SRC_BURST_RADIUS, burstrad,
PSYS_SRC_BURST_SPEED_MIN, minspeed,
PSYS_SRC_BURST_SPEED_MAX, maxspeed,
PSYS_SRC_MAX_AGE, maxsysage,
PSYS_SRC_OMEGA, omega
];


llParticleSystem( particle_parameters );


}

default
{
state_entry() {
particles();
}



touch(integer i) {
particles();
}
}
Django Yifu
Beat Island Gaffer
Join date: 7 May 2007
Posts: 189
01-06-2008 08:46
Could it be because burst radius is set to zero?
_____________________
Tread softly upon the Earth for you walk on my face.
Jopsy Pendragon
Perpetual Outsider
Join date: 15 Jan 2004
Posts: 1,906
01-11-2008 16:14
(erroneous information about PSYS_SRC_MAX_AGE removed)

I dunno what I was (not) thinking when I posted this tripe.
Oh the shame! =) Thanks for the correction Debbie...
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
01-11-2008 16:20
In addition, you may want to turn off the particles all the way (llParticleSystem([])) after a period, using either a timer or a sleep or something. That way people will only see it when you activate it, not when they see you for the first time and you haven't activated it (the clients--not the server--each start the timing for PSYS_SRC_MAX_AGE when it first sees the particle source).
Debbie Trilling
Our Lady of Peenemünde
Join date: 17 Oct 2006
Posts: 434
01-14-2008 05:02
The problem here is not that the llParticleSystem() call as given by in OP is not emitting particles; it is emitting them aplenty, constantly and, in-fact, rather densely.

Assuming I am reading and understanding the requirements correctly, the problem is rather with what the OP wants this particle emission to do after it leaves the prim.

Rather than merely target an AV, I think requirement being described is for the emission to split into two branches; one branch should go to left and beyond the AV, the other to the right and beyond. This would obviously require knowing the current position of the AV, and firing in that direction but without actually using PSYS_SRC_TARGET_KEY

If the prim firing the emission is static, and always facing in the same direction, then this can be achieved as the following code demonstrates. The keys here are PSYS_PART_FOLLOW_VELOCITY_MASK, PSYS_SRC_PATTERN_ANGLE and the values in PSYS_SRC_ANGLE_BEGIN and ANGLE_END.

By setting PSYS_SRC_MAX_AGE = 0.0 you are in fact creating a constant stream. Or to quote the wiki: "Zero will give the particle system an infinite duration".

Setting PSYS_SRC_MAX_AGE != 0.0 will create the "blast" effect

CODE

default
{
state_entry()
{
llParticleSystem([
PSYS_PART_FLAGS, PSYS_PART_FOLLOW_VELOCITY_MASK,
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE,
PSYS_PART_START_ALPHA, 1.00,
PSYS_PART_END_ALPHA, 0.00,
PSYS_PART_START_COLOR, <1.00,0.00,0.00>,
PSYS_PART_END_COLOR, <1.00,0.00,0.00>,
PSYS_PART_START_SCALE, <0.05,4.00,0.00>,
PSYS_PART_END_SCALE, <0.05,4.00,0.00>,
PSYS_PART_MAX_AGE, 3.50,
PSYS_SRC_MAX_AGE, 0.00,
PSYS_SRC_ACCEL, <0.00,0.00,0.00>,
PSYS_SRC_ANGLE_BEGIN, 0.79,
PSYS_SRC_ANGLE_END, 0.52,
PSYS_SRC_BURST_PART_COUNT, 4,
PSYS_SRC_BURST_RADIUS, 0.10,
PSYS_SRC_BURST_RATE, 0.34,
PSYS_SRC_BURST_SPEED_MIN, 5.00,
PSYS_SRC_BURST_SPEED_MAX, 7.00,
PSYS_SRC_OMEGA, <0.00,0.00,0.00>,
PSYS_SRC_TEXTURE, "b708e484-aeef-8cc9-3896-dd661d4e6807"
]);

}
}


If, however, the prim is on the move ~ a weapon or vehicle, for example ~ it is more problematical and I cannot see an easy solution without using a "bullet" mechanism, or some variation on a possible solution proposed here: /54/bd/223115/1.html

The original code but with the changed key values to create a two-branch particle emission blast is here. Rotate the prim to face the required direction :)

CODE

particles()
{
float occilation = 2.0;
float maxsysage = 2.0;
float maxspeed = 2.5;
float minspeed = 1.25;
float burstrad = 0.0;
integer burstcount = 20;
float burstrate = 0.01;
float outangle = 0.52;
float inangle = 0.79;
vector omega = <0.0,0.0,0.0>;
float startalph = 0.75;
float endalph = 0.015;
vector startscale = <2.0,2.0,2.0>;
vector endscale = <3.0,3.0,3.0>;
float maxage = 3;
vector accel = <0.0, 0.0, 0>;
string texture = "7f70a931-6300-8dbc-caca-8b09a9c2cf11";

list particle_parameters = [
PSYS_PART_FLAGS,
PSYS_PART_INTERP_COLOR_MASK |
PSYS_PART_INTERP_SCALE_MASK |
PSYS_PART_FOLLOW_VELOCITY_MASK,
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE,
PSYS_PART_START_COLOR, <1.0,0,0>,
PSYS_PART_START_ALPHA, startalph,
PSYS_PART_END_COLOR, <0, 0,0>,
PSYS_PART_END_ALPHA, endalph,
PSYS_PART_START_SCALE, startscale,
PSYS_PART_END_SCALE, endscale,
PSYS_PART_MAX_AGE, maxage,
PSYS_SRC_ACCEL, accel,
PSYS_SRC_TEXTURE, texture,
PSYS_SRC_BURST_RATE, burstrate,
PSYS_SRC_ANGLE_BEGIN, inangle,
PSYS_SRC_ANGLE_END, outangle,
PSYS_SRC_BURST_PART_COUNT, burstcount,
PSYS_SRC_BURST_RADIUS, burstrad,
PSYS_SRC_BURST_SPEED_MIN, minspeed,
PSYS_SRC_BURST_SPEED_MAX, maxspeed,
PSYS_SRC_MAX_AGE, maxsysage,
PSYS_SRC_OMEGA, omega
];


llParticleSystem( particle_parameters );


}

default
{
state_entry() {
particles();
}



touch(integer i) {
particles();
}
}


EDIT: make into a two second "blast" rather than constant stream by setting maxsysage = 2.0
Jopsy Pendragon
Perpetual Outsider
Join date: 15 Jan 2004
Posts: 1,906
01-15-2008 17:17
Actually, as I understand the OP, wanting "shockwaves" to emminate outward
to the left and right, I suspect this is the shape and style of the effect
they're looking for:

(It would, of course, require that the prim be properly positioned...)
(Please strike my previous brainfart post from your memory! :D )

CODE


llParticleSystem( [
PSYS_SRC_TEXTURE, "",
PSYS_PART_START_SCALE, <.1,.1,0>, PSYS_PART_END_SCALE, <.1,.1,0>,
PSYS_PART_START_COLOR, <1,1,1>, PSYS_PART_END_COLOR, <1,1,1>>,
PSYS_PART_START_ALPHA, 1.0, PSYS_PART_END_ALPHA, 0.1,

PSYS_SRC_BURST_PART_COUNT, 200,
PSYS_SRC_BURST_RATE, 0.8,
PSYS_PART_MAX_AGE, 1.3,
PSYS_SRC_MAX_AGE, 0.0,

PSYS_SRC_PATTERN, 4, // 1=DROP, 2=EXPLODE, 4=ANGLE, 8=ANGLE_CONE,
PSYS_SRC_ACCEL, <0,0,0>,
PSYS_SRC_BURST_RADIUS, 0.1,

PSYS_SRC_BURST_SPEED_MIN, 3.00, PSYS_SRC_BURST_SPEED_MAX, 3.00,

PSYS_SRC_ANGLE_BEGIN, 0.40 * PI, PSYS_SRC_ANGLE_END, 0.60 * PI,
PSYS_SRC_OMEGA, <0.0,0.0,0.0>,

PSYS_PART_FLAGS, ( 0
| PSYS_PART_INTERP_COLOR_MASK
| PSYS_PART_INTERP_SCALE_MASK
| PSYS_PART_EMISSIVE_MASK
// | PSYS_PART_FOLLOW_VELOCITY_MASK
// | PSYS_PART_WIND_MASK
// | PSYS_PART_BOUNCE_MASK
// | PSYS_PART_FOLLOW_SRC_MASK
// | PSYS_PART_TARGET_POS_MASK
// | PSYS_PART_TARGET_LINEAR_MASK
) ] );

_____________________
* The Particle Laboratory * - One of SecondLife's Oldest Learning Resources.
Free particle, control and targetting scripts. Numerous in-depth visual demonstrations, and multiple sandbox areas.
-
Stop by and try out Jopsy's new "Porgan 1800" an advanced steampunk styled 'particle organ' and the new particle texture store!
Debbie Trilling
Our Lady of Peenemünde
Join date: 17 Oct 2006
Posts: 434
01-15-2008 19:42
From: Jopsy Pendragon
as I understand the OP, wanting "shockwaves" to emminate outward to the left and right


Hi Jopsy

Looking at your code there, you could very well be right. I must admit I was never entirely clear to me what the OP was actually describing and can see how both of our interpretations of the requirements might fit.

Regardless, hopefully one or the other or even a combination of both our proposed solutions will answer the OP :)
Jopsy Pendragon
Perpetual Outsider
Join date: 15 Jan 2004
Posts: 1,906
01-16-2008 14:35
From: Debbie Trilling

Regardless, hopefully one or the other or even a combination of both our proposed solutions will answer the OP :)


Now the question is... will the OP ever come back to see the follow-ups? ! =)
_____________________
* The Particle Laboratory * - One of SecondLife's Oldest Learning Resources.
Free particle, control and targetting scripts. Numerous in-depth visual demonstrations, and multiple sandbox areas.
-
Stop by and try out Jopsy's new "Porgan 1800" an advanced steampunk styled 'particle organ' and the new particle texture store!