These forums are CLOSED. Please visit the new forums HERE
random intermittent particle generation |
|
|
Marmottina Taurog
Registered User
Join date: 14 Aug 2007
Posts: 21
|
02-20-2009 03:17
I'm a tinkerer, I can't write scripts from scratch only adapt, one thing I'd really like to do is generate particles that come on at random intermittent intervals. Can anyone give me any help ?
|
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
02-20-2009 03:35
integer MAX = 10;
integer MIN = 5; particles() { // whatever you want here } default { state_entry() { llSetTimerEvent(0.1); } // prime the pump timer() { particles(); llSetTimerEvent(llFrand(MAX-MIN)+MIN); } } _____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/
"And now I'm going to show you something really cool." Skyhook Station - http://xrl.us/skyhook23 Coonspiracy Store - http://xrl.us/coonstore |
|
Debbie Trilling
Our Lady of Peenemünde
Join date: 17 Oct 2006
Posts: 434
|
02-20-2009 07:35
integer MAX = 10; integer MIN = 5; particles() { // whatever you want here } default { state_entry() { llSetTimerEvent(0.1); } // prime the pump timer() { particles(); llSetTimerEvent(llFrand(MAX-MIN)+MIN); } } This would not "generate particles that come on at random intermittent intervals" but would instead only make a new particle emission every time the timer() is called. This is because the previous emission would persist right up until the moment the next call is made. That is, at no point are the particles turned off. If the llParticleSystem() call does not have any randomity/changes in its parameters with each call, then for all intents and purposes, it would create a continuous particle emission. This code could be made to work if PSYS_SRC_MAX_AGE is set to a non-zero value and that value is always less than variable MIN. But, in this case, it would introduce other complications due to the long standing bug with PSYS_SRC_MAX_AGE and non-zero values described in caveat 1 http://wiki.secondlife.com/wiki/LlParticleSystem To make the particle "come on" implies a need to have them turned off at some point during the timed sequence. There are numerous ways to do this, with the following example being one of the more straightforward ways with the introduction of a boolean ON/OFF switch within the timer(): CODE
_____________________
http://wiki.secondlife.com/wiki/User:debbie_Trilling
|
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
02-20-2009 08:07
This code could be made to work if PSYS_SRC_MAX_AGE is set to a non-zero value and that value is always less than variable MIN. But, in this case, it would introduce other complications due to the long standing bug with PSYS_SRC_MAX_AGE and non-zero values described in caveat 1 http://wiki.secondlife.com/wiki/LlParticleSystem _____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/
"And now I'm going to show you something really cool." Skyhook Station - http://xrl.us/skyhook23 Coonspiracy Store - http://xrl.us/coonstore |
|
Marmottina Taurog
Registered User
Join date: 14 Aug 2007
Posts: 21
|
thx !!!
02-21-2009 14:04
Many thanx for your replies I will attempt to implement !!!
|