A very simple waterfall
by Jack Davidson · 01/27/2011 (4:17 pm) · 11 comments
Allright, because of popular demand (1 person), I am posting this resource on how to make a very simple waterfall. It uses a particle from the rocket launcher, so you don't have to privide your own. In fact, I believe you can place the code in any script file, and you will be able to use and edit it. I have it in game/art/datablocks/particles.cs.
Here is the code:
This will get you the waterfall effect you see at the very top of the mountain. The three most important variables for editing how your waterfall looks are gravityCoefficient, constAcceleration, and lifetimeMS. This will let you get any curve for your waterfall and allow you to lengthen or shorten it.
As you increase gravityCoefficient, the curve of your waterfall will point down. As you increase constAcceleration, the curve will be straighter. The waterfall in the preview image was done using four emitters, all just placed at different angles, and only with changes to these three variables.
I finally added a video. sorry it took so long:
Here is the code:
datablock ParticleData(WaterfallAParticle)
{
dragCoefficient = 0.0;
gravityCoefficient = 0.246642;
inheritedVelFactor = 0.00587084;
constantAcceleration = 0.25;
lifetimeMS = 7500;
lifetimeVarianceMS = 0;
useInvAlpha = false;
//textureName = "art/shapes/actors/common/splash";
textureName = "art/shapes/particles/millsplash01";
colors[0] = "0.645669 0.795276 1 0";
colors[1] = "0.645669 0.795276 1 0.173228";
colors[2] = "0.645669 0.795276 1 0.311";
sizes[0] = 1;
sizes[1] = 2;
sizes[2] = 9;
times[0] = 0.0;
times[1] = 0.513726;
times[2] = 1.0;
//animTexName = "art/shapes/actors/common/splash";
animtextureName = "art/shapes/particles/millsplash01";
animTexName = "art/shapes/particles/millsplash01";
spinRandomMin = "-100";
spinRandomMax = "100";
};
datablock ParticleEmitterData(WaterfallAEmitter)
{
ejectionPeriodMS = 5;
periodVarianceMS = 0;
ejectionVelocity = 2.0;
ejectionOffset = 5.19;
velocityVariance = 0.5;
thetaMin = 177;
thetaMax = 180;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvance = false;
particles = "WaterfallAParticle";
blendStyle = "ADDITIVE";
softParticles = "0";
};This will get you the waterfall effect you see at the very top of the mountain. The three most important variables for editing how your waterfall looks are gravityCoefficient, constAcceleration, and lifetimeMS. This will let you get any curve for your waterfall and allow you to lengthen or shorten it.
As you increase gravityCoefficient, the curve of your waterfall will point down. As you increase constAcceleration, the curve will be straighter. The waterfall in the preview image was done using four emitters, all just placed at different angles, and only with changes to these three variables.
I finally added a video. sorry it took so long:
About the author
I started game dev 4 years ago, knowing nothing. I've been in way over my head since, but it's never stopped me!
#2
01/27/2011 (6:02 pm)
@deepscratch: I'll probably make one tomorrow.(or tonight if I have time) How do you embed a video?
#3
its all explained there, pictures, videos, links, how to do all of this
very keen to see this, btw
01/27/2011 (7:37 pm)
(MarkupLite is enabled)its all explained there, pictures, videos, links, how to do all of this
very keen to see this, btw
#4
01/27/2011 (8:15 pm)
@deepscratch: I guess I just never noticed because it's in red. =P
#5
01/28/2011 (2:00 am)
Nice.
#6
01/28/2011 (6:36 am)
definitely must see in action.
#7
01/28/2011 (7:59 am)
A video would be nice, this might be something I'd be interested in.
#8
02/06/2011 (10:02 pm)
That's nice looking for such little code. I like it.
#9
02/08/2011 (8:31 am)
now that is real cool, I'll use that for sure!!
#10
04/14/2011 (10:08 am)
when ever i try to put the particle emitter in the world editor, there isnt anything. The particle emitter is still there, but you cant see anything. What might have caused this?
#11
When you are in the particle editor you will have two different tabs to click on. One will be the emitter attributes and the other will be the particle attributes, go into the particle attributes tab and use the Time1 slider and/or just type into the box, 0.042 and adjust accordingly.
Hope that was helpful!
12/05/2011 (1:03 am)
@Joshua Shoemaker,When you are in the particle editor you will have two different tabs to click on. One will be the emitter attributes and the other will be the particle attributes, go into the particle attributes tab and use the Time1 slider and/or just type into the box, 0.042 and adjust accordingly.
Hope that was helpful!

Torque Owner deepscratch
DeepScratchStudios