Hello everyone,
right now I'm trying to get a rather simple shooter system to work. For my enemies I'm using a modified AI from the AUM 57 and even though it seemed to work fine in the beginning, I'm running into a lot of problems with it.
First of all the enemy looks for you = player and by testing I know that even though the c_scan finds my player, the enemy randomly does not recognize the player entity. Sometimes I can jump up and down in front of it, sometimes it will see me right the second I step into the scan cone. C_scan seems to do fine, it's just that the player pointer is not recognized half the time. Here's the code:
if ((c_scan(my.x, my.pan, vector(160, 60, 1000), ignore_me) > 0) && (you == player))
{
my.skill1 = attacking; // then attack the player
}
On a different note: When I shoot an enemy, I want there to be some effects (blood obviously) and it works just fine this way:
if (you == ent_enemy)
{
if (hitvertex > 450 && hitvertex < 800) {
you.skill3 -= 100; //headshot kills instantly
}
effect(blood_hit,55,target,nullvector);
}
Problem: If I create two enemy entities with the same action the pointer only works for one, the other does not get any blood effects or headshots. How do I work around that problem, so that both enemies work the same? (without creating seperate actions for each enemy)
Thanks in advance!
Edit: Okay this is seriously weird. The c_scan cone works fine (event_scan of player is activated inside the cone) but the enemy only recognizes "you" as "player" if I'm on the far left side of his vision field.