|
Lightshaper Merlin
Registered User
Join date: 19 Jul 2007
Posts: 11
|
07-29-2008 18:45
I don't think I'm undersanding how to update particles. For instance, to push a button and have the age of particles increase, but leave other parameters the same, WITHOUT having to create a whole second particles list and call it. I tried putting a variable inside the list, something like myAge instead of a float for particle age, and then later did something like
llParticleSystem(myParticleList); myAge = 2.4 // or whatever
But this doesn't do the update. Same if these statements are reversed. What am I missing here?
|
|
Kaluura Boa
Polygon Project
Join date: 27 Mar 2007
Posts: 194
|
07-29-2008 20:41
The particles are a property of the prim so to change anything you must use llParticleSystem() each time with all the needed parameters. In your case, just changing the variable isn't enough. You must put that variable back into myParticleList and call llParticleSystem(myParticleList) again. That can be done with llListReplaceList() for example but that isn't the easiest way. Let's take care only of PSYS_PART_MAX_AGE for the example: float myAge = 2.0; myParticleFunction() { llParticleSystem([blahblahblah... // To complete PSYS_PART_MAX_AGE, myAge, blahblahblah ]); } default { state_entry() { myParticleFunction(); } touch_start(integer total) { myAge += 0.1; if (myAge > 30.0) { myAge = 2.0; } myParticleFunction(); } } This is just a skeleton but that's easy to expand to any number of variables. So, when you change any variable (or several at the same time), just call myParticleFunction(); et voilĂ ! 
|
|
Lightshaper Merlin
Registered User
Join date: 19 Jul 2007
Posts: 11
|
07-30-2008 13:04
Thanks for that. Yeah. The critical thing I was missing was having the particle list written out in a function.
|