Jump to content

Why would this particle find script stop working when in an attached prim?


Life Camino
 Share

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

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

Recommended Posts

I'm working on a particle find script to locate an avatar and the script works fine when placed in a stand alone prim rezzed in world.  But, when the script is in a prim that is attached to my avatar, the particle stream goes off in the wrong direction.  Why might this be happening?

 

find(key avatar)
{
    llOwnerSay("Locating " + llKey2Name(avatar) + " with a particle stream.  Type '/find off' to cancel...");
    list temp_list = llGetObjectDetails(avatar, [OBJECT_POS]);
    vector avi_pos = llList2Vector(temp_list, 0);
    if (llVecDist(llGetPos(), avi_pos) > 100.0)
    {
        llOwnerSay(llKey2Name(avatar) + " is too far away to find with the particle stream...");
        find_flag = FALSE;
        return;
    }
    integer n = llGetNumberOfPrims();
    integer i;
    integer find_link;
    for (;i<n;i++)
    {
        if (llGetLinkName(i) == "FIND")
        {
            find_link = i;
        }
    }
    llLinkParticleSystem(find_link, [
            PSYS_PART_FLAGS,( 0 
                |PSYS_PART_INTERP_COLOR_MASK
                |PSYS_PART_FOLLOW_VELOCITY_MASK
                |PSYS_PART_TARGET_POS_MASK
                |PSYS_PART_EMISSIVE_MASK ), 
            PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_DROP ,
            PSYS_PART_START_ALPHA,1,
            PSYS_PART_END_ALPHA,1,
            PSYS_PART_START_COLOR,<0,0,1> ,
            PSYS_PART_END_COLOR,<0,1,1> ,
            PSYS_PART_START_SCALE,<0.25,0.25,0>,
            PSYS_PART_END_SCALE,<0.25,0.25,0>,
            PSYS_PART_MAX_AGE,
            PSYS_SRC_MAX_AGE,0,
            PSYS_SRC_ACCEL,<0,0,0.09375>,
            PSYS_SRC_BURST_PART_COUNT,1,
            PSYS_SRC_BURST_RADIUS,0,
            PSYS_SRC_BURST_RATE,0.01,
            PSYS_SRC_BURST_SPEED_MIN,0,
            PSYS_SRC_BURST_SPEED_MAX,0.0976563,
            PSYS_SRC_ANGLE_BEGIN,3.125,
            PSYS_SRC_ANGLE_END,0,
            PSYS_SRC_OMEGA,<0,0,0>,
            PSYS_SRC_TEXTURE, (key)"",
            PSYS_SRC_TARGET_KEY, avatar
         ]); 
}

 

Link to comment
Share on other sites

Have you checked to be sure that the attachment is pointed in the direction that you think it should?  A particle emitter always sends particles from its center in the +Z direction. If you have the emitter attached at a nice, stable spot (like your center attach position) be sure that its +Z axis is aligned with your body's +X direction so that particles stream straight forward from you.  Other than that, I can't see a reaon why your partcles shouldn't flow directly to your target.

Link to comment
Share on other sites

You mention using the script in a priim attached to your avatar. The script has a section for getting the number of links and finding the one called FIND. Are you using a linked object for this when attached to your avatar? If not, you might consider dispensing with the link finding section and just using llParticleSystem. If you are using a linked object, designate one link as the emitter and hard code its link number into llLinkParticleSystem.

Also, experiment with using PSYS_PART_TARGET_LINEAR_MASK  instead of PSYS_PART_TARGET_POS_MASK and see what happens.

Often, I have found, when troubleshooting a script, making everything as simple and uncomplicated as possible can help a lot.

As a last thought, bear in mind that heavy use of particles around you, and even where you can't see them, can steal from your viewer's total allotment of particles, causing your local effects to seem broken.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3454 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...