Does max_entities count more than models, sprites and map entities?

I just got a max_entites exceeded error, but the F11 debug panel shows that I only have 350 entities, most of them smoke sprites that rise from a tank if it is wounded (I didn't use a particle effect because I maxed out doing the effect on the rockets the tanks fire, and that effect is actually commented out right now anyways)



Here you can see the error in the game. The entity count is 358. The error says 1000.

The error only came after I changed some code, which merely consisted of moving some vector instructions out of an if-branch and should not have increased the number of entities or functions at all (the ent_create function that those vectors concern remained in that if-branch.

Code:
//This is how the code looked before I was getting a max_entity error.

//FUNCTION cannonFire()
//fires a missile from the turret when the LMB is clicked
function cannonFire()
{
	var reload =0;					//a counter that keeps the player from machine-gunning missiles
	VECTOR muzzle;					//a vector for the vertex where the missile originates (tip of the cannon)
	VECTOR muzzle2;
	while(player.health > 0)		//while the player is alive
	{	
		if(reload <= 0)				//if reload is 0 or less
		{
			if(mouse_left)				//and LMB is pressed
			{
				
                                vec_for_vertex(muzzle,turret,58);			//find the vector for vertex #58				ent_create("rocket2.mdl",muzzle,missile);	//create a rocket with the missile action
				ent_playsound(turret,shoot,1000);			//play the gun fire sound
				reload = 1;											//set reload to 1
			}
		}
		else
		{
			reload -= 0.0625 * time_step;				//reduce reload (this is a frequency for 1 shot per second)
		}
		wait(1);			//avoid endless loops
	}
}

//This is the current code.  After making this change, the max entities error popped up.

//FUNCTION cannonFire()
//fires a missile from the turret when the LMB is clicked
function cannonFire()
{
	var reload =0;					//a counter that keeps the player from machine-gunning missiles
	VECTOR muzzle;					//a vector for the vertex where the missile originates (tip of the cannon)
	VECTOR muzzle2;
	while(player.health > 0)		//while the player is alive
	{	
		vec_for_vertex(muzzle,turret,58);			//find the vector for vertex #58
		vec_set(muzzle2,muzzle);
		muzzle2.x = muzzle.x + 3000;
		vec_to_screen(muzzle2,camera);
		crosshairPan.pos_x = muzzle2.x;
		crosshairPan.pos_y = muzzle2.y;
		if(reload <= 0)				//if reload is 0 or less
		{
			if(mouse_left)				//and LMB is pressed
			{
				
				ent_create("rocket2.mdl",muzzle,missile);	//create a rocket with the missile action
				ent_playsound(turret,shoot,1000);			//play the gun fire sound
				reload = 1;											//set reload to 1
			}
		}
		else
		{
			reload -= 0.0625 * time_step;				//reduce reload (this is a frequency for 1 shot per second)
		}
		wait(1);			//avoid endless loops
	}
}



I'm not even sure if thats the code, but I do know that I have tested the game several times last night with particles and a smoking tank, possibly two smoking tanks, and no max entities error.

The rest of the code was written with maximum entities and framerate in mind, the track the tank lays as it moves is only created once a second (rather than once a frame) while it moves. The rockets are designed so only one can be fired per second.

I tried to fix it by increasing nexus to 300, and I got "Not enough entities reserved(7500)."

I set max entities to 3000, and after reducing the total number of sprites the smoke function can produce, it still crashed with the "not enough entities reserved (3000)" error.

And this was at 200 something entities.

I even had it freeze without the smoke function running.

Is there something else to this error besides the number of entities? Or does that 1000 mean something else.

None of these models are animated, and they all have very small and simple skins (as you can see).


I was once Anonymous_Alcoholic.

Code Breakpoint;