I'm not sure if this is the best place to post this problem but it's probably a simple solution.

I'm trying to create an entity that you will follow the player and shoot at any entity that is not the player. I used AUM 56-58 workshop as the code base. The other guard follows the player. But I now need a way for the guard to detect other entities that aren't the player (so that he can shoot at them)

Here's a snippet of the code that I used. The full code is available in AUM 56-58



Code:
 if(my.status == attacking)
{
//is the road clear?
if (c_content (content_right.x, 0) + c_content (content_left.x, 0) == 2)
{

vec_set(temp, player.x);
vec_sub(temp, my.x);
vec_to_angle(my.pan, temp );//turn enemy to player
}

if(vec_dist (player.x, my.x)> 500)
{
vec_set(content_right, vector(50, -20, -15));
vec_rotate(content_right, my.pan);
vec_add(content_right.x, my.x);





this is the exact script from AUM 56-58. I changed the 'player.x' to 'ent.x' for the "my_ally" function that I based this on. The only problem is that ent.x is not recognized.

So my questions are:

1) Is 'player.x' automatically recognized as a vector?

2) What vector should I use to detect another entity that is not the player?

3) Should I use C_trace instead?

4) Am I way off and should use another function or technique instead?

I apologize for being longwinded but I appreciate any help you can provide.