Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Particle issue

Max Pitre
Registered User
Join date: 19 Jul 2006
Posts: 370
03-31-2009 16:29
Everytime I go to the spot with the particle script it's doing it's particle thing. I wrote the script to activate on touch, which it also does, but not everytime I go the that spot. What can I do to stop that?


MakeParticles() {

particle stuff



}


integer OFF = FALSE;

default
{
on_rez( integer reznum)
{
llResetScript();
}
touch_start(integer num)
{
if(llDetectedKey(0) == llGetOwner()) /
{
if(OFF)
{
MakeParticles();
OFF = FALSE;
llSetPrimitiveParams([ PRIM_COLOR, ALL_SIDES, <1, 1, 0>,1.0, PRIM_FULLBRIGHT, ALL_SIDES, TRUE]);
llSleep(3);
llSetPrimitiveParams([ PRIM_COLOR, ALL_SIDES, <1, 1, .6>,1.0, PRIM_FULLBRIGHT, ALL_SIDES, FALSE]);

}
else
{


llParticleSystem([]);
OFF = TRUE;
}
}
}
}
Day Oh
Registered User
Join date: 3 Feb 2007
Posts: 1,257
03-31-2009 16:47
It seems likely you are relying on PSYS_SRC_MAX_AGE to "stop" the particle system after a given period of time. There is a little bit of a misunderstanding of how PSYS_SRC_MAX_AGE works. wiki.secondlife.com says:

From: https://wiki.secondlife.com/wiki/LlParticleSystem
Specifies the length of time, in seconds, that the emitter will operate upon coming into view range (if the particle system is already set) or upon execution of this function (if already in view range)


Because a particle system isn't timestamped, there's no way to tell when it was "created," and it will always be the same particle system until you call llParticleSystem again. You may want to use a timer to turn off the particles.
_____________________
Max Pitre
Registered User
Join date: 19 Jul 2006
Posts: 370
03-31-2009 17:04
Interesting, I was looking at the wrong part of the script. Thanks Day.