In the declaration section:
Code:
ENTITY* my_waves;

#define VERT_X					0
#define VERT_Y					1
#define VERT_Z					2
#define VERT_SPEED				3
#define VERT_SPEED_CHANGE			4
#define MAX_VERT_DATA				5

var water_vertices_data[64][64][MAX_VERT_DATA];


The terain is 64 x 64 verticies in this case. Modify as required for your terrain size. You will also need to modify the following loop values in water_terrain_animate() for the size of your terrain:
Code:
for(i = 0; i < 64; i++ )
	{	for(j = 0; j < 64; j++ )
		{	//vert_move[i][j][VERT_SPEED]=0;			
			water_vertices_data[i][j][VERT_SPEED]=wave_cycle+random(2)-1;			
			//vert_move[i][j][VERT_SPEED_CHANGE]=random(1)-0.5;
			
    		
		}
		wave_cycle+=wave_cycle_dir;
		if( wave_cycle>0 )wave_cycle_dir--;
		else wave_cycle_dir++;
	}



Also in my initialisation function:
Code:
my_waves = ent_create("waves/WaterTerrain1.hmp", vector(0, 0, 0), water_terrain_animate);



My new system using animated models seems to work better but I haven't finished it yet. It is real complicated and needs serious simplification.

Hope this helps.


A7 Commercial
First person submarine combat simulator project
http://alexanderforeman.webs.com/fightersubgame.htm