Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Would really like some Particle Help?

Deveney Brown
Registered User
Join date: 13 May 2006
Posts: 3
08-26-2006 12:55
I am trying to make a little vase that poofs out little particles every 30 seconds or so.

Below is the script that I have pieced together from lots of different example scripts trying to get what i want but I just can do. Can someone help get my little vase to poof every 30 seconds?

mySetParticles ()
{
vector START_SCALE = < 0.1, 0.1, 0.0 >;
vector END_SCALE = < 0.1, 0.1, 0.0 >;
vector START_COLOR = < 1.0, 1.0, 1.0 >;
vector END_COLOR = <1.0, 1.0, 1.0 >;
float START_ALPHA = 1.0;
float END_ALPHA = 0.0;
integer INTERP_COLOR = TRUE;
integer INTERP_SCALE = TRUE;
integer EMISSIVE = TRUE;
string TEXTURE = "Particle Image";

float AGE = 2.00;
float RATE = 1.0;
integer COUNT = 5;
float LIFE = 0.00;

integer PATTERN = PSYS_SRC_PATTERN_EXPLODE;
float RADIUS = 1.0;
float ANGLE_BEGIN = 0.10;
float ANGLE_END = 0.10;
vector OMEGA = < 1.00, 1.00, 1.00 >;

integer FOLLOW_SRC = TRUE;
integer FOLLOW_VELOCITY = TRUE;
integer WIND = TRUE;
integer BOUNCE = TRUE;
float SPEED_MIN = 0.7;
float SPEED_MAX = 1.2;
vector ACCEL = < 0.10, 0.15, 0.10 >;
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 particle hose!

if ( (AGE/RATE)*COUNT > 4096) {
llOwnerSay( "Your emitter creates too many particles!"
+ "Please decrease AGE and COUNT and/or increase RATE."
+ "Give a hoot, don't pollute!";);

}

}
default
{
state_entry() {
mySetParticles();
llSetTimerEvent(10); }


}
Phish Frye
Registered User
Join date: 18 Aug 2006
Posts: 3
08-26-2006 13:37
This code below will call your animation script and let it run for 10 seconds.... it'll then turn it off and wait 30 seconds before repeating. I left your routine out to make this easier for you to read.

Hope this helps,

Phish Frye

============================================
CODE

integer ANIMATION_OFF = 0;
integer ANIMATION_ON = 1;
integer animState = ANIMATION_OFF;

mySetParticles() {} // your animation routine

default {
state_entry() {
mySetParticles();
llSetTimerEvent(10);
}
timer() {
if(animState == 0) { // off
mySetParticles();
animState = ANIMATION_ON;
llSetTimerEvent(10); // run for ten seconds
} else {
llParticleSystem([]); // turn animation off;
llSetTimerEvent(30); // wait 30 seconds
animState = ANIMATION_OFF;
}
}

}
Deveney Brown
Registered User
Join date: 13 May 2006
Posts: 3
08-26-2006 14:05
Thanks for you help, I think this might work. It keeps asking me to set an animation. I don't know what to put here


mySetParticles() {} // your animation routine



Any help would be appreciated.
Phish Frye
Registered User
Join date: 18 Aug 2006
Posts: 3
08-26-2006 14:23
mySetParticles() {} // your animation routine


That's a placeholder for your code that you posted earlier. I used the placeholder (instead of your code) to make things more readable in my reply. This allows you to focus on the answer a little easier.

Just replace that line with your code and it will work fine.
Deveney Brown
Registered User
Join date: 13 May 2006
Posts: 3
08-26-2006 15:22
Got It!

THANK YOU, THANK YOU, THANK YOU!

Now my vase spits out little butterflies!