Jump to content

Particles that travel from the target to the emitter?


Tetsuryu Vlodovic
 Share

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

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

Recommended Posts

Is there any way to make particles move from the target directly to the emitter, instead of the other way around? I'm trying to script something that would make particles appear to come from another avatar and move towards an attachment I'm wearing, but short of making everyone else wear the emitters, there doesn't seem to be a non-janky way of doing it. Right now I'm just having the emitter float a distance away from me and I'm thinking about using raycasting to determine avatar distance and then move the emitter away from the root prim that distance, but even then I have to attach the thing to an eyeball to even get an approximately correct direction, and even then the angle is limited by the range of the eyeball bone rotations.

Is there any way to do it or do I have to file a jira to request a new function for this?

Link to comment
Share on other sites

No straightforward way, but can be done to some extent:

  • Have target (structure unimportant) and source (at least 2 prims) as separate objects.
  • Attach target where you want the particles to go to, and have it communicate its UUID somehow to the source.
  • Attach source to avatar center with position <0, 0, 0> so you're able to ignore animations.
  • Find the desired point where you want to launch particles from, compute the offset to that point based on your avatar's position and rotation (vector/rotation math left as an exercise for the reader), then move the CHILD prim to that position via setlinkprimitiveparams PRIM_POS_LOCAL: this is not restricted by the 3.5 m attachment position limit, but linkset size limit which is somewhere around 50 meters or so.
  • Start the particle effect on the child prim.

You can't be actually moving or rotating while the effect happens or the positioned child also moves.

Edited by Frionil Fang
  • Like 2
Link to comment
Share on other sites

4 minutes ago, Tetsuryu Vlodovic said:

Is there any way to make particles move from the target directly to the emitter, instead of the other way around?

It's possible in a very limited way. By using an ANGLE or ANGLE_CONE pattern combined with a tight angle begin/end slice, a burst radius, and having the emitter target itself, you can make the particles generate a distance from the emitter and flow into it instead of the other way around.

default 
{
    state_entry() 
    {
        llParticleSystem ([
            PSYS_PART_START_SCALE, <0.0,0.2,FALSE>,     PSYS_PART_END_SCALE, <0.2,0.0, FALSE>, 
            PSYS_PART_START_COLOR, <1.0,1.0,1.0>,       PSYS_PART_END_COLOR, <0.431,0.823,1.0>,
            PSYS_PART_START_GLOW, 0.0,                  PSYS_PART_END_GLOW, 1.0,
            PSYS_PART_START_ALPHA, 1.0,                 PSYS_PART_END_ALPHA, 1.0, 
            //=======Blending Patameters:
            //PSYS_PART_BLEND_FUNC_SOURCE,    0,
            //PSYS_PART_BLEND_FUNC_DEST,      0,
            //=======Production Parameters:
            PSYS_SRC_BURST_PART_COUNT, 5,               PSYS_SRC_BURST_RATE, 0.1,  
            PSYS_PART_MAX_AGE, 2.0,                    PSYS_SRC_MAX_AGE, 0.0,  
            //=======Placement Parameters:
            PSYS_SRC_PATTERN, 8, // 1=DROP, 2=EXPLODE, 4=ANGLE, 8=ANGLE_CONE,
            //=======Placement Parameters (for any non-DROP pattern):
            PSYS_SRC_BURST_SPEED_MIN, 0.0,      PSYS_SRC_BURST_SPEED_MAX, 0.0, 
            PSYS_SRC_BURST_RADIUS, 5.0,
            //=======Placement Parameters (only for ANGLE & CONE patterns):
            PSYS_SRC_ANGLE_BEGIN, 0.00,     PSYS_SRC_ANGLE_END, 0.1,  
            //PSYS_SRC_OMEGA, <0,0,0>,
            //=======After-Effect and Influence Parameters:  
            PSYS_SRC_TARGET_KEY,            llGetKey(),
            PSYS_SRC_ACCEL, <0.0,0.0,0.0>,
            PSYS_PART_FLAGS, 0
                |PSYS_PART_INTERP_COLOR_MASK
                |PSYS_PART_INTERP_SCALE_MASK
                |PSYS_PART_FOLLOW_VELOCITY_MASK
                |PSYS_PART_TARGET_POS_MASK
                |PSYS_PART_EMISSIVE_MASK
        ]);
    }
}

But as said above, this is extremely limited. You would have to continually update the orientation of the emitter to face the target avatar, as well as update the radius based on how far away the target avatar was. It would be much saner (and look better) to have your emitter positioned near the target avatar and have the resulting particles target your attachment.

Either Frionil's method, or making the emitter be a small, invisible, floating, phantom vehicle that could essentially follow the targert would yield better results.

 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Then I'm afraid at present you're probably limited to the kludge I posted above, or Frionil's suggestion.

But your feature request seems like a pretty simple and iterative expansion, so I think it might have a good chance at getting accepted. Of course, don't expect it to be implemented soon even if it is.

Speaking of, there is something you should probably be mindful of. When a particle stream targets an avatar, it zeros on on the agent's center, which would be the avatar's... um... crotch. So even in the best scenario where your request is implemented, you might have to contend with that.

Edit: Frionil's suggestion would probably be the way to go then. You'd be wearing both the emitter and target prims and using some tricks to offset the worn emitter to be more or less at the target avatar's position.

Edited by Fenix Eldritch
corrections
Link to comment
Share on other sites

19 hours ago, Tetsuryu Vlodovic said:

short of making everyone else wear the emitters

If possible, this will produce by far the most satisfactory effect, and it's dead easy if "everyone else" is in an Experience so you can temp-attach stuff to them, no muss no fuss. Same effect if you can charm them into accepting a PERMISSION_ATTACH request, but yuck. Note, however, that there's one Experience that will do the trick and is commonly already granted permission: AVsitter's experience for attaching PROP1 items—but only on land that permits that Experience.

Obviously such attachments aren't applicable to the general case, but where possible it'll be incomparably better than the alternative.

  • Like 1
Link to comment
Share on other sites

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