Hello,

i'm working on my RTS project.
Ok the situation is this. Ähm if i shoot an enemy to death, the enemy died and 1 copy of that enemy should spawn at the same place and walk away.
It is simple laugh


So if i shoot the emeny the function "got_shot" will started then the new spider (copy) will spawn and the spawned spider should walk away (function enemy_move).

And there is the problem, when the function calls ent_create(...., enemy_move) i get the "Invalid Call in event enemy_move" - Error.

I searched here for the problem an tested the wait-cmd but nothing helps frown


Ok thats the part of the code:

Code:
function got_shoota()
{
	var i;
	
	if(you.skill30 != 1) {return;}
	my.skill99 = 1;
	ent_morph(my,spiderd_mdl);
}

function enemy_move()
{
		 var anim_percentage;
       VECTOR temp;
       my.skill99 = 0;
       
       my.emask |= (ENABLE_IMPACT | ENABLE_ENTITY);
       my.event = got_shot;
       
       while(my.skill99 == 0)
       {
           //while(1)
		 	  //{
		 	c_move (me, vector(2 * time_step, 0, 0), nullvector, GLIDE);
  			ent_animate(me, "walk", walk_percentage, ANM_CYCLE); // "walk" Animations-Loop
   		walk_percentage += 3 * time_step; // 3 = Animationsgeschwindigkeit für "walk"
   		wait (1);
   	 }
   	 
   	 set(my,PASSABLE);
   	
}

function got_shot()
{
	if(you.skill30 != 1) {return;}
	my.skill99 = 1;
	ent_morph(my,spiderd_mdl);
	ent_create(spider_mdl,you.x,enemy_move);
	
}



Sry for my bad english i hope you understand me laugh

Thank you for your help

oODarkPassionOo