I have a code that randomly generates wind and stores it into a variable that holds the wind strength (w_speed_current) and a vector for the wind direction (d_direction_current).

Then I wrote this little test-script:

Code:
action leaf() {	
	my.flags |= FLAG2;
	var accUp = 0;	
	var accDown = -0.5;
	while(me) {					
		if (w_speed_current > 0.3) {
			accUp = w_speed_current * 2;
			my.roll += 2;
			my.tilt += 5;
		} else {
			if (w_speed_current > 0) {
				my.roll += 2;
				my.tilt += 5;
			} else {
				my.tilt = 90;
			}
			accUp = 0;			
		}
		vec_to_angle(my.pan, d_direction_current);				
		accDown = -0.5 - random(1);		
		c_move(me, vector((d_direction_current.x+random(2))*w_speed_current*0.5, (d_direction_current.y+random(2))*w_speed_current*0.5, accUp),vector(0,0,accDown), IGNORE_PASSABLE | IGNORE_PASSENTS | GLIDE);
		wait(1);
	}	
}



Has someone an idea or hints how to make it look a bit more realistic?

Regards,
Pegamode.