Summary
There should be a function and/or
llGetPrimitiveParams
constant to read the entire
llParticleSystem
rule list. There is currently no way to read any particle parameters once they have been set, even though particles are a prim property. They should be readable in the same vein as hovertext (
PRIM_TEXT
) and other prim properties.
Use Case
It is impossible for a script to detect if there is an existing particle system.
When multiple scripts exist in an object, the only way to synchronize particle system rules between scripts is externally through linkset data or link messages. This is only safe if all of the scripts in an object obey whatever custom synchronization method you design.
This is particularly annoying when adding a script to an unfamiliar object that uses particle effects - if you replace the existing particle system, there is no way to recover it. For example, it's impossible to drop a script in an object that temporarily shoots particles at another object and restores the original particle system when finished.
But why not? The particle system is a prim property. Even if that use case is limited, why do we need to waste memory storing a duplicate copy somewhere else in the prim properties, or worse, as globals in one or more scripts?
Suggestions
  • llGetParticleSystem()
    - returns particle system rules list that was last passed in using llParticleSystem( list rules ) for the prim the script is in
  • llGetLinkParticleSystem( integer link )
    - returns particle system rules list for the specified prim by link number
  • PRIM_PARTICLES
    flag for
    llGetPrimitiveParams
    and
    llGetLinkPrimitiveParams
    - returns particle system rules list for the specified prim (but note caveat below regarding rules length)
Caveats
  • This makes it possible to "steal" particle system rules, unless particle systems are treated the same way as textures (owner must have full permissions for object). Would make sense because particle system rules can include a texture UUID.
  • llGetPrimitiveParams
    return lists need to be a predefined length, so either future
    llParticleSystem
    rules must use a different
    PRIM_*
    flag (annoying, also prevents the use case above from being future-proof) or the return value should be
    [ PRIM_PARTICLES ] + rules_length + rules
    so that the rules list can be expanded later (risks memory overflows in-the-field if larger and larger lists are returned without needing to recompile).
  • Overloading
    llParticleSystem
    parameters and using them as extra memory would be an issue to look out for.
    llLinksetData*
    provides a better solution but someone will try to store arbitrary data in the rules for fun. (That someone is me.)