Jump to content
Sunbleached

Boat Wake Particle Script

Recommended Posts

Hello! I have a wake particle script for the boat. But it works constantly. How to make it work only when the boat is moving? Thank you for any help.

// wake particles script
// 2017


default {
    state_entry() {
        llParticleSystem( [ 
           PSYS_SRC_TEXTURE, "aaf351f6-a777-b5e8-c0a9-a2232f650742", 
           PSYS_PART_START_SCALE, <1.30000, 0.30000, 1.00000>,  PSYS_PART_END_SCALE, <0.70000, 0.70000, 0.00000>, 
           PSYS_PART_START_COLOR, <0.80000, 0.90000, 1.00000>,       PSYS_PART_END_COLOR, <0.850000, 0.90000, 1.00000>, 
           PSYS_PART_START_ALPHA, 0.1200000,            PSYS_PART_END_ALPHA, 0.0800000,     
         
           PSYS_SRC_BURST_PART_COUNT, 250, 
           PSYS_SRC_BURST_RATE,  0.010000,  
           PSYS_PART_MAX_AGE, 10, 
           PSYS_SRC_MAX_AGE, 0.000000,  
        
           PSYS_SRC_PATTERN, 4, // 1=DROP, 2=EXPLODE, 4=ANGLE, 8=ANGLE_CONE,
           PSYS_SRC_ACCEL, <0.00000, 0.00000, -0.00005>,  
           
         PSYS_SRC_BURST_RADIUS, 0.0,
           PSYS_SRC_BURST_SPEED_MIN, 0.900000,   PSYS_SRC_BURST_SPEED_MAX, 0.400000, 
        
           PSYS_SRC_ANGLE_BEGIN,  0.000000 * PI,        PSYS_SRC_ANGLE_END,  0.01000 * PI,  
           PSYS_SRC_OMEGA, <0.00000, 0.00000, 0.00000>, 
        
        // PSYS_SRC_TARGET_KEY,      llGetLinkKey(llGetLinkNum() + 1),       
              
           PSYS_PART_FLAGS, ( 0      
                                | PSYS_PART_EMISSIVE_MASK 
                        | PSYS_PART_INTERP_COLOR_MASK 
                        | PSYS_PART_INTERP_SCALE_MASK
                             // | PSYS_PART_WIND_MASK            
                             // | PSYS_PART_BOUNCE_MASK          
                             // | PSYS_PART_FOLLOW_SRC_MASK     
                             // | PSYS_PART_TARGET_POS_MASK     
                             // | PSYS_PART_TARGET_LINEAR_MASK    
            ) ]  );
    }
}

 

Share this post


Link to post
Share on other sites

Turn it off.  You can calculate the boat's speed by querying llGetVel in a timer event periodically.  llVecMag(llGetVel()) will tell you the boat's speed, then.  When it is acceptably low -- you decide how slow that is -- then you just tell the particles to stop with llParticleSystem([]) .  You will of course need to reverse things when the boat starts moving again.

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, Rolig Loon said:

Turn it off.  You can calculate the boat's speed by querying llGetVel in a timer event periodically.  llVecMag(llGetVel()) will tell you the boat's speed, then.  When it is acceptably low -- you decide how slow that is -- then you just tell the particles to stop with llParticleSystem([]) .  You will of course need to reverse things when the boat starts moving again.

 

But can it be somehow simpler? Is there a command of a motion detector? Just add one line, if the object moves then the partics go, no - they stop. I am completely lost ...

Share this post


Link to post
Share on other sites

Simpler than that?  No.  That's about as simple as a script gets.  All in all, maybe 25 lines of code, plus the particle code that you already have.  Less if you are good at scripting.

  • Thanks 1

Share this post


Link to post
Share on other sites

Thank you!

1 hour ago, Rolig Loon said:

Simpler than that?  No.  That's about as simple as a script gets.  All in all, maybe 25 lines of code, plus the particle code that you already have.  Less if you are good at scripting.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...