Multiple Particles (Textures) in one Script?
|
|
3Ring Binder
always smile
Join date: 8 Mar 2007
Posts: 15,028
|
12-02-2007 12:43
If I am making an explosion or snow type script, is there a way to make more than one texture work in said script?
I can make one particle/texture work, but when I try to add another it breaks the script.
Thanks!
|
|
MadamG Zagato
means business
Join date: 17 Sep 2005
Posts: 1,402
|
12-02-2007 12:44
You'll need another prim.
|
|
3Ring Binder
always smile
Join date: 8 Mar 2007
Posts: 15,028
|
12-02-2007 12:50
ok. and thanks bunches for your quick reply! 
|
|
Debbie Trilling
Our Lady of Peenemünde
Join date: 17 Oct 2006
Posts: 434
|
12-02-2007 12:50
Call llParticleSystem from a relatively fast timer (speed dependant on the age you have set the particles for).
Within timer() have a integer switch which controls which texture to use for this call to llParticle System()
Something like...
timer() { if (Texture1) { PSYS_SRC_TEXTURE = UUID_for_Texture1; } else { PSYS_SRC_TEXTURE = UUID_for_Texture2; } llParticleSystem(etc etc); }
|
|
Debbie Trilling
Our Lady of Peenemünde
Join date: 17 Oct 2006
Posts: 434
|
12-02-2007 12:52
From: MadamG Zagato ....You'll need another prim Not necessarily so. Using variations of the timer() and if/else technique I have used 12 differents textures from a single prim.
|
|
3Ring Binder
always smile
Join date: 8 Mar 2007
Posts: 15,028
|
12-02-2007 14:03
I'll try that. Thanks! 
|
|
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
|
12-02-2007 14:08
what i sametimes do is have 2-3 diffrent states so it be like default { // timer that will switch the 2 states back and forth with right timing it will look like only bits of textures are changing (trial and error) }
state texture1 { // particel stuff }
state texture2 { //particel stuff }
|
|
Debbie Trilling
Our Lady of Peenemünde
Join date: 17 Oct 2006
Posts: 434
|
12-02-2007 14:35
From: Mrc Homewood 2-3 diffrent states My experience is that using states for such a straightforward operation as a llParticleSystem call rarely offers many advantages, but creates unnecessary development, maintainace & performance overhead. It is difficult to see why using states thus, From: someone timer() { if (Texture1) { state Texture1; } else { state Texture2; } }
state Texture1 { on_rez(integer start_param) { llResetScript(); }
state_entry() { PSYS_SRC_TEXTURE = UUID_for_Texture1; llParticleSystem(etc etc); state default; } }
state Texture2 { on_rez(integer start_param) { llResetScript(); }
state_entry() { PSYS_SRC_TEXTURE = UUID_for_Texture2; llParticleSystem(etc etc); state default; } }
offers any advantages over : From: someone timer() { if (Texture1) { PSYS_SRC_TEXTURE = UUID_for_Texture1; } else { PSYS_SRC_TEXTURE = UUID_for_Texture2; } llParticleSystem(etc etc); }
|
|
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
|
12-02-2007 23:50
Note that using timers to restart the particle system with different settings is the BAD way to do things like that.
Restarting a particle stream causes a full prim update and thus, unneccessary traffic to the client.
Using several prims on the other hand will just require little more complex scripting and will, if done right, eliminate the need to endlessly restart particle streams. You just turn the ones you need on/off when it is required.
|
|
3Ring Binder
always smile
Join date: 8 Mar 2007
Posts: 15,028
|
12-03-2007 06:55
i want them all to start/stop at the same time, and by placing one in each prim, and then linking them, it works the way i want. i don't want to cause lag, so i'll just keep it that way. only 3 prims, so.....
|
|
CCTV Giant
Registered User
Join date: 2 Nov 2006
Posts: 469
|
12-03-2007 07:44
Hey 3Ring -- I got one I can send to you. I have six textures working at once. You can head over to my shop in Tentacle(Sofa King) and see it in action. Go check out the Santa Sleigh -- I have 6 snowflake textures in it right now and can easily do more.
cc
|
|
CCTV Giant
Registered User
Join date: 2 Nov 2006
Posts: 469
|
12-03-2007 08:16
And yes -- it is in one prim.
|
|
3Ring Binder
always smile
Join date: 8 Mar 2007
Posts: 15,028
|
12-03-2007 15:08
From: CCTV Giant Hey 3Ring -- I got one I can send to you. I have six textures working at once. You can head over to my shop in Tentacle(Sofa King) and see it in action. Go check out the Santa Sleigh -- I have 6 snowflake textures in it right now and can easily do more. cc that's pretty cool! i would love to try your script. can you slip me an IM of the fee, and we'll make the exchange next time i'm inworld. 
|
|
CCTV Giant
Registered User
Join date: 2 Nov 2006
Posts: 469
|
12-03-2007 15:21
From: 3Ring Binder that's pretty cool! i would love to try your script. can you slip me an IM of the fee, and we'll make the exchange next time i'm inworld.  Oh you misunderstood -- I don't script and I won't sell it. I will send it to you however  It's something I picked up along the way and I don't mind sharing. CC
|
|
3Ring Binder
always smile
Join date: 8 Mar 2007
Posts: 15,028
|
12-03-2007 16:47
the snow one you have at your sleigh? i love it!  btw... i went into your shop and saw those fun looking 'campers'.... the 'safe with gold bars' one is really clever. 
|
|
Jopsy Pendragon
Perpetual Outsider
Join date: 15 Jan 2004
Posts: 1,906
|
12-03-2007 17:12
In "Lag Meter" terms: Multi-prim approach for multiple particle textures: Server: [ Good ] - Scripts can set the effect and never do anything again. Use llMessageLinked() if possible to co-ordinate turning multi-prim particle effects on and off because too many active scripts using llListen() can add to server lag. Network: [ Good ] - No updates sent after the object comes into view or turned on and off. Client: [ Fair ] - Depends on quantity of particles. Single-prim approach for multiple particle textures: Server: [ Poor ] - worse for faster updates, can also cause texture caching lag for the sim is already saturated Network: [ Poor ] - ever observer must be informed for each full update Client: [ Fair ] - depending on quantity of particles. Creating some lag is necessary to do so many interesting things... but better to use methods that are more efficient if you have the option especially if the result looks the same. 
_____________________
* The Particle Laboratory * - One of SecondLife's Oldest Learning Resources. Free particle, control and targetting scripts. Numerous in-depth visual demonstrations, and multiple sandbox areas. - Stop by and try out Jopsy's new "Porgan 1800" an advanced steampunk styled 'particle organ' and the new particle texture store!
|