|
|
Re: animating water
[Re: Nish]
#347767
11/18/10 18:30
11/18/10 18:30
|
Joined: May 2009
Posts: 5,367 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,367
Caucasus
|
I can offer this solution from AUM (45): Here is the code:
function fade_mist()
{
my.alpha -= 3 * time;
my.size += 0.5 * time;
if(my.alpha < 0)
{
my.lifespan = 0;
}
}
function fountain_mist()
{
temp.x = random(2) - 1;
temp.y = random(2) - 1;
temp.z = random(1) + 1; // play with this value
vec_set(my.vel_x,temp);
my.bmap = smoke123_tga;
my.size = 5;
my.lifespan = 50;
my.flare = on;
my.bright = on;
my.move = on;
my.gravity = 0;
my.alpha = 70;
my.function = fade_mist;
}
function fade_particles()
{
my.alpha -= 2 * time;
if(content(my.x) == content_solid) // the particle is inside a solid?
{
effect(fountain_mist, 1, my.x, nullvector); // generate mist
my.lifespan = 0; // don't allow the particles to continue their movement if they have hit something solid
}
if(my.alpha < 0)
{
my.lifespan = 0;
}
}
function particle_fountain()
{
temp.x = random(6) - 3;
temp.y = random(6) - 3;
temp.z = random(10) + 10; // play with this value
vec_set(my.vel_x,temp);
my.bmap = drop_tga;
my.size = 1.5;
my.flare = on;
my.bright = on;
my.move = on;
my.streak = on; // if your engine version supports it
my.gravity = 2;
my.alpha = 80;
my.lifespan = 50;
my.function = fade_particles;
}
action fountain
{
my.invisible = on;
my.passable = on;
while(1)
{
effect(particle_fountain, 15 * time, my.x, nullvector);
wait(1);
}
}
It's a C-SCRIPT, but you can convert it into LITE-C easily. I've used this website to search AUMs: GSTOOLS If you'll need help with converting into LITE-C, let me know. I'll help. Good luck.
|
|
|
Re: animating water
[Re: Nish]
#347881
11/20/10 17:11
11/20/10 17:11
|
Joined: May 2009
Posts: 5,367 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,367
Caucasus
|
Here is the converted script (TESTED):
BMAP* smoke123_tga = "smoke123.tga"; // change to your BMAP name
BMAP* drop_tga = "drop.tga"; // change to your BMAP name
function fade_mist(PARTICLE* p)
{
p.alpha -= 3 * time_step;
p.size += 0.5 * time_step;
if(p.alpha < 0)
{
p.lifespan = 0;
}
}
function fountain_mist(PARTICLE* p)
{
VECTOR temp;
temp.x = random(2) - 1;
temp.y = random(2) - 1;
temp.z = random(1) + 1; // play with this value
vec_set(p.vel_x,temp);
p.bmap = smoke123_tga;
p.size = 5;
p.lifespan = 50;
set(p,MOVE|BRIGHT);
p.gravity = 0;
p.alpha = 70;
p.event = fade_mist;
}
function fade_particles(PARTICLE* p)
{
p.alpha -= 2 * time_step;
if(c_content(p.x,0) == 3) // the particle is inside a solid?
{
effect(fountain_mist,1,p.x,nullvector); // generate mist
p.lifespan = 0; // don't allow the particles to continue their movement if they have hit something solid
}
if(p.alpha < 0)
{
p.lifespan = 0;
}
}
function particle_fountain(PARTICLE* p)
{
VECTOR temp;
temp.x = random(6) - 3;
temp.y = random(6) - 3;
temp.z = random(10) + 10; // play with this value
vec_set(p.vel_x,temp);
p.bmap = drop_tga;
p.size = 1.5;
set(p,BRIGHT|MOVE|STREAK);
// "STREAK" if your engine version supports it
p.gravity = 2;
p.alpha = 80;
p.lifespan = 50;
p.event = fade_particles;
}
action fountain()
{
set(my,INVISIBLE|PASSABLE);
while(1)
{
effect(particle_fountain, 15 * time_step, my.x, nullvector);
wait(1);
}
}
About all your other requests, I guess you need to create an other threat for that, and ask there. Good luck.
|
|
|
|