I can't test right now but does this work ?


Code:
BMAP* bmp_temp;
function asteroid_modify(ENTITY* ast_i)
{
        ast_i = ent_cloneskin(ast_i); // doesn't seem needed.
        bmp_temp = ent_getskin(ast_i,1);
	bmap_square_drawColor(bmp_temp, 255);
        wait_for(bmp_square_drawColor);
	ent_setskin(ast_i,bmap_temp,1);

	set(ast_i,SHADOW);
	cube_deform(ast_i, (100 + random(50)));
	ast_i.scale_x = 0.05;
	ast_i.scale_y= 0.05;
	ast_i.scale_z = 0.05;
	}

ENTITY* asteroid[200]; //initialize asteroid array
// Don't think you have to move the array to global but might be part of the problem.

function generate_asteroids()
{
		int i;
	for (i=0 ; i<200 ; i++)
		{
			asteroid[i] = ent_create("cube_small.mdl", vector(500,(0 + 20*i),0), NULL);
			ent_clone(asteroid[i]);
			wait(40);
			//bmap_square_drawColor(texture2, 255); // why 2 calls?
			asteroid_modify(asteroid[i]);
		}
}



Ok I'm just guessing and off-the-cuff trying to figure it out. If this helps, Great! if not some else probably knows better.

One thing I don't know is if after a clone the entity have a new pointer... does ent_clone(x) after the shifted entity still points to 'x' ?

@wjbender - I though random start the game (first call) at the same number not every call, is that wrong?

Last edited by Malice; 06/08/13 19:00.