Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Teleport Poffer Only Poofing Every Other TP

PhoenixRene Ashbourne
Script Novice
Join date: 19 Feb 2008
Posts: 9
08-14-2008 13:37
Could someone tell me why it is poofing every other tp instead of every tp?

integer channel = 13;

mySetParticles() {
// Part-1 - APPEARANCE - Settings for how each particle LOOKS

// ************** PUT IN TEXTURE NAME BELOW ******************************//
string TEXTURE = "";
// ************** PUT IN TEXTURE NAME ABOVE ******************************//
//
vector START_SCALE = < .3, .3, 0.0 >; // How large each particle starts out
vector END_SCALE = < .3, .3, 0.0 >; // How large each particle end up before dying
vector START_COLOR = < 1, 1, 1 >; // Tint of each particle when it starts out
vector END_COLOR = < 1, 1, 1 >; // Tint of each particle before it dies
float START_ALPHA = 1; // How transparent to start out (1 = totally opaque, 0 = invisible)
float END_ALPHA = .5; // How transparent to end up
integer INTERP_COLOR = TRUE;
integer INTERP_SCALE = TRUE;
integer EMISSIVE = TRUE;

// Part-2 - LIFE- How long the particles are present
float AGE = 8.00; // How long each particle lasts
float RATE = .75; // How quickly to output
integer COUNT = 15; // How many particles to spew out
float LIFE = 3.0; // How long to emit particles for each burst
integer PATTERN = PSYS_SRC_PATTERN_EXPLODE;
float RADIUS = 0.00;
float ANGLE_BEGIN = PI_BY_TWO;
float ANGLE_END = PI_BY_TWO;
vector OMEGA = < 0.00, 0.00, 1.00 >;


// Part-3 - MOVEMENT - How do the particles move once they're created?
integer FOLLOW_SRC = TRUE;
integer FOLLOW_VELOCITY = TRUE;
integer WIND = FALSE;
integer BOUNCE = FALSE;
float SPEED_MIN = 0.2; // SPEED sets the speed of the particle movement
float SPEED_MAX = 0.4;
vector ACCEL = < 0.00, 0.00, 0.0 >;
integer TARGET_POS = FALSE;
key TARGET = llGetKey();

list particle_parameters = [
PSYS_PART_FLAGS, (
( EMISSIVE * PSYS_PART_EMISSIVE_MASK ) |
( BOUNCE * PSYS_PART_BOUNCE_MASK ) |
( INTERP_COLOR * PSYS_PART_INTERP_COLOR_MASK ) |
( INTERP_SCALE * PSYS_PART_INTERP_SCALE_MASK ) |
( WIND * PSYS_PART_WIND_MASK ) |
( FOLLOW_SRC * PSYS_PART_FOLLOW_SRC_MASK ) |
( FOLLOW_VELOCITY * PSYS_PART_FOLLOW_VELOCITY_MASK ) |
( TARGET_POS * PSYS_PART_TARGET_POS_MASK ) ),
PSYS_PART_START_COLOR, START_COLOR,
PSYS_PART_END_COLOR, END_COLOR,
PSYS_PART_START_ALPHA, START_ALPHA,
PSYS_PART_END_ALPHA, END_ALPHA,
PSYS_PART_START_SCALE, START_SCALE,
PSYS_PART_END_SCALE, END_SCALE,
PSYS_SRC_PATTERN, PATTERN,
PSYS_SRC_BURST_PART_COUNT, COUNT,
PSYS_SRC_BURST_RATE, RATE,
PSYS_PART_MAX_AGE, AGE,
PSYS_SRC_ACCEL, ACCEL,
PSYS_SRC_BURST_RADIUS, RADIUS,
PSYS_SRC_BURST_SPEED_MIN, SPEED_MIN,
PSYS_SRC_BURST_SPEED_MAX, SPEED_MAX,
PSYS_SRC_TARGET_KEY, TARGET,
PSYS_SRC_ANGLE_BEGIN, ANGLE_BEGIN,
PSYS_SRC_ANGLE_END, ANGLE_END,
//PSYS_SRC_INNERANGLE, INNERANGLE,
//PSYS_SRC_OUTERANGLE, OUTERANGLE,
PSYS_SRC_OMEGA, OMEGA,
PSYS_SRC_MAX_AGE, LIFE,
PSYS_SRC_TEXTURE, TEXTURE
];

llParticleSystem( particle_parameters ); // Turns on the particles!
}


default
{
on_rez(integer change) { // something changed
if (CHANGED_TELEPORT) {
// llParticleSystem([]);
llResetScript(); // Resets the script
}
}
state_entry()
{
// llParticleSystem([]);
llListen(channel, "",llGetOwner(), "";);

}

changed(integer change) { // something changed
if (change & CHANGED_OWNER) { // and it was an owner change
llResetScript();
}
if (change & CHANGED_TELEPORT) {
mySetParticles();
}
}

listen(integer channel, string name, key id, string message)
{
//Only respond to objects you own, or yourself
if (id == llGetOwner())
{
if (llToLower(message)=="poof";)
{
mySetParticles();
}
}
}


}
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
08-14-2008 21:03
i wish i could get into SL right now, that is just a bad script

things that are wrong...

1) it redefines the entire particle system every time you teleport (reset script) then redefines them again when it fires

2) it checks for a change 3 times, first when you teleport then after it redefines everything that never changes it checks to see if your still the owner


as far as your actual problem its a toss up tween 1 and 2, probably a combination of both, since its so busy resetting a half page of stuff that never changes AND making sure your still the same owner between teleports, by the time it gets to change # 3 it doesnt notice you teleported because you probally have been there for a few seconds