Hi there, some days ago I was really bored so I decided to add bots to my QVM code and improve them. So I took PBot and started editing code. I've been working on them for several days now and I'm enjoying the results. Tho I'm not good at C I'm doing my best.
But now I want to make my bots follow paths when they're wallwalking (so dretchs can stop blocking the path and other stuff) but they don't aim at the path. I suppose it's something related to wallclimbing changing view angles or shit but I don't know how that code works so I can't fix it.
So, this is that path aiming function from PBot:
qboolean botAimAtPath( gentity_t *self )
{
vec3_t dirToTarget, angleToTarget;
vec3_t top = { 0, 0, 0 };
int vh = 0;
BG_FindViewheightForClass( self->client->ps.stats[ STAT_PCLASS ], &vh, NULL );
top[2] = vh;
VectorAdd( self->s.pos.trBase, top, top );
VectorSubtract( level.paths[self->targetPath].coord, top, dirToTarget );
VectorNormalize( dirToTarget );
vectoangles( dirToTarget, angleToTarget );
self->client->ps.delta_angles[ 0 ] = ANGLE2SHORT( angleToTarget[ 0 ] );
self->client->ps.delta_angles[ 1 ] = ANGLE2SHORT( angleToTarget[ 1 ] );
self->client->ps.delta_angles[ 2 ] = ANGLE2SHORT( angleToTarget[ 2 ] );
return qtrue;
}
If anyone could help me with this I'd fuck him in the ass. Also, if I get bots to work as I want them to I'll maybe release a patch.