.:: 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 > HPB_bot
HPB_bot The trusty good ole mechs by botman HLDMTFCOpposing ForceDMCFront Line Force

Reply
 
Thread Tools
BotClient_CS_HLTV in HPB_template 4 does not work !
Old
  (#1)
Rifleman
This user broke our rules and has been BANNED
 
Status: Offline
Posts: 128
Join Date: Sep 2004
Location: Mars
Default BotClient_CS_HLTV in HPB_template 4 does not work ! - 07-11-2004

Code:
void BotClient_CS_HLTV(void *p, int bot_index)
{
   static int state = 0;   // current state machine state
   static int players;
   int index;
   if (state == 0)
	  players = *(int *) p;
   else if (state == 1)
   {
	  // new round in CS 1.6
	  if ((players == 0) && (*(int *) p == 0))
	  {
		 for (index = 0; index < 32; index++)
		 {
			if (bots[index].is_used)
			   BotSpawnInit (&bots[index]); // reset bots for new round
		 }
	  }
   }
}
NOTE : This code does not work ! I have try it for many times ! Why this happen , please help me to fix this error !:'(
  
Reply With Quote
Re: BotClient_CS_HLTV in HPB_template 4 does not work !
Old
  (#2)
sten
Guest
 
Status:
Posts: n/a
Default Re: BotClient_CS_HLTV in HPB_template 4 does not work ! - 07-11-2004

I't might help a bit if you would tell as what error&warning messages do you get
  
Reply With Quote
Re: BotClient_CS_HLTV in HPB_template 4 does not work !
Old
  (#3)
Rifleman
This user broke our rules and has been BANNED
 
Status: Offline
Posts: 128
Join Date: Sep 2004
Location: Mars
Default Re: BotClient_CS_HLTV in HPB_template 4 does not work ! - 07-11-2004


Code:
void BotClient_CS_HLTV(void *p, int bot_index)
{
   static int state = 0;   // current state machine state
   static int players;
   int index;
   
   if (state == 0)
	  players = *(int *) p;
   else if (state == 1)
   {
	  // new round in CS 1.6
	  if ((players == 0) && (*(int *) p == 0))
	  {
		 for (index = 0; index < 32; index++)
		 {
			if (bots[index].is_used)
			{
			   BotSpawnInit (&bots[index]); // reset bots for new round   
			   PrintMessage("Round ended\n");
			}
		 }
	  }
   }
}


Okay okay , when I put a PrintMessage function (the function print some kind of text to a file) , I found that the botspawninit are not called for the bot , I dont know why , but I think the problem comes from the code since I sure that there are no problem with the function code

Last edited by Rifleman; 07-11-2004 at 16:51..
  
Reply With Quote
Re: BotClient_CS_HLTV in HPB_template 4 does not work !
Old
  (#4)
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: BotClient_CS_HLTV in HPB_template 4 does not work ! - 07-11-2004

If you log the HLTV messages to a file with the packet details, especially the values for the 2 first packets (state = 0 and state = 1), you will figure out your problem more easily. Maybe the HLTV message changed recently in Counter-Strike.

Sending HLTV messages to players at each start of a new round is very CS specific, also.



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: BotClient_CS_HLTV in HPB_template 4 does not work !
Old
  (#5)
Rifleman
This user broke our rules and has been BANNED
 
Status: Offline
Posts: 128
Join Date: Sep 2004
Location: Mars
Default Re: BotClient_CS_HLTV in HPB_template 4 does not work ! - 08-11-2004

Bug FIXED !!! !!!8D

First , I checked the engine function , the hltv is not sent with a edict.But why in hpb_template 4 , the

Code:
			 else if (msg_type == message_HLTV)
				 botMsgFunction = BotClient_CS_HLTV;
is under the
Code:
if (ed)
, I changed its position to

Code:
		 if (msg_type == message_WeaponList)
			botMsgFunction = BotClient_CS_WeaponList;
else if (msg_type == message_HLTV)
	botMsgFunction = BotClient_CS_HLTV;
and the bot dll intercept the hltv message correctly , then we come to the function code itself :

Code:
void BotClient_CS_HLTV(void *p, int bot_index)
{
	static int state = 0; // current state machine state
	static int players = 0;
	int index;
	if (state == 0)
	{
		players = *(int *) p; // check the byte
		state++;
	}
	else if (state == 1)
	{
		  if (players == 0)
		 {
				for (index = 0; index < 32; index++)
				{
					  if (bots[index].is_used)
					  {
							BotSpawnInit (&bots[index]); 
					  }
				 }
		   }
			state = 0;
	 }
}
I changed the original code to the above one , and the result ? It worked ! !!! 8D

Last edited by Rifleman; 08-11-2004 at 06:29..
  
Reply With Quote
Re: BotClient_CS_HLTV in HPB_template 4 does not work !
Old
  (#6)
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: BotClient_CS_HLTV in HPB_template 4 does not work ! - 08-11-2004

Thanks for the hint then, I will change the HPB_bot template ASAP. It's for Counter-Strike, right ? Not for Hostile Intent or anything ?



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: BotClient_CS_HLTV in HPB_template 4 does not work !
Old
  (#7)
Rifleman
This user broke our rules and has been BANNED
 
Status: Offline
Posts: 128
Join Date: Sep 2004
Location: Mars
Default Re: BotClient_CS_HLTV in HPB_template 4 does not work ! - 08-11-2004

yes , its for cs , I want to try my luck in cs

I hope sourceforge will not reject my project

Last edited by Rifleman; 08-11-2004 at 17:28..
  
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