BotPointAreaNum returns 0
Posted: Tue Jul 10, 2012 7:43 am
In EntityPlus there's the possibility to add botspawn entities to a map which, when triggered, spawns a bot in that position. You can also have these botspawns target info_waypoint entities which should make the bot move towards that waypoint or along a (circular) path of waypoints.
So far, this has always worked out for me, but now I'm working on a new map and when spawning a bot I get the console message "no AAS area for waypoint at (x, y, z)". This is an EntityPlus specific message.
The code that emits this error message is as follows:
curWpEnt is the current info_waypoint entity.
(full code viewable here).
So basically, the problem here is that BotPointAreaNum returns 0.
The BotPointAreaNum (which is as far as I know an unmodified function from the plain Q3 source code) is as follows:
The code path it follows is all the way through the function up to the last return. My question is: what could cause BotPointAreaNum to return 0? I'm 100% sure the entities aren't (partially) inside solids or (bot)clips or unreachable. Is there something I could do in the map to fix this?
So far, this has always worked out for me, but now I'm working on a new map and when spawning a bot I get the console message "no AAS area for waypoint at (x, y, z)". This is an EntityPlus specific message.
The code that emits this error message is as follows:
Code: Select all
wpArea = BotPointAreaNum( curWpEnt->s.origin );
if( !wpArea )
{
G_Printf("no AAS area for waypoint at %s \n", vtos(curWpEnt->s.origin) );
return;
}
(full code viewable here).
So basically, the problem here is that BotPointAreaNum returns 0.
The BotPointAreaNum (which is as far as I know an unmodified function from the plain Q3 source code) is as follows:
Code: Select all
int BotPointAreaNum(vec3_t origin) {
int areanum, numareas, areas[10];
vec3_t end;
areanum = trap_AAS_PointAreaNum(origin);
if (areanum) return areanum;
VectorCopy(origin, end);
end[2] += 10;
numareas = trap_AAS_TraceAreas(origin, end, areas, NULL, 10);
if (numareas > 0) return areas[0];
return 0;
}