.:: 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 ::. > Cyborg Factory > POD-Bot mm > Releases, Installers, Docs & Coding
Releases, Installers, Docs & Coding Where the official development happens

Reply
 
Thread Tools
doesn't this prevent them from buying grenades?
Old
  (#1)
bluebyte
Guest
 
Status:
Posts: n/a
Default doesn't this prevent them from buying grenades? - 26-05-2004

I have R2.1 of sPlOrYgOn's dll. In bot.cpp we have (between lines 3346 and 3414) :
Code:
 
// Needs an Item ?
else if (pBot->iBuyCount < 7)
{
	 // Care first about buying Armor
	 if (pBot->iBuyCount == 4)
	 {
		 if ((pBot->pEdict->v.armorvalue == 0) && (pBot->bot_money > 650))
		 {
			if (pBot->bot_money > 1000)
			{
			 if (g_bIsOldCS15)
				 FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 2\n");
			 else
				 FakeClientCommand (pEdict, "vesthelm\n");
			}
			else
			{
			 if (g_bIsOldCS15)
				 FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 1\n");
			 else
				 FakeClientCommand (pEdict, "vest\n");
			}
		 }
	 }
	 // Buy Grenade or Defuse Kit
	 else
	 {
		 if (pBot->bot_money > 300)
		 {
			// If Defusion Map & Counter buy Defusion Kit
			if ((g_iMapType & MAP_DE) && (pBot->bot_team == TEAM_CS_COUNTER) && !pBot->b_has_defuse_kit)
			{
			 if (g_bIsOldCS15)
				 FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 6\n");
			 else
				 FakeClientCommand (pEdict, "defuser\n");
			}
			// Else buy Grenade
			else
			{
			 int iGrenadeType = RANDOM_LONG (1, 100);
			 // Focus on HE Grenades
			 if (iGrenadeType < 70)
			 {
				 if (g_bIsOldCS15)
					 FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 4\n");
				 else
					 FakeClientCommand (pEdict, "hegren\n");
			 }
			 else if (iGrenadeType < 90)
			 {
				 if (g_bIsOldCS15)
					 FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 5\n");
				 else
					 FakeClientCommand (pEdict, "sgren\n");
			 }
			 else if (iGrenadeType < 100)
			 {
				 if (g_bIsOldCS15)
					 FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 3\n");
				 else
					 FakeClientCommand (pEdict, "flash\n");
			 }
			}
		 }
	 }
If I not wrong, the bot is allowed to buy a grenade only if it doesn't buy an armor or a defuse kit. Shouldn't we remove these elses:
Code:
	 // Buy Grenade or Defuse Kit
	 else
	 {
and
Code:
 
			// Else buy Grenade
			else
			{
and then place the block

Code:
 
 
			 int iGrenadeType = RANDOM_LONG (1, 100);
			 // Focus on HE Grenades
			 if (iGrenadeType < 70)
			 {
				 if (g_bIsOldCS15)
					 FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 4\n");
				 else
					 FakeClientCommand (pEdict, "hegren\n");
			 }
			 else if (iGrenadeType < 90)
			 {
				 if (g_bIsOldCS15)
					 FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 5\n");
				 else
					 FakeClientCommand (pEdict, "sgren\n");
			 }
			 else if (iGrenadeType < 100)
			 {
				 if (g_bIsOldCS15)
					 FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 3\n");
				 else
					 FakeClientCommand (pEdict, "flash\n");
			 }
just after this:
Code:
		 if (pBot->bot_money > 300)
		 {
and change 300 with for instance, 600?

this way it should first buy a grenade and then (if we place a second money-checking part) a defusal kit.

Would this be the reason why they so seldom(or never) buy (therefore use) grenades?

Last edited by bluebyte; 26-05-2004 at 23:51..
  
Reply With Quote
Re: doesn't this prevent em buying grenades?
Old
  (#2)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: doesn't this prevent em buying grenades? - 27-05-2004

Yes, you are right, however that's the way the code worked in the original POD-Bot. The bots wouldn't buy grenades if they had a defuse kit and vice versa.

I could have removed it... but at first I wanted to get the bot running exactly like in 2.5 ; it's come a long way since



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
Re: doesn't this prevent em buying grenades?
Old
  (#3)
bluebyte
Guest
 
Status:
Posts: n/a
Default Re: doesn't this prevent em buying grenades? - 27-05-2004

I have modified the source as i said and now they buy and use grenades I didn't touch anything else in the source code. Also, i have optimized the dll with intel compiler for P2/P3 processors (this is why the .dll is a little big). I hope that I have not screwed some stuff C ya...
Attached Files
File Type: zip podbot_mm(modified by bluebyte).zip (206.4 KB, 428 views)
  
Reply With Quote
Re: doesn't this prevent em buying grenades?
Old
  (#4)
>BKA< T Wrecks
Moderator [PBmm/Waypointing]& PODBot mm waypointer
 
>BKA< T Wrecks's Avatar
 
Status: Offline
Posts: 1,492
Join Date: Feb 2004
Location: C.C.A.A., Germania
Default Re: doesn't this prevent em buying grenades? - 27-05-2004

Hey, thanks bluebyte! Gonna try your dll as soon as I have time... looks like we got another coding nut to help sPlOrYgOn, huh?



Roses are #FF0000, violets are #0000FF // all my base, are belong to you.

  
Reply With Quote
Re: doesn't this prevent em buying grenades?
Old
  (#5)
bluebyte
Guest
 
Status:
Posts: n/a
Default Re: doesn't this prevent em buying grenades? - 27-05-2004

maybe, i'd be glad to
  
Reply With Quote
Re: doesn't this prevent em buying grenades?
Old
  (#6)
sPlOrYgOn
<-- He did it.
 
sPlOrYgOn's Avatar
 
Status: Offline
Posts: 1,558
Join Date: Jan 2004
Location: Los Angeles, California, USA, North America, Earth, Solar System, Milky Way.
Default Re: doesn't this prevent em buying grenades? - 28-05-2004

Okay I have changed from:
Code:
  // Needs an Item ?
   else if (pBot->iBuyCount < 7)
   {
      // Care first about buying Armor
      if (pBot->iBuyCount == 4)
      {
         if ((pBot->pEdict->v.armorvalue == 0) && (pBot->bot_money > 650))
         {
            if (pBot->bot_money > 1000)
            {
               if (g_bIsOldCS15)
                  FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 2\n");
               else
                  FakeClientCommand (pEdict, "vesthelm\n");
            }
            else
            {
               if (g_bIsOldCS15)
                  FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 1\n");
               else
                  FakeClientCommand (pEdict, "vest\n");
            }
         }
      }

      // Buy Grenade or Defuse Kit
      else
      {
         if (pBot->bot_money > 300)
         {
            // If Defusion Map & Counter buy Defusion Kit
            if ((g_iMapType & MAP_DE) && (pBot->bot_team == TEAM_CS_COUNTER) && !pBot->b_has_defuse_kit)
            {
               if (g_bIsOldCS15)
                  FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 6\n");
               else
                  FakeClientCommand (pEdict, "defuser\n");
            }

            // Else buy Grenade
            else
            {
               int iGrenadeType = RANDOM_LONG (1, 100);

               // Focus on HE Grenades
               if (iGrenadeType < 70)
               {
                  if (g_bIsOldCS15)
                     FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 4\n");
                  else
                     FakeClientCommand (pEdict, "hegren\n");
               }
               else if (iGrenadeType < 90)
               {
                  if (g_bIsOldCS15)
                     FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 5\n");
                  else
                     FakeClientCommand (pEdict, "sgren\n");
               }
               else if (iGrenadeType < 100)
               {
                  if (g_bIsOldCS15)
                     FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 3\n");
                  else
                     FakeClientCommand (pEdict, "flash\n");
               }
            }
         }
      }
to
Code:
  // Needs an Item ?
   else if (pBot->iBuyCount < 7)
   {
      // Care first about buying Armor
      if (pBot->iBuyCount == 4)
      {
         if ((pBot->pEdict->v.armorvalue < 80) && (pBot->bot_money > 650))
         {
            if (pBot->bot_money > 1000)
            {
               if (g_bIsOldCS15)
                  FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 2\n");
               else
                  FakeClientCommand (pEdict, "vesthelm\n");
            }
            else
            {
               if (g_bIsOldCS15)
                  FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 1\n");
               else
                  FakeClientCommand (pEdict, "vest\n");
            }
         }
      }

      if (pBot->bot_money > 600)
      {
         int iGrenadeType = RANDOM_LONG (1, 100);

         // Focus on HE Grenades
         if (iGrenadeType < 70)
         {
            if (g_bIsOldCS15)
               FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 4\n");
            else
               FakeClientCommand (pEdict, "hegren\n");
         }
         else if (iGrenadeType < 90)
         {
            if (g_bIsOldCS15)
               FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 5\n");
            else
               FakeClientCommand (pEdict, "sgren\n");
         }
         else if (iGrenadeType < 100)
         {
            if (g_bIsOldCS15)
               FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 3\n");
            else
               FakeClientCommand (pEdict, "flash\n");
         }
      }

      if (pBot->bot_money > 300)
      {
         // If Defusion Map & Counter buy Defusion Kit
         if ((g_iMapType & MAP_DE) && (pBot->bot_team == TEAM_CS_COUNTER) && !pBot->b_has_defuse_kit)
         {
            if (g_bIsOldCS15)
               FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 6\n");
            else
               FakeClientCommand (pEdict, "defuser\n");
         }
      }
Is this what you wanted?
  
Reply With Quote
Re: doesn't this prevent em buying grenades?
Old
  (#7)
bluebyte
Guest
 
Status:
Posts: n/a
Default Re: doesn't this prevent em buying grenades? - 28-05-2004

I made it like that:

Code:
 	else if (pBot->iBuyCount < 7)
{
	 // Care first about buying Armor
	 if (pBot->iBuyCount == 4)
	 {
		 if ((pBot->pEdict->v.armorvalue == 0) && (pBot->bot_money > 650))
		 {
			if (pBot->bot_money >= 1000)
			{
			 if (g_bIsOldCS15)
				 FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 2\n");
			 else
				 FakeClientCommand (pEdict, "vesthelm\n");
			}
			else if (pBot->bot_money >= 650)
			{
			 if (g_bIsOldCS15)
				 FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 1\n");
			 else
				 FakeClientCommand (pEdict, "vest\n");
			}
		 }
	 }
 
	 // Buy Grenade or Defuse Kit
 
		 if (pBot->bot_money >= 300)
		 {
			 int iGrenadeType = RANDOM_LONG (1, 100);
 
			 // Focus on HE Grenades
			 if (iGrenadeType < 75)
			 {
				 if (g_bIsOldCS15)
					 FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 4\n");
				 else
					 FakeClientCommand (pEdict, "hegren\n");
			 }
			 else if (iGrenadeType < 82)
			 {
				 if (g_bIsOldCS15)
					 FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 5\n");
				 else
					 FakeClientCommand (pEdict, "sgren\n");
			 }
			 else
			 {
				 if (g_bIsOldCS15)
					 FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 3\n");
				 else
					 FakeClientCommand (pEdict, "flash\n");
			 }
	   }
 
// If Defusion Map & Counter buy Defusion Kit
		 if ((g_iMapType & MAP_DE) && (pBot->bot_team == TEAM_CS_COUNTER) && !pBot->b_has_defuse_kit && pBot->bot_money >= 200)
		 {
		 if (g_bIsOldCS15)
		 FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 6\n");
		 else
		 FakeClientCommand (pEdict, "defuser\n");
		 }
 
	 pBot->iBuyCount = 0; // Finished Buying
	 return;
}
 
pBot->iBuyCount = 0; // Finished Buying
 
return;
}
I think we'd better separate the money checking part for the grenades from the money checking part of defuse kit. I mean here:

Code:
 
	 // Buy Grenade or Defuse Kit
 
		 if (pBot->bot_money >= 300)
instead of 600. Also I had to remove one of the elses below(in // Finished Buying part). Finally i made them buy a lil bit more HE and a lil bit less SMOKE greandes. I recommend u to take my code instead, to save u some time. U can trust me i have tested this code . So here is the whole stuff ready to copy-paste:

Code:
 // Needs an Item ?
else if (pBot->iBuyCount < 7)
{
	 // Care first about buying Armor
	 if (pBot->iBuyCount == 4)
	 {
		 if ((pBot->pEdict->v.armorvalue == 0) && (pBot->bot_money > 650))
		 {
			if (pBot->bot_money >= 1000)
			{
			 if (g_bIsOldCS15)
				 FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 2\n");
			 else
				 FakeClientCommand (pEdict, "vesthelm\n");
			}
			else if (pBot->bot_money >= 650)
			{
			 if (g_bIsOldCS15)
				 FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 1\n");
			 else
				 FakeClientCommand (pEdict, "vest\n");
			}
		 }
	 }
	 // Buy Grenade or Defuse Kit
		 if (pBot->bot_money >= 300)
		 {
			 int iGrenadeType = RANDOM_LONG (1, 100);
			 // Focus on HE Grenades
			 if (iGrenadeType < 75)
			 {
				 if (g_bIsOldCS15)
					 FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 4\n");
				 else
					 FakeClientCommand (pEdict, "hegren\n");
			 }
			 else if (iGrenadeType < 82)
			 {
				 if (g_bIsOldCS15)
					 FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 5\n");
				 else
					 FakeClientCommand (pEdict, "sgren\n");
			 }
			 else
			 {
				 if (g_bIsOldCS15)
					 FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 3\n");
				 else
					 FakeClientCommand (pEdict, "flash\n");
			 }
	   }
 
// If Defusion Map & Counter buy Defusion Kit
		 if ((g_iMapType & MAP_DE) && (pBot->bot_team == TEAM_CS_COUNTER) && !pBot->b_has_defuse_kit && pBot->bot_money >= 200)
		 {
		 if (g_bIsOldCS15)
		 FakeClientCommand (pEdict, "buy;menuselect 8;menuselect 6\n");
		 else
		 FakeClientCommand (pEdict, "defuser\n");
		 }
	 pBot->iBuyCount = 0; // Finished Buying
	 return;
}
pBot->iBuyCount = 0; // Finished Buying
return;
}
Plz note that after these changes the defuse kit became kind of lower-priority, I mean it comes after the grenades. (also note that i added that money checking for the defuse kit to it's if header). I this is how it should be now; since IMHO many players first prefer first buying grenades.

Last edited by bluebyte; 28-05-2004 at 12:31..
  
Reply With Quote
Re: doesn't this prevent em buying grenades?
Old
  (#8)
sPlOrYgOn
<-- He did it.
 
sPlOrYgOn's Avatar
 
Status: Offline
Posts: 1,558
Join Date: Jan 2004
Location: Los Angeles, California, USA, North America, Earth, Solar System, Milky Way.
Default Re: doesn't this prevent em buying grenades? - 29-05-2004

k.
Your changes have been added.
  
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