Can it be possible?
For example, if I need to reach these details of the object from a script:
PSYS_PART_FLAGS, PSYS_PART_START_COLOR, PSYS_PART_END_COLOR, PSYS_SRC_MAX_AGE
Is there a function for this or what?
These forums are CLOSED. Please visit the new forums HERE
Getting Particle Data of an Object? |
|
Egehan Dryke
Registered User
Join date: 30 Mar 2007
Posts: 8
|
01-14-2010 16:08
Can it be possible?
For example, if I need to reach these details of the object from a script: PSYS_PART_FLAGS, PSYS_PART_START_COLOR, PSYS_PART_END_COLOR, PSYS_SRC_MAX_AGE Is there a function for this or what? |
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
|
01-14-2010 16:53
It's not possible through LSL. Best you can do is setup a separate prim, and use a particle script that reports all the parameters... then trial & error until you get a match.
|
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
|
01-14-2010 16:54
/me wonders if Egehan can provide some more details on why they want to do this.
_____________________
Sick of sims locking up every time somebody TPs in? Vote for SVC-3895!!!
- Go here: https://jira.secondlife.com/browse/SVC-3895 - If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left |
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
01-14-2010 16:55
I'm not sure exactly what you mean by "reach," but if you mean "Can I figure out what particle parameters are already set in an object?" the answer is no. The only way you can tell what parameters are set is to look at the script that set them. If you do not have permission to modify the script, or if the script has actually been removed from the object, then there's no way to determine the parameters at all.
If you mean "Can I set the particle parameters in an object?" the answer is yes. All you need to do is call the llParticleSystem function (see http://wiki.secondlife.com/wiki/LlParticleSystem and study the sample particle script at _____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....
![]() Look for my work in XStreetSL at |
Void Singer
Int vSelf = Sing(void);
![]() Join date: 24 Sep 2005
Posts: 6,973
|
01-14-2010 23:14
if you are setting the particles you can save the list that you set and grab the current parameters from that, otherwise you're out of luck (it's just one more prim setting you can set, but can't read, and then only from a script, annoying to say the least)
_____________________
|
| . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - |
Johan Laurasia
Fully Rezzed
![]() Join date: 31 Oct 2006
Posts: 1,394
|
01-14-2010 23:58
if you are setting the particles you can save the list that you set and grab the current parameters from that, otherwise you're out of luck (it's just one more prim setting you can set, but can't read, and then only from a script, annoying to say the least) Not really, libSecondLife's testclient has a feature that exports a particle script from a rezzed object emitting particles. Essentially, it's building a particle script based on the set parameters of the object's particle system. Not exactly copybotting the particle script, but the effect is the same. I wouldn't recommend using it 'steal' the particle system settings of someone else's script as it can get you in hot water. What I do suggest is going to Jopsy Pendragon's Particle Lab in Teal. It walks you though coding particle system scripts and it starts with the absolute most basic explanation of prims and the particle system, and it explains every single parameter of the particle system in very very very good detail and is incredibly easy to understand. Also, there is a bunch of free, open source particle scripts for creating smoke, fire, and a couple of dozen other typical particle system scripts one might want as well as a section on how to implement particle systems using various other functions and events. After spending a few hours (maybe a night or two) there, you'll be able to simply look at a particle effect, and deduce how it's being done, then go code it yourself (quite easily). Not only that, when you show someone your build, and they comment you on the particle effects, you can smile, and say thanks without feeling guilty for cheating to get someone elses work. Also, I recommend either donating or buying some particle textures while you're there because Jopsy provides all this GREAT information at absolutely no charge. The Particle Lab is one of SL's BEST resources and we should all chip in to help Jopsy out for all the hard work he's done creating and maintaining the Lab, and keep this wonderful resource in SL so scripters like me, who spent alot of time learning scripting, but AVOIDING the particle system because it looked so daunting, can continue to enjoy this marvelous resource. |
Void Singer
Int vSelf = Sing(void);
![]() Join date: 24 Sep 2005
Posts: 6,973
|
01-15-2010 00:09
agreed and amen... Particle Laboratory (and Ivory Tower of Prims) is a truly invaluable resource, and any support given to either is a blessing.
ps I guess I should've stated "within LSL"... another disclaimer I need to add to my sig? nah, not worth it =) _____________________
|
| . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - |
Egehan Dryke
Registered User
Join date: 30 Mar 2007
Posts: 8
|
01-15-2010 04:02
Hmm. So it's not possible..
The reason is, i'm working on a 'particle tuner script'. For example, I'll change the age of the particle, or set the color to something else. In order to do this, I need the old particle information. If I only set the age or color, the other details of the particle will be set to 0 and will be deleted, right? I couldn't find a way to do that kind of script. You have any ideas? |
Void Singer
Int vSelf = Sing(void);
![]() Join date: 24 Sep 2005
Posts: 6,973
|
01-15-2010 04:21
briefly what I'd do, is save all the setting to a list then copy that list before modifying it. this will allow you to modify certain properties, without losing the other settings. then set the new properties along with any other setting you didn't modify from the saved copy, and save the new setting back to that.
_____________________
|
| . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - |
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
|
01-15-2010 05:55
If I've properly understood it, I don't think you need to read anything in the child prim -- that's just acting to display the effects of the settings you've chosen in the tuner. So all the child prim needs to do is contain a variable my_particle_list, which is given its initial values when the tuner loads a particular template and sends that to the child as a link message.
Then you change the values of various parameters and flags in the root prim, send the changes to the child, tell it to update the appropriate values in my_particle_list (or over-write it completely) and display the new effect. You know what the current values are because they're being used by the script in the root prim, which you can have typecast and spit them out when you're satisfied with what the display emitted by the child prim looks like. |
Egehan Dryke
Registered User
Join date: 30 Mar 2007
Posts: 8
|
01-15-2010 06:41
If I've properly understood it, I don't think you need to read anything in the child prim -- that's just acting to display the effects of the settings you've chosen in the tuner. So all the child prim needs to do is contain a variable my_particle_list, which is given its initial values when the tuner loads a particular template and sends that to the child as a link message. Then you change the values of various parameters and flags in the root prim, send the changes to the child, tell it to update the appropriate values in my_particle_list (or over-write it completely) and display the new effect. You know what the current values are because they're being used by the script in the root prim, which you can have typecast and spit them out when you're satisfied with what the display emitted by the child prim looks like. I think that's the point but I didn't understand how to do. Can you explain more detailed please? |
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
01-15-2010 07:04
The point is that you already know the particle parameters, since your script set them in the first place. So, save the information in a list and then update that list as necessary when you want to change any of the parameters. If you ever want to read out the current contents of the list into chat, just write something like
CODE
Take a look at http://wiki.secondlife.com/wiki/Link_message if you need to learn how to send information from one prim to another in a linked object. _____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....
![]() Look for my work in XStreetSL at |
Egehan Dryke
Registered User
Join date: 30 Mar 2007
Posts: 8
|
01-15-2010 07:44
The point is that you already know the particle parameters, since your script set them in the first place. So, save the information in a list and then update that list as necessary when you want to change any of the parameters. If you ever want to read out the current contents of the list into chat, just write something like CODE
Take a look at http://wiki.secondlife.com/wiki/Link_message if you need to learn how to send information from one prim to another in a linked object. How do I know the particle parameters? I know how to link message etc. but I can not reach to that particle parameters. |
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
01-15-2010 08:43
You had to set them with your script, so the information is in the script you wrote. If you didn't write the script and don't have mod perms for it, or if the script is no longer in your object, then you're back to what I said in my first response to your OP. As others have said, you can't "read" the particle parameters out of an object, but you can replicate them by trial and error if you know enough about how particles work.
The only new twist that Innula is suggesting is that if you already have the particle script, it's a piece of cake to make it updatable and to chat out the current settings. That last twist is what I was restating for you. Once you do have the parameters, you can modify to your heart's content. _____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....
![]() Look for my work in XStreetSL at |