Jump to content

Can someone help with this particle script?


Pamela Galli
 Share

You are about to reply to a thread that has been inactive for 4852 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I want the butterflies to move down and or sideways, just a couple of meters, but they fly up and out pretty far. I am putting it in a windchime so I don't want them to fly directly up into the ceiling, but I have changed the numbers I think might help and they don't.

 

 

// Particle Script 0.3
// Created by Ama Omega
// 10-10-2003
// Mask Flags - set to TRUE to enable
integer glow = TRUE;            // Make the particles glow
integer bounce = FALSE;          // Make particles bounce on Z plan of object
integer interpColor = TRUE;     // Go from start to end color
integer interpSize = TRUE;      // Go from start to end size
integer wind = FALSE;           // Particles effected by wind
integer followSource = FALSE;    // Particles follow the source
integer followVel = TRUE;       // Particles turn to velocity direction
// Choose a pattern from the following:
// PSYS_SRC_PATTERN_EXPLODE
// PSYS_SRC_PATTERN_DROP
// PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY
// PSYS_SRC_PATTERN_ANGLE_CONE
// PSYS_SRC_PATTERN_ANGLE
integer pattern = PSYS_SRC_PATTERN_ANGLE_CONE;
// Select a target for particles to go towards
// "" for no target, "owner" will follow object owner 
//    and "self" will target this object
//    or put the key of an object for particles to go to
key target = "";
// Particle paramaters
float age = 10.0;                  // Life of each particle
float maxSpeed = 0.5;            // Max speed each particle is spit out at
float minSpeed = 0.05;            // Min speed each particle is spit out at
string texture = "Particle Texture - Butterfly";                 // Texture used for particles, default used if blank
float startAlpha = 1;           // Start alpha (transparency) value
float endAlpha = 1;           // End alpha (transparency) value
vector startColor = <1,1,1>;    // Start color of particles <R,G,B>
vector endColor = <1,1,1>;      // End color of particles <R,G,B> (if interpColor == TRUE)
vector startSize = <0.07,0.07,0.07>;     // Start size of particles 
vector endSize = <0.07,0.07,0.07>;       // End size of particles (if interpSize == TRUE)
vector push = <0,0,0.2>;          // Force pushed on particles
// System paramaters
float rate = 4;            // How fast (rate) to emit particles
float radius = .005;          // Radius to emit particles for BURST pattern
integer count = 1;        // How many particles to emit per BURST 
float outerAngle = 1;    // Outer angle for all ANGLE patterns
float innerAngle = 0.9;    // Inner angle for all ANGLE patterns
float beginAngle = PI_BY_TWO;    // Angle Begin for all ANGLE patterns
float endAngle = PI_BY_TWO;    //Angle End for all ANGLE patterns
vector omega = <0,0,0>;    // Rotation of ANGLE patterns around the source
float life = 0;             // Life in seconds for the system to make particles
// Script variables
integer flags;
updateParticles()
{
    flags = 0;
    if (target == "owner") target = llGetOwner();
    if (target == "self") target = llGetKey();
    if (glow) flags = flags | PSYS_PART_EMISSIVE_MASK;
    if (bounce) flags = flags | PSYS_PART_BOUNCE_MASK;
    if (interpColor) flags = flags | PSYS_PART_INTERP_COLOR_MASK;
    if (interpSize) flags = flags | PSYS_PART_INTERP_SCALE_MASK;
    if (wind) flags = flags | PSYS_PART_WIND_MASK;
    if (followSource) flags = flags | PSYS_PART_FOLLOW_SRC_MASK;
    if (followVel) flags = flags | PSYS_PART_FOLLOW_VELOCITY_MASK;
    if (target != "") flags = flags | PSYS_PART_TARGET_POS_MASK;
    llParticleSystem([  PSYS_PART_MAX_AGE,age,
                        PSYS_PART_FLAGS,flags,
                        PSYS_PART_START_COLOR, startColor,
                        PSYS_PART_END_COLOR, endColor,
                        PSYS_PART_START_SCALE,startSize,
                        PSYS_PART_END_SCALE,endSize, 
                        PSYS_SRC_PATTERN, pattern,
                        PSYS_SRC_BURST_RATE,rate,
                        PSYS_SRC_ACCEL, push,
                        PSYS_SRC_BURST_PART_COUNT,count,
                        PSYS_SRC_BURST_RADIUS,radius,
                        PSYS_SRC_BURST_SPEED_MIN,minSpeed,
                        PSYS_SRC_BURST_SPEED_MAX,maxSpeed,
                        PSYS_SRC_TARGET_KEY,target,
                        PSYS_SRC_INNERANGLE,innerAngle, 
                        PSYS_SRC_OUTERANGLE,outerAngle,
                        PSYS_SRC_ANGLE_BEGIN,beginAngle, 
                        PSYS_SRC_ANGLE_END,endAngle, 
                        PSYS_SRC_OMEGA, omega,
                        PSYS_SRC_MAX_AGE, life,
                        PSYS_SRC_TEXTURE, texture,
                        PSYS_PART_START_ALPHA, startAlpha,
                        PSYS_PART_END_ALPHA, endAlpha
                            ]);
}
integer channel = 22;
default
{
    state_entry()
    {
        updateParticles();
        llListen(channel, "", llGetOwner(), "");
    }
    listen(integer channel, string name, key id, string message)
    {
        if (message == "smoke hide")
        {
            llSetLinkAlpha( LINK_SET, 0, ALL_SIDES );
            llInstantMessage( llGetOwner(), "Smokey Feet hidden." );
                } else if (message == "smoke show") {
            llSetLinkAlpha( LINK_SET, 1, ALL_SIDES );
            llInstantMessage( llGetOwner(), "Smokey Feet shown." );
        }
    }
}

// Particle Script 0.3// Created by Ama Omega// 10-10-2003
// Mask Flags - set to TRUE to enableinteger glow = TRUE;            // Make the particles glowinteger bounce = FALSE;          // Make particles bounce on Z plan of objectinteger interpColor = TRUE;     // Go from start to end colorinteger interpSize = TRUE;      // Go from start to end sizeinteger wind = FALSE;           // Particles effected by windinteger followSource = FALSE;    // Particles follow the sourceinteger followVel = TRUE;       // Particles turn to velocity direction
// Choose a pattern from the following:// PSYS_SRC_PATTERN_EXPLODE// PSYS_SRC_PATTERN_DROP// PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY// PSYS_SRC_PATTERN_ANGLE_CONE// PSYS_SRC_PATTERN_ANGLEinteger pattern = PSYS_SRC_PATTERN_ANGLE_CONE;
// Select a target for particles to go towards// "" for no target, "owner" will follow object owner //    and "self" will target this object//    or put the key of an object for particles to go tokey target = "";
// Particle paramatersfloat age = 10.0;                  // Life of each particlefloat maxSpeed = 0.5;            // Max speed each particle is spit out atfloat minSpeed = 0.05;            // Min speed each particle is spit out atstring texture = "Particle Texture - Butterfly";                 // Texture used for particles, default used if blankfloat startAlpha = 1;           // Start alpha (transparency) valuefloat endAlpha = 1;           // End alpha (transparency) valuevector startColor = <1,1,1>;    // Start color of particles <R,G,B>vector endColor = <1,1,1>;      // End color of particles <R,G,B> (if interpColor == TRUE)vector startSize = <0.07,0.07,0.07>;     // Start size of particles vector endSize = <0.07,0.07,0.07>;       // End size of particles (if interpSize == TRUE)vector push = <0,0,0.2>;          // Force pushed on particles

// System paramatersfloat rate = 4;            // How fast (rate) to emit particlesfloat radius = .005;          // Radius to emit particles for BURST patterninteger count = 1;        // How many particles to emit per BURST float outerAngle = 1;    // Outer angle for all ANGLE patternsfloat innerAngle = 0.9;    // Inner angle for all ANGLE patternsfloat beginAngle = PI_BY_TWO;    // Angle Begin for all ANGLE patternsfloat endAngle = PI_BY_TWO;    //Angle End for all ANGLE patterns
vector omega = <0,0,0>;    // Rotation of ANGLE patterns around the sourcefloat life = 0;             // Life in seconds for the system to make particles
// Script variablesinteger flags;
updateParticles(){    flags = 0;    if (target == "owner") target = llGetOwner();    if (target == "self") target = llGetKey();    if (glow) flags = flags | PSYS_PART_EMISSIVE_MASK;    if (bounce) flags = flags | PSYS_PART_BOUNCE_MASK;    if (interpColor) flags = flags | PSYS_PART_INTERP_COLOR_MASK;    if (interpSize) flags = flags | PSYS_PART_INTERP_SCALE_MASK;    if (wind) flags = flags | PSYS_PART_WIND_MASK;    if (followSource) flags = flags | PSYS_PART_FOLLOW_SRC_MASK;    if (followVel) flags = flags | PSYS_PART_FOLLOW_VELOCITY_MASK;    if (target != "") flags = flags | PSYS_PART_TARGET_POS_MASK;
    llParticleSystem([  PSYS_PART_MAX_AGE,age,                        PSYS_PART_FLAGS,flags,                        PSYS_PART_START_COLOR, startColor,                        PSYS_PART_END_COLOR, endColor,                        PSYS_PART_START_SCALE,startSize,                        PSYS_PART_END_SCALE,endSize,                         PSYS_SRC_PATTERN, pattern,                        PSYS_SRC_BURST_RATE,rate,                        PSYS_SRC_ACCEL, push,                        PSYS_SRC_BURST_PART_COUNT,count,                        PSYS_SRC_BURST_RADIUS,radius,                        PSYS_SRC_BURST_SPEED_MIN,minSpeed,                        PSYS_SRC_BURST_SPEED_MAX,maxSpeed,                        PSYS_SRC_TARGET_KEY,target,                        PSYS_SRC_INNERANGLE,innerAngle,                         PSYS_SRC_OUTERANGLE,outerAngle,                        PSYS_SRC_ANGLE_BEGIN,beginAngle,                         PSYS_SRC_ANGLE_END,endAngle,                         PSYS_SRC_OMEGA, omega,                        PSYS_SRC_MAX_AGE, life,                        PSYS_SRC_TEXTURE, texture,                        PSYS_PART_START_ALPHA, startAlpha,                        PSYS_PART_END_ALPHA, endAlpha                            ]);}
integer channel = 22;
default{    state_entry()    {        updateParticles();        llListen(channel, "", llGetOwner(), "");    }
    listen(integer channel, string name, key id, string message)    {        if (message == "smoke hide")        {            llSetLinkAlpha( LINK_SET, 0, ALL_SIDES );            llInstantMessage( llGetOwner(), "Smokey Feet hidden." );                } else if (message == "smoke show") {            llSetLinkAlpha( LINK_SET, 1, ALL_SIDES );            llInstantMessage( llGetOwner(), "Smokey Feet shown." );        }    }}

 

No clue what the smokey feet is about. Thanks!

 

Link to comment
Share on other sites

Change

vector push = <0,0,0.2>;          // Force pushed on particles

to

vector push = <0,0,-0.2>;          // Force pushed on particles

 

and

                        PSYS_SRC_INNERANGLE,innerAngle, 
                        PSYS_SRC_OUTERANGLE,outerAngle,
to
//                        PSYS_SRC_INNERANGLE,innerAngle, 
//                        PSYS_SRC_OUTERANGLE,outerAngle,
You don't want to do both Inner/Outer Angle and Angle Begin/End.
Link to comment
Share on other sites

You have two or three copies of the particle system in there, plus a listen. I can click you up a script in 2 seconds with Mote if you can describe exactly what you're after. I'm pretty sure the posted stuff isn't really what you want.

The Ama Omega script is bulky, and most of it isn't necessary. The "smokey feet" stuff is for one of the particle systems she produced, which you don't want for a wind chime.

How far do you want your butterflies to go, in what direction(s), and how often and how fast?

Link to comment
Share on other sites

 


Paladin Pinion wrote:

You have two or three copies of the particle system in there, plus a listen. I can click you up a script in 2 seconds with Mote if you can describe exactly what you're after. I'm pretty sure the posted stuff isn't really what you want.

The Ama Omega script is bulky, and most of it isn't necessary. The "smokey feet" stuff is for one of the particle systems she produced, which you don't want for a wind chime.

How far do you want your butterflies to go, in what direction(s), and how often and how fast?

 

Thank you so much Paladin (did look lot a LOT of stuff in there!)

I want them to just fly a couple of meters, outward in any or all directions. Not up into the ceiling.

 

Link to comment
Share on other sites

I imported your original settings and just changed the angle and downward acceleration. You will probably need to adjust it depending on what you want to do.  In particular, the age of the particle determines how far it goes. Three seconds may be more than you want.

 

//This script was created by Mote Particle Script Generator.

integer onFlag;

startParticles()
{
    llParticleSystem([PSYS_PART_FLAGS, 0| PSYS_PART_EMISSIVE_MASK| PSYS_PART_INTERP_COLOR_MASK| PSYS_PART_INTERP_SCALE_MASK| PSYS_PART_FOLLOW_VELOCITY_MASK,
                        PSYS_SRC_BURST_RATE, 4.0,
                        PSYS_SRC_BURST_RADIUS, 1.0,
                        PSYS_SRC_ANGLE_BEGIN, 1.5708,
                        PSYS_SRC_ANGLE_END, 3.1416,
                        PSYS_PART_MAX_AGE, 3.0,
                        PSYS_SRC_BURST_SPEED_MIN, 0.05,
                        PSYS_SRC_BURST_SPEED_MAX, 0.05,
                        PSYS_SRC_TEXTURE, "Particle Texture - Butterfly",
                        PSYS_PART_END_COLOR, <1.0,1.0,1.0>,
                        PSYS_PART_START_SCALE, <0.07,0.07,0.07>,
                        PSYS_PART_END_SCALE, <0.07,0.07,0.07>,
                        PSYS_SRC_ACCEL, <0.0,0.0,-0.2>,
                        PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE_CONE
 ]);

}


default
{
    state_entry()
    {
       onFlag = FALSE;
       llParticleSystem([]);
    }
    
    on_rez(integer start_param)
    {
        llResetScript();
    }
    
    touch_start(integer total_number)
    {
        onFlag = !onFlag;
        if (onFlag)
        {
            startParticles();
        }
        
        else
        {
            llParticleSystem([]);
        }
    }
}

 This script toggles particles on touch. If you want a different type of response, you'd need a different control structure.

I'll be inworld shortly, if you want me to change this just ping me and I'll be happy to help. It literally takes just a couple of seconds, the whole thing is automated.

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4852 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...