View Single Post
Bot aiming (the /=-3 part)
Old
  (#1)
DarkAngel
Member
 
Status: Offline
Posts: 2
Join Date: Feb 2005
Default Bot aiming (the /=-3 part) - 10-02-2005

Hey, ive been HL modding for a long time, but not with bots. Ive come across code in the SDK which divides a players pitch by -3 but never knew why. Now that im making a bot, ive noticed that sometimes they aim at the ground in front of a player by mistake, and i think its to do with this 3 business.

ATM my code works like this:
Code:
 
pEdict->v.v_angle.x = -pEdict->v.v_angle.x;
//  Run the bot's brain here
 while(pEdict->v.angles.x>180)pEdict->v.angles.x-=360;
 while(pEdict->v.angles.x<-180)pEdict->v.angles.x+=360;
 pEdict->v.angles.x = pEdict->v.v_angle.x/3.0f;
 pEdict->v.angles.y = pEdict->v.v_angle.y;
 pEdict->v.angles.z = 0;
 pEdict->v.v_angle.x = -pEdict->v.v_angle.x;
 g_engfuncs.pfnRunPlayerMove( pEdict, pEdict->v.v_angle, flMoveSpeed,
		 flStrafeSpeed, 0, pEdict->v.button, 0, gpGlobals->frametime*1000);
is this correct? and could someone explain why the pitch has to be divided by 3? or should it be -3?
  
Reply With Quote