Functions and/or llGetPrimitiveParams flag to recall llParticleSystem rules
tracked
Nelson Jenkins
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_PARTICLESflag forllGetPrimitiveParamsandllGetLinkPrimitiveParams- 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.
- llGetPrimitiveParamsreturn lists need to be a predefined length, so either futurellParticleSystemrules must use a differentPRIM_*flag (annoying, also prevents the use case above from being future-proof) or the return value should be[ PRIM_PARTICLES ] + rules_length + rulesso 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 llParticleSystemparameters 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.)
Log In
Spidey Linden
tracked
Issue tracked. We have no estimate when it may be implemented. Please see future updates here.
Bleuhazenfurfle Resident
llGetPrimitiveParams return lists are not always predefined length — any parameter that has an ALL_SIDES. Though, this one could vary rather wildly, so I'd go with [rules_length, ... rules].
Though if it's going to be in llGetPrimitiveParams, it probably needs to be in llSetPrimtiveParams, too… (The same method can be used, though.)
Bavid Dailey
I am strongly of the opinion that, if you can set "it" in LSL, you should be able to retrieve the parameter values you set
Peter Stindberg
Interesting suggestion, but probably caveat #1 kills it.
Love caveat #3. That makes two of us.
Nelson Jenkins
Peter Stindberg Then why have llGetTexture and the like? I'd rather have a function that only works for full perm objects than one that doesn't exist in the first place.