Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Why is this happing? -Script only works some of the time-

XelNaga Gamba
Amateur Master Scripter
Join date: 12 Dec 2006
Posts: 20
01-21-2007 06:17
I have a particle generator script with a flight check to turn them on and off.
I have 4 exits for the particle flame to spawn. After playing with one of the 4 exits(mainly changing the color) i got it to turn off the particles when not flying.
So I saved the script and gave it to my 3 other exits. Now when I first put the jet-pack on the particles are not on (like its suppose to be) then when I fly they come on. When I land only the 1 exit turns off and the others keep spawning. When i first had the script all 4 of them was like that, would turn on but not off. I added a llOwnerSays to both the on and off "If"-lines to see if it just was not reaching the off line. I pinpointed the problem through a few exparaments, the "llParticleSystem( [] );" was not removing the particles.

CODE

integer isFlying = FALSE;

StartFlames()
{
llParticleSystem([
PSYS_PART_FLAGS , 0
| PSYS_PART_INTERP_COLOR_MASK
| PSYS_PART_INTERP_SCALE_MASK
| PSYS_PART_FOLLOW_SRC_MASK
| PSYS_PART_FOLLOW_VELOCITY_MASK
| PSYS_PART_EMISSIVE_MASK
,

PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE_CONE

,PSYS_SRC_TEXTURE, "lavafl1"
,PSYS_SRC_MAX_AGE, 0.0
,PSYS_PART_MAX_AGE, 1.0
,PSYS_SRC_BURST_RATE, 0.02
,PSYS_SRC_BURST_PART_COUNT, 2
,PSYS_SRC_BURST_RADIUS, 5.0
,PSYS_SRC_BURST_SPEED_MIN, -1.5
,PSYS_SRC_BURST_SPEED_MAX, 4.0
,PSYS_SRC_ACCEL, <0.0,0.0,-0.8>
,PSYS_PART_START_COLOR, <0.40,0.0,0.40>
,PSYS_PART_END_COLOR, <1.0,1.0,1.0>
,PSYS_PART_START_ALPHA, 0.9
,PSYS_PART_END_ALPHA, 0.0
,PSYS_PART_START_SCALE, <0.4,0.4,0.0>
,PSYS_PART_END_SCALE, <0.3,0.3,0.0>
,PSYS_SRC_ANGLE_BEGIN, PI
,PSYS_SRC_ANGLE_END, PI
,PSYS_SRC_OMEGA, <0.0,0.0,0.0>
]);
}

default
{
state_entry()
{
llSetTimerEvent( 1 ) ;
}

timer()
{
if( (llGetAgentInfo( llGetOwner() ) & AGENT_FLYING) && !isFlying )
{
StartFlames() ;
isFlying = TRUE;
llOwnerSay("Turning On");
}

else if( !(llGetAgentInfo( llGetOwner() ) & AGENT_FLYING) && isFlying )
{
llParticleSystem([]);
isFlying = FALSE;
llOwnerSay("Turning Off");
}
}
}


The script was originaly a freebie script so there was lots and lots of notes to help newbs like my self out when we read it. I went ahead and deleted all the notes so it would be easer for you all to read.
Like I said this is the exact same script all 4 exits have but only 1 works properly
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
01-21-2007 07:35
From: XelNaga Gamba
I have a particle generator script with a flight check to turn them on and off.
I have 4 exits for the particle flame to spawn. After playing with one of the 4 exits(mainly changing the color) i got it to turn off the particles when not flying.
So I saved the script and gave it to my 3 other exits. Now when I first put the jet-pack on the particles are not on (like its suppose to be) then when I fly they come on. When I land only the 1 exit turns off and the others keep spawning. When i first had the script all 4 of them was like that, would turn on but not off. I added a llOwnerSays to both the on and off "If"-lines to see if it just was not reaching the off line. I pinpointed the problem through a few exparaments, the "llParticleSystem( [] );" was not removing the particles.

CODE

integer isFlying = FALSE;

StartFlames()
{
llParticleSystem([
PSYS_PART_FLAGS , 0
| PSYS_PART_INTERP_COLOR_MASK
| PSYS_PART_INTERP_SCALE_MASK
| PSYS_PART_FOLLOW_SRC_MASK
| PSYS_PART_FOLLOW_VELOCITY_MASK
| PSYS_PART_EMISSIVE_MASK
,

PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE_CONE

,PSYS_SRC_TEXTURE, "lavafl1"
,PSYS_SRC_MAX_AGE, 0.0
,PSYS_PART_MAX_AGE, 1.0
,PSYS_SRC_BURST_RATE, 0.02
,PSYS_SRC_BURST_PART_COUNT, 2
,PSYS_SRC_BURST_RADIUS, 5.0
,PSYS_SRC_BURST_SPEED_MIN, -1.5
,PSYS_SRC_BURST_SPEED_MAX, 4.0
,PSYS_SRC_ACCEL, <0.0,0.0,-0.8>
,PSYS_PART_START_COLOR, <0.40,0.0,0.40>
,PSYS_PART_END_COLOR, <1.0,1.0,1.0>
,PSYS_PART_START_ALPHA, 0.9
,PSYS_PART_END_ALPHA, 0.0
,PSYS_PART_START_SCALE, <0.4,0.4,0.0>
,PSYS_PART_END_SCALE, <0.3,0.3,0.0>
,PSYS_SRC_ANGLE_BEGIN, PI
,PSYS_SRC_ANGLE_END, PI
,PSYS_SRC_OMEGA, <0.0,0.0,0.0>
]);
}

default
{
state_entry()
{
llSetTimerEvent( 1 ) ;
}

timer()
{
if( (llGetAgentInfo( llGetOwner() ) & AGENT_FLYING) && !isFlying )
{
StartFlames() ;
isFlying = TRUE;
llOwnerSay("Turning On");
}

else if( !(llGetAgentInfo( llGetOwner() ) & AGENT_FLYING) && isFlying )
{
llParticleSystem([]);
isFlying = FALSE;
llOwnerSay("Turning Off");
}
}
}


The script was originaly a freebie script so there was lots and lots of notes to help newbs like my self out when we read it. I went ahead and deleted all the notes so it would be easer for you all to read.
Like I said this is the exact same script all 4 exits have but only 1 works properly



There has been a bug reported in the particle system with the latest release of the client.


Try recompiling the scripts, it may help.