Hello,
I have a Problem with the code. I want to Merge more then one Entity, so I do like this:

Everything is good working:
Code:
function main()
{
	level_load("");
	wait(2);
	wait(1);
	demo_init();
	
	ENTITY* ent1=ent_create("p.mdl",nullvector,0);
	ENTITY* ent2=ent_create("p.mdl",vector(120,0,0),0);

	ENTITY* merged=merge_ent(ent1,ent2);
	merged.z+=200;//set this to zero, if you wanna see whether the result is identical in angle, scale and position
	int i;
	for(i=0;i<100;i++)
	{
		merged=merge_ent(merged,ent2);
		wait(1);	
	}
}


But if I paste collision_mode=0; after the first wait, it crashes in merge ent:

Code:
function main()
{
	level_load("");
	wait(2);
	collision_mode=0;
	wait(1);
	demo_init();
	
	ENTITY* ent1=ent_create("p.mdl",nullvector,0);
	ENTITY* ent2=ent_create("p.mdl",vector(120,0,0),0);

	ENTITY* merged=merge_ent(ent1,ent2);
	merged.z+=200;//set this to zero, if you wanna see whether the result is identical in angle, scale and position
	int i;
	for(i=0;i<100;i++)
	{
		merged=merge_ent(merged,ent2);
		wait(1);	
	}
}



Does anyone know where the Problem is? Without collision_mode=0; it's good working. But I need to set it to 0.



Last edited by Benni003; 07/02/12 08:18.