.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
crowbars and botman's "bot 10"
Old
  (#1)
Lord_Draco
Member
 
Lord_Draco's Avatar
 
Status: Offline
Posts: 2
Join Date: Jan 2005
Location: Hervey Bay, Australia
Default crowbars and botman's "bot 10" - 02-01-2005

Hi, I haven't got a clue about bots but I have put the bot code from botman's "bot 10" in my MOD. I need to make the bots use the crowbar across all skill levels(the 3 lowest ones dont use it at all) but can't figure out how to make it do that. I think it's in this part of bot_combat.cpp

Code:
  // if bot is carrying the crowbar...
      if (pev->weapons & (1<
      {
 	// if close to enemy, and skill level is 1, 2 or 3, use the crowbar
 	if (((distance <= 40) && (weapon_choice == 0)) ||
 	(weapon_choice == WEAPON_CROWBAR))
 	{
 		 new_weapon = weapon_ptr[WEAPON_CROWBAR];
   
 		 // check if the bot isn't already using this item...
 		 if (m_pActiveItem != new_weapon)
 			 SelectItem("weapon_crowbar");  // select the crowbar
   
 		 pev->button |= IN_ATTACK;  // use primary attack (whack! whack!)
   
 		 // set next time to "shoot"
 		 f_shoot_time = gpGlobals->time + 0.3 + 
 		 RANDOM_FLOAT(primary_fire_delay[WEAPON_CROWBAR][bot_skill][0],
 		 primary_fire_delay[WEAPON_CROWBAR][bot_skill][1]);
 		 return TRUE;
  	}   
      }
what I don't understand is, where is the skill checked?
  
Reply With Quote
Re: crowbars and botman's "bot 10"
Old
  (#2)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: crowbars and botman's "bot 10" - 02-01-2005

The code you posted doesn't contain anything that checks the skill level. Here is the original code from bot10 in bot_combat.cpp...
Code:
  // if close to enemy, and skill level is 1, 2 or 3, use the crowbar
  if (((distance <= 40) && (bot_skill <= 2) && (weapon_choice == 0)) ||
  	(weapon_choice == WEAPON_CROWBAR))
  {
The check for (bot_skilll <= 2) restricts this weapon to bots with skill=0, 1, or 2, removing this check...
Code:
  // if close to enemy, use the crowbar
   if (((distance <= 40) && (weapon_choice == 0)) ||
   	(weapon_choice == WEAPON_CROWBAR))
   {
...would allow any skill level bot to use the crowbar.

botman
  
Reply With Quote
Re: crowbars and botman's "bot 10"
Old
  (#3)
Lord_Draco
Member
 
Lord_Draco's Avatar
 
Status: Offline
Posts: 2
Join Date: Jan 2005
Location: Hervey Bay, Australia
Default Re: crowbars and botman's "bot 10" - 03-01-2005

Strange, that change is alrready in the code and it seems that all skill levels don't use crowbar. Because my MOD spawns players with only the crowbar I am just going to make them ignore targets untill they find a crowbar. Thanks for your reply Botman
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com