.:: 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
Bot Won't Join Team
Old
  (#1)
keldecow
Member
 
Status: Offline
Posts: 4
Join Date: May 2008
Default Bot Won't Join Team - 28-05-2008

I am trying to make a DOD bot. I am using the hpb_bot_mm. Everything compiles fine and the bot will join the game when I use AddBot. I have implemented an if clause in GiveFnptrsToDll to set the mod_id and the game_dll. I have added the correct VGUIMenu message handling code to pfnMessageBegin and added the function BotClient_DOD_VGUI. As well I've added the team and class choosing code to BotStartGame. Finally, I've laced all these functions with LOG_CONSOLE to see where the error happens.

The bot never executes BotClient_DOD_VGUI. And the log doesn't show the bot receiving any network messages. I am assuming that
Code:
index = UTIL_GetBotIndex(ed);

// is this message for a bot?
if (index != -1)
{

...

LOG_CONSOLE (PLID,"pfnRegUserMsg: pszName=%s msg=%d\n",GET_USER_MSG_NAME (PLID, msg_type, NULL), msg_type);
...
}
}
will catch bot messages?

I'm not sure what the problem is. I think I may have missed a step in initializing the bot. Can anybody suggest a place I might have missed?

Thanks alot, Kelden.

Update: I tried my bot in cstrike since I didn't touch any of the mod specific code. The same problem was happening there, the bot connects but stays there. I tried rebuilding from the original source (hpb_bot_mm from the filebase) and the same error occoured. I am using VC++ Express 2005. I had to resave all the files in /metamod/ in a Win32 file format, I turned off warnings and interpret warnings as errors. I'm going to try again with warnings enabled to see if anything pops up.

Last edited by keldecow; 29-05-2008 at 00:28.. Reason: update
  
Reply With Quote
Re: Bot Won't Join Team
Old
  (#2)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
Default Re: Bot Won't Join Team - 29-05-2008

The problem is that the bot can't handle VGUI messages correct, because of that in CS we switched to classic menus and we are looking for the "ShowMenu" msg, dunno if DOD have classic menus and how you can switch your bot to them. HPB bot for CS doesn't work because its not updated.
Anyway here how we switch in CS to classic menus for the bots in the create function we put this:
Code:
ENTITY_SET_KEYVALUE(pEdict, "_vgui_menus", "0");
Lets hope that in DOD will be in the same way.
  
Reply With Quote
Re: Bot Won't Join Team
Old
  (#3)
keldecow
Member
 
Status: Offline
Posts: 4
Join Date: May 2008
Default Re: Bot Won't Join Team - 29-05-2008

Edit: Thanks, I'll try that!

Last edited by keldecow; 29-05-2008 at 01:41..
  
Reply With Quote
Re: Bot Won't Join Team
Old
  (#4)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
Default Re: Bot Won't Join Team - 29-05-2008

Just add it in to the bot creation function after the bot is created. It seems that HPB bot use the SET_CLIENT_KEYVALUE() function, so find this lines of code
Code:
if (mod_id == CSTRIKE_DLL)
      {
         SET_CLIENT_KEYVALUE( clientIndex, infobuffer, "rate", "3500.000000");
         SET_CLIENT_KEYVALUE( clientIndex, infobuffer, "cl_updaterate", "20");
         SET_CLIENT_KEYVALUE( clientIndex, infobuffer, "cl_lw", "1");
         SET_CLIENT_KEYVALUE( clientIndex, infobuffer, "cl_lc", "1");
         SET_CLIENT_KEYVALUE( clientIndex, infobuffer, "tracker", "0");
         SET_CLIENT_KEYVALUE( clientIndex, infobuffer, "cl_dlmax", "128");
         SET_CLIENT_KEYVALUE( clientIndex, infobuffer, "lefthand", "1");
         SET_CLIENT_KEYVALUE( clientIndex, infobuffer, "friends", "0");
         SET_CLIENT_KEYVALUE( clientIndex, infobuffer, "dm", "0");
         SET_CLIENT_KEYVALUE( clientIndex, infobuffer, "ah", "1");
      }
and add this line of code
Code:
SET_CLIENT_KEYVALUE( clientIndex, infobuffer, "_vgui_menus", "0");
That's all.
  
Reply With Quote
Re: Bot Won't Join Team
Old
  (#5)
keldecow
Member
 
Status: Offline
Posts: 4
Join Date: May 2008
Default Re: Bot Won't Join Team - 29-05-2008

I did, and I think I'm on the right track now. But its still not working. I think the MOTD is getting in the way from what I've seen on other forums. I'm going to put an IN_ATTACK command in...

EDIT:

DOD uses the jointeam (0|1|3|5) and cls_(classname) commands to change team/class, could I just bypass the VGUI someway and use these commands afterwords? Maybe just fire three times?

EDIT again:

lol, forgot. I didn't even get a VGUI event in the first place... I can just use the commands in BotStartGame.

Last edited by keldecow; 29-05-2008 at 02:34..
  
Reply With Quote
Re: Bot Won't Join Team
Old
  (#6)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
Default Re: Bot Won't Join Team - 29-05-2008

You are not getting VGUI because of switching to classic menus, track the "ShowMenu" message, but anyway if just the jointeam command do the trick I think it's enough.
  
Reply With Quote
Re: Bot Won't Join Team
Old
  (#7)
keldecow
Member
 
Status: Offline
Posts: 4
Join Date: May 2008
Default Re: Bot Won't Join Team - 29-05-2008

IT IS! hurray! Thank you very much for your help. I got it to work.

P.S. Would there be a place on the forum or wiki or something for me to post some DOD specific stuff? Such as the class change commands, msg_ids etc? Do you think that would be useful, or would it be unnecessary?
  
Reply With Quote
Re: Bot Won't Join Team
Old
  (#8)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
Default Re: Bot Won't Join Team - 29-05-2008

There is wiki, look up on the links of the page, there is password to keep the spam bots away but when you open the page the password will be displayed on the prompt. Go in and post everything you want.
  
Reply With Quote
Reply


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

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