View Single Post
Re: Something about msecval
Old
  (#24)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 4643'60N 043'0W 0.187A
Default Re: Something about msecval - 29-01-2004

Okay guys, we have an issue here. 320 is NOT a valid client speed in Counter-Strike. In Half-Life, it is.

Counter-Strike 1.6 does NOT send their max speeds to clients anymore. It's useless for us to hook pfnSetClientMaxSpeed() anymore. We have to fix the bot's max speed OURSELVES.

I suggest having a look in eLiTe's TeamBot code. It's REALLY old stuff, but there is interesting stuff. Because that's how the early bots were setting their max speeds before the pfnSetClientMaxSpeed() was discovered.
Code:
// This function is redundant, but the switch statement could be useful in future...
void SetSpeed (bot_t *pBot)
{
   // This changes the bot's maximum speed depending on the weapon it is
   // currently using
 
   switch (pBot->current_weapon.iId)
   {
	  case CS_WEAPON_P228:
		 pBot->f_max_speed = 250;
		 break;
	  case CS_WEAPON_SCOUT:
		 pBot->f_max_speed = 260;
		 break;
	  case CS_WEAPON_HEGRENADE:
		 pBot->f_max_speed = 260;
		 break;
	  case CS_WEAPON_XM1014:
		 pBot->f_max_speed = 240;
		 break;
	  case CS_WEAPON_C4:
		 pBot->f_max_speed = 250;
		 break;
	  case CS_WEAPON_MAC10:
		 pBot->f_max_speed = 250;
		 break;
	  case CS_WEAPON_AUG:
		 pBot->f_max_speed = 240;
		 break;
	  case CS_WEAPON_SMOKEGRENADE:
		 pBot->f_max_speed = 260;
		 break;
	  case CS_WEAPON_ELITE:
		 pBot->f_max_speed = 250;
		 break;
	  case CS_WEAPON_USP:
		 pBot->f_max_speed = 250;
		 break;
	  case CS_WEAPON_GLOCK18:
		 pBot->f_max_speed = 250;
		 break;
	  case CS_WEAPON_AWP:
		 pBot->f_max_speed = 210;
		 break;
	  case CS_WEAPON_MP5NAVY:
		 pBot->f_max_speed = 250;
		 break;
	  case CS_WEAPON_M249:
		 pBot->f_max_speed = 220;
		 break;
	  case CS_WEAPON_M3:
		 pBot->f_max_speed = 230;
		 break;
	  case CS_WEAPON_M4A1:
		 pBot->f_max_speed = 230;
		 break;
	  case CS_WEAPON_TMP:
		 pBot->f_max_speed = 250;
		 break;
	  case CS_WEAPON_G3SG1:
		 pBot->f_max_speed = 200;
		 break;
	  case CS_WEAPON_FLASHBANG:
		 pBot->f_max_speed = 260;
		 break;
	  case CS_WEAPON_DEAGLE:
		 pBot->f_max_speed = 250;
		 break;
	  case CS_WEAPON_SG552:
		 pBot->f_max_speed = 235;
		 break;
	  case CS_WEAPON_AK47:
		 pBot->f_max_speed = 221;
		 break;
	  case CS_WEAPON_KNIFE:
		 pBot->f_max_speed = 260;
		 break;
	  case CS_WEAPON_P90:
		 pBot->f_max_speed = 250;
		 break;
	  case CS_WEAPON_UMP45:
		 pBot->f_max_speed = 250;
		 break;
	  case CS_WEAPON_FIVESEVEN:
		 pBot->f_max_speed = 250;
		 break;
	  case CS_WEAPON_SG550:
		 pBot->f_max_speed = 210;
		 break;
   }
}
We have to apply this each time a bot changes weapons. Eventually it would be good to check if these old values are still correct after 2 or 3 Counter-Strike updates. It's now the only way to fix the bot's "speed hack" bugs.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote