Hi all,
I have a problem with my ent_create function.
the "ms/frame" "fnc" in the [F11] menue ist kritical.
---please try to understand me, my englisch is not good, but its trick to explane these problem---

the code:
Code:
#include <acknex.h>
#include <default.c> 
VECTOR temp_old;
function placelevelobj(){
	VECTOR temp;
	var i;
	result=c_trace(temp.x,vector(temp.x,temp.y,temp.z-1000),IGNORE_ME);
	if(result<=0)
	{
		for(i=800;i>0;i--)
		ent_create("plane.mdl",temp_old,NULL);	//under the player model
	}
}
function player_ent(){
	player=my;
	vec_set(temp_old,player.x);
	while(1)
	{
		if(key_space)player.x+=time_step;
		camera.x=-25+player.x;camera.y=-25+player.y;
		if(player.x>temp_old.x+3)
		{
			temp_old.x+=3;
			placelevelobj();
		}
		wait(1);
	}
}
function main()
{
	video_mode=9;
	max_entities = 100000;
	level_load(NULL);
	vec_set(camera.x,vector(-40,0,40));
	vec_set(camera.pan,vector(45,-45,0));
	ent_create("cube.mdl",vector(0,0,0),player_ent);
}



the code create a cube as a player entity. with [space] you can move the player, if no plane under the player, placelevelobj() will start and create 600 planes, because with 600 planes you can see the problem.

how to see the problem:<-----------!
press [F11] to see ms/frame fnc value.
at start fnc is at 1 or 2 or betwen...
if you hold on, on [space] fnc will get higher value(thats ok)
if you hold on space still fnc is higher, you can see the problem.
for example, at first start i have to hold on space key for 5secunds to get fnc over 50, if I relase the space key, fnc go to 1 or 2
BUT is i press space key again, fnc is over 50 in 1 sec.

thanks for reading
if you hold on [space]