Hi

I figured out a little bit how to use pointers. But not everything. Below you find my code - not needed is deleted.

1.) I want to call a function instead of only remove enemy and have no idea how to do it.

2.) After I have shoot some enemies I get 2 error messages. Invalid argument and SYS crash in move_bomb(). I can "play" further. After some time I get Invalid argument at every hit.

May be calling the function is already the solution. But I don`t know the reason for errors.

Cheers

Ditje

Code:
// enemy functions ///////////////////////////////////////
function start_level_type1()
{
...
   // a loop creates 40+n enemies
   enemy = ent_create("bee1.mdl", vector(50, 1000, 500), start_bee_wave1);
...
}

function start_bee_wave1
{
   // moves the enemies until until they reach their temporary position
}

function attack_player
{
   // not done yet - get called 
   // if a all enemies reached final posion
   // or if an enemy got killed
   // of if an enemy got back from attack to temporary postion
}


// bomb functions /////////////////////////////////////////
function move_bomb() 
{
   ...
   if (HIT_TARGET) 
   {
      snd_play(snd_explode,100,0);
      punkte_spieler += 30;
      ///!!!!!!! Here is my problem !!!!!!!!!! ///////////
      ent_remove(enemy);
      my.STATE = 3;
   }
   ...
}


// player action (added in WED) ///////////////////////////
action spieler_aktion()
{
...
   bomb = ent_create("bomb.mdl",vector(my.x+last_bomb_x,my.y+10,my.z),move_bomb);
...
}



Last edited by Ditje; 08/02/10 14:40.