Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Trouble with the particle system

DBDigital Epsilon
Registered User
Join date: 29 Aug 2005
Posts: 252
06-18-2007 18:17
I am trying to make a object that goes up a certain distance (emitting particles as it goes up), emits a large different burst of particles at the stopping point then dies. However for some reason the second burst is not consistent. Sometimes it occurs and other times it does not. And the reliability varies from sim to sim. Any idea what the problem is?

-DB
Jim Guyot
Tinkerer
Join date: 21 Apr 2007
Posts: 38
06-18-2007 22:18
Without seeing the code you have, it would be hard to determine the exact cause for this.

You may have the issue of the llDie() command coming too quickly after the particle system is started. You may want to use either a timer or an llSleep() command once the target height is reached in order to accomodate this. If you are worried about the prim being visible while the particle effects are going off, use llSetPrimitiveParams() to set the alpha to 0.
DBDigital Epsilon
Registered User
Join date: 29 Aug 2005
Posts: 252
06-19-2007 02:49
Actually I do have llsleep before lldie. I have tried increasing the time and even removing the lldie with no difference. The particles still burst unreliably and this varies from sim to sim.

-DB
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
06-19-2007 03:30
From: DBDigital Epsilon
[...]this varies from sim to sim.

or, possibly, from location-to-location, where different locations have different pre-existing particle loads? Or, equivalently, does the effect vary with different viewer settings of Max Particles? ("Fireworks" effects are notorious for generating vast numbers of tiny particles... sometimes acceptably reduced by using many fewer particles of complex texture and rapidly expanding scale.)
DBDigital Epsilon
Registered User
Join date: 29 Aug 2005
Posts: 252
06-19-2007 03:38
Well in the locations I tested, there was a lack of other particles in the area. So this should be a non issue. Also the Max particles is at 300, far below the max of the viewer. And no the lack of the effect does not change if I reduce the MAX setting further.

-DB
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
06-19-2007 05:06
Demonstrating a flair for the obvious, perhaps, while grasping at straws:

If it's not the *number* of particles... could it be that the target height where they're emitted is just at the limit of viewer particle depth, interacting with the height of the ground (and avatar's cam) in the different sims? Or something about the height-triggering logic that fails based on different heights of llGround() in different locations where tested?

It is just one prim, right, switching its llParticleSystem()? It's not trying (and sometimes failing) to rez another prim for the second effect?

To get much further, seeing code may be necessary. And it's hard to tell if the problem arises from the llParticleSystem() rules, or somewhere in the emitter itself.
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
06-19-2007 06:37
Try being closer to the object for the test. I am suspecting you will see the correct particle behavior when you are close. As a preivous poster suggested, it could be the distance your viewer/camera is from the effect, which, at some point, shows no particles at all.
DBDigital Epsilon
Registered User
Join date: 29 Aug 2005
Posts: 252
06-19-2007 10:46
Well it simply gets its position upon rez, then basied on that information goes up X distance, stops the flame particles, emits the burst, then dies. I have tried commenting out the movment and no difference. Distance is not the issue here. And yes it is just one prim. It is not rezing another prim to do the explosion or anything else. I am using physics for movement, could this be the problem?

-DB
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
06-19-2007 14:28
From: DBDigital Epsilon
[...]I am using physics for movement, could this be the problem?
Well, I just played with the little Fireworks Launcher in Inventory | Library folder, which also has physical propulsion and generates a few particle effects (well, "llMakeExplosion";) along its trajectory, and found it really impossible to set a cam location where the rocket can reliably emit its final burst within view. Now, that rocket is using simple thrust to move *very* fast, and using a timer to decide when to explode, so it's kinda luck-of-the-draw where the rocket has gotten when the timer gets around to expiring. I think one would have much the same problem trying to measure altitude, even in a tight loop, if the projectile were moving very fast--and the problem might well vary depending on the sim's relative script-vs-physics load.

Now, if one instead used llMoveToTarget() and detected on_target() to trigger the final particle burst, at least one would know for sure where to put one's cam. But if the projectile is already using llMoveToTarget()... /* trails off, hoping this isn't rocket science. */

[Edit: But wait: you've tried *commenting out the movement*? well, then it's probably not a problem with physical movement... hmmm... back to the launchpad for more experiments.]
Jim Guyot
Tinkerer
Join date: 21 Apr 2007
Posts: 38
06-19-2007 14:42
I think, that hearing what you have said, we cannot go much further without seeing the script itself.

I, personally, don't have this issue when I am making fireworks. It very well could be something wrong with the script itself.
Noctua Janus
Registered User
Join date: 22 Mar 2007
Posts: 29
06-19-2007 23:34
I can confirm that I have the same issue, and even more, I trigger several effect, first and third appear, second fails sometimes. Second has more particles than third, but if I fire the object close one after another, sometimes I get the effect sometimes not.

Will post my code as soon as I'm back home.

Trying some mixed pseudo-code for the time beeing:

- Object rezzed with velocity to gain height.
- Trigger effect 1 on rezz (flames)
llPlaySound("launch_sound",1.0);
llSleep(2);
- Trigger effect 2 (explosion ~ 500 particle)
llPlaySound("burst_sound",1.0);
llSleep(2);
- Trigger effect 3 (axis ~ 250 particle)
llPlaySound("burst_sound",1.0);
llSleep(2);
llDie();

All effects are just calls to llParticleSystem, sound for second and third effect is the same.
Milambus Oh
Registered User
Join date: 6 Apr 2007
Posts: 224
06-20-2007 06:08
Have you tried resetting the particle system to a blank state before firing off the second round of particles?
Noctua Janus
Registered User
Join date: 22 Mar 2007
Posts: 29
06-20-2007 09:49
I have done this now and my problem seems to be fixed.

Thanks a lot, Milambus.
Rusty Satyr
Meadow Mythfit
Join date: 19 Feb 2004
Posts: 610
06-20-2007 13:08
I've run into this problem too. I ended up delaying the call to lllDie(), and replacing it with llSetLinkAlpha() (all sides, all prims to 0.0). That way it just looks like it's gone but the final particle effect still has a chance to 'fire'. It really dies a few seconds later.