Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Inspecting ParticleSystem parameters?

Timothy Daniels
Registered User
Join date: 17 Jan 2007
Posts: 3
02-01-2007 03:18
I've searched the forums and the LSL Wiki for an answer to this, but to no avail :(

Once a prim's particle system has been set up using llParticleSystem(), is there any way to inspect the parameters later on? I was hoping to find a function such as llGetParticleSystemParameter(), to which you could pass something like PSYS_SRC_BURST_RADIUS, and get the current value of that parameter returned to you. Or maybe llGetParticleSystemParameters(), which gives you an attribute-value list of all the parameters.

This would be useful if you wanted to change a single parameter of the particle system. llParticleSystem() needs to be supplied with all the required parameters every time it's called, even if most of the parameters are the same as last time. It would be nice to be able to do something like this:

CODE
llParticleSystem([
PSYS_SRC_MAX_AGE, llGetParticleSystemParameter(PSYS_SRC_MAX_AGE),
PSYS_PART_MAX_AGE, llGetParticleSystemParameter(PSYS_PART_MAX_AGE),
PSYS_SRC_BURST_RATE, 0.02,
...
]);

Here, a new value is supplied for BURST_RATE, and the other parameters keep their previous values.

Is something like this possible? Any suggestions would be gratefully received :)
Malachi Petunia
Gentle Miscreant
Join date: 21 Sep 2003
Posts: 3,414
02-01-2007 05:59
If you need to a get on the last submission to llParticleSystem, store the last value in a global.

I think, but have not tested, that you should be able to specify only the parameters in need of change and all others stay the same. I so, this would reduce your second call to:
CODE
 llParticleSystem([ 
PSYS_SRC_BURST_RATE, 0.02,
...
]);
Good luck.
</font></font>
_____________________
Timothy Daniels
Registered User
Join date: 17 Jan 2007
Posts: 3
02-01-2007 12:34
Thanks for your reply, Malachi. As you say, the only way seems to be to use a list variable to store the latest list which was passed to llParticleSystem().

My biggest hope was that llGetPrimitiveParams() would have a suitable flag (eg. PRIM_PARTICLESYS) which would cause the function to return a list of the current particle system parameters. But I can't find anything like that in the documentation :(

I'm not sure about your other suggestion... I think if you don't supply a value for a particular parameter, then it takes its default value. That's why calling llParticleSystem([]) will reset the particle system (the empty list causes all the parameters to take their default values).

Anyone else got any ideas?