|
Kitari Elfenbeim
Registered User
Join date: 28 Apr 2008
Posts: 7
|
06-30-2008 07:13
Ive been messing around with a particle script and gotten a hang of most the features in it, but what Im wanting to do is have the emitter spit out multiple textures. How would I modify the script?
|
|
Kaluura Boa
Polygon Project
Join date: 27 Mar 2007
Posts: 194
|
06-30-2008 07:51
Haven't you ever noticed that the particles keep on living their "little lives" once emitted, whatever happens to the emitter. That's the not-so-big secret toward complex particle effects.
Call llParticleSystem() from a timer. It must be faster than PSYS_PART_MAX_AGE. So the particles from the previous burst are still "alive" and will get mixed with the new ones... which can have a different texture, different colors, up to the point of totally different parameters.
|
|
Kitari Elfenbeim
Registered User
Join date: 28 Apr 2008
Posts: 7
|
06-30-2008 08:20
so is it just basically repeating the guts of the script over and over for each different texture I want? IE... emit texture A for 10 seconds with lifespan of 30 seconds.. then type entire script out again with texture B instead.. and at bottom of the script loop to the top?
|
|
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
|
06-30-2008 08:31
To do this you'll need some basic scripting skills, understanding functions and the difference between local variables and globals, because you can't initialize a global variable twice. Since we can't see the script you're using, and there are a couple common ones floating around, I can't be more specific without writing the code (which I don't want to do). But the general idea is this. Use "quote" button to see my code with the indentation preserved (as though you were going to reply to my post). system1() { string texture = "texture1"; float parm1 = 2.0; llParticleSystem([...... PART_TEXTURE, texture, .... parm1 ....]); }
system2() { string texture = "myothertexture"; float parm1 = 5.0; llParticleSystem([...... PART_TEXTURE, texture, .... parm1 ....]); }
Note that the variables that differ between system1() and system2() are declared inside the functions, rather than outside (in the global scope).
Once you get a handle on functions, look up llSetTimerEvent() in the LSL wiki, along with the "timer" event. You'll call the emitter fuction(s) from there.
|
|
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
|
06-30-2008 08:33
A simple option is to use multiple systems (max 1 per prim, so you'd have to add prims, and put them in the same location if that's the effect you want).
|
|
Dekka Raymaker
thinking very hard
Join date: 4 Feb 2007
Posts: 3,898
|
07-01-2008 01:00
The Particles Lab presently implementing tutorials how this is done.
|
|
Cortex Draper
Registered User
Join date: 23 Aug 2005
Posts: 406
|
07-01-2008 05:49
From: Kitari Elfenbeim so is it just basically repeating the guts of the script over and over for each different texture I want? IE... emit texture A for 10 seconds with lifespan of 30 seconds.. then type entire script out again with texture B instead.. and at bottom of the script loop to the top? make a function that contains your "guts of the script" particle system, where the texture is a string variable (either a parameter to the function or a global variable) Then each time you want to change particles, set the string variable and call your function. Alternatively if you want all your textures at the same time then the multiple prim way is probably best as you wont have to cause lag by constantly changing the particle systems.
|
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
07-01-2008 09:27
As stated, only two ways to do it:
1) Time-share one emitter (prim) with multiple textures via timed llParticleSystem calls. 2) Use multiple emitters (prims), each prim emitting a different texture simultaneously.
|