With traces.
The AI drives towards the enemy (furthermore it will be a base), and jump of it there are near enough.
But if they are driving and trace something, he will turn either left or right until the trace hits nothing anymore.

I have another little question.
I notice that "ent_next" uses all entities.
Which means, that in the example below, every entity with "entity_typ = 3" becomes invisible.
But I want that only the nearest entity with "entity_typ = 3" becomes invisible.
Also the entity should become visible again, if it is not the nearest entity with "entity_typ = 3" anymore.


example:
Quote:
for (you = ent_next(NULL); you != NULL; you = ent_next(you))
{
if ((you != my) && (you.entity_typ == 3))
{
set(you,INVISIBLE);
}
else
{
reset(my,INVISIBLE);
}
}


Does anyone know how to do that?

Last edited by Random; 12/13/11 18:37.