I`m working on a little "Magnet-Game". So I was trying out the Code from AUM74. It works fine except one error message.
Every time my player detected a magnet-entity the message
" invalid call in event got_scanned" appears.

Okay, then I was debbuging my Code. The error comes always after this line:
Code:
c_move (my, vector(6 * time_step, 6 * time_step, 6 * time_step), nullvector, GLIDE);


But why? And if i klick ok, the error-message disappears and i can play(the magnets working good). But why this message if it works fine after that??

Here the "magnet-code":

Code:
action player_move()
{ 
...//movement code

c_scan(my.x, my.pan, vector(360, 180, 200), IGNORE_ME); 
}

function got_scanned()

{

       my.event = NULL; // the entities will follow the magnet from now on

       VECTOR temp_pos;

       while (1)

       {

               if (vec_dist (player.x, my.x) > 100) // the object isn't close enough to the magnet?
               {

                       vec_set(temp_pos, player.x);

                       vec_sub(temp_pos, my.x);

                       vec_to_angle(my.pan, temp_pos);

                     

                       // the entity is oriented towards the magnet here

                       c_move (my, vector(6 * time_step, 6 * time_step, 6 * time_step), nullvector, GLIDE);   //AFTER THAT THE ERROR APPEARS     
               }

               wait (1);

       }

}

 

// the entities that have this action attached to them are sensitive to the magnet entity

action sensitive_ents()

{

       my.emask |= ENABLE_SCAN; // make this entity sensitive to scanning

       my.event = got_scanned;

}



thx for help!


A8 Commercial
A5 Standart
---------------
created games: - Bomber Maniacs