So there is a difference between german and english manual. I think that my code is correct now. Everything is fantastic at this point. Thank you for your help and effort.

Quote:

VECTOR Weatherbox;
VECTOR Wind_direction; //Movement speed and direction

Wind_direction.x = 1;
Wind_direction.y = 10;
Wind_direction.z = -20;

BMAP* Weather_bmap = "raindrop.tga"; //The particle bmap

function Weather_part_event(PARTICLE* p)
{
//keep the particle within the box
vec_set(p.x,vector(
cycle(p.x,camera.x-Weatherbox.x,camera.x+Weatherbox.x),
cycle(p.y,camera.y-Weatherbox.y,camera.y+Weatherbox.y),
cycle(p.z,camera.z-Weatherbox.z,camera.z+Weatherbox.z)));

//update the movement speed and direction
vec_set(p.vel_x,Wind_direction);

p.lifespan = 100; // live forever
}

function Weather_part(PARTICLE* p)
{
//place particles at random positions within the box
vec_set(p.x,vector(camera.x+random(Weatherbox.x*2)-Weatherbox.x,
camera.y+random(Weatherbox.y*2)-Weatherbox.y,
camera.z+random(Weatherbox.z*2)-Weatherbox.z));

set(p, MOVE);
p.bmap = Weather_bmap;
p.size = random(1)+2;


p.event = Weather_part_event;
}

function CreateWeatherParticles(cx,cy,cz,numparticles)
{
Weatherbox.x = cx/2;
Weatherbox.y = cy/2;
Weatherbox.z = cz/2;

//create the particles
effect(Weather_part,numparticles,nullvector,nullvector);
}




Last edited by gameplan; 06/13/12 22:10.

Version: A8 free
OS: Windows 10