Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Sprinkler System

Geoff Gavaskar
who, me?
Join date: 29 Dec 2005
Posts: 21
04-06-2006 11:35
I'm interested in making a sprinkler system for a lawn...and i figure i can have the particle stream emit from the sprinkler head, and then have it target an object that is orbiting at a radius of several to many meters.

I see how the particle system can be made to target an object using PSYS_SRC_TARGET_KEY, and how you can make it simulate gravity by using PSYS_SRC_ACCEL with an appropriate positive z in the push vector...but i don't quite see how to get the correct x and y values for the push vector.

Anyone have any hints?
Moriash Moreau
Registered User
Join date: 1 Jan 2005
Posts: 39
Don't bother with PSYS_SRC_ACCEL
04-07-2006 13:05
If you're using a target, you probably don't even need the PSYS_SRC_ACCEL parameter. It will effectively be overriden by the forces exerted to draw the particles to the target, in any case.

Just setup your particle system and PSYS_SRC_BURST_SPEED parameters to fire the particle straight up. Then, when you have the target setup off to the side (or rotating around, as you like), the particle will fire upward then be drawn to the target in a smooth arc. You can vary the effective speed of the particle, and the height of the arc, by changing the life of the particle- the particle system will adjust the movement of the particle such that it makes it to the target before the particle's age elapses. (I know that's kind of muddled- just play with it and you'll see what I mean.)

The problem with the PSYS_SRC_ACCEL vector is it's relative to the sim, not the object. So if your stream direction was turning, you'd have to reset the vector continuously- which means restarting your particle system over and over again. Laggy.

Instead of using TARGET_KEY, you might look into just installing your particle emitter at an angle, then rotating it around a central prim. Just use llTargetOmega to rotate the entire thing. Pardon my ASCII grafix here, but something like this:

\---X---/

Where the X is the root prim, and the \ and / are particle emitter prims, angled outward. Make a particle emitter that shoots the particle straight up (using PSYS_SRC_BURST_SPEED settings) and then the PSYS_SRC_ACCEL setting pulls it straight down (-Z direction). When you tilt that emitter, you'll see that the particle fires up at that angle, then falls down in a smooth arc. Link the emitter to a central prim, and use llTargetOmega to spin the object (around root prim X), and your streams will spit out arcs in smooth rotation.
Vares Solvang
It's all Relative
Join date: 26 Jan 2005
Posts: 2,235
cool!
04-07-2006 13:55
Wow Moriash,

I just clicked on this tread out of mild curiosity, and I must say your answer to this question was great. I don't think it was muddled at all. I am very new to scripting and I understood what you were saying completely. =)

Reading this stuff makes me want to go play with a sprinkler system of my own just just for the fun of it!
Zalandria Zaius
Registered User
Join date: 17 Jan 2004
Posts: 277
interesting
04-07-2006 14:48
I would go with a <0,0,-2>;(this gives the particles a bit of gravity) accelerate and use the omega in the particle system itself to make the particles go round and round. You'd need to use one of the angle patterns to make it shoot out in a stream though..

Particles are a hoot.. YAY particles..