Thread: Making Half-Life bot template work

  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    127

    Making Half-Life bot template work

    Hi

    I started programming a couple of months ago and I'm interested in making some bots for FPS games. Basically what I want to do is compile the source for a Half-Life bot, so that I can go back to it, look at it, and understand how it relates to what I'm learning from my C++ book.

    I'm using a tutorial (http://http://ai-depot.com/GameAI/Bo...Interface.html), which has told me I can download this template of an existing Half-Life bot, and compile it in MS Visual Studio. So I downloaded and installed VS Express, and tried putting the template in it :

    Unfortunately when I try to compile it I get the error "c:\sierra\half-life\hpb_bot\dlls\extdll.h(42) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
    bot_client.cpp".

    Anyone know how I can fix this and get it to compile properly in VS Express? Thanks, I would SERIOUSLY appreciate some help with this.

    The template is in the following zip, in the dlls folder:http://http://www.fileplanet.com/dl/...template_3.zip

    (that stuff is originally from this page: http://http://botman.planethalflife....ownloads.shtml)

    Again, thanks for any help.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    You also need to download the "platform SDK" from Microsoft.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    By the way, the bot template isn't for steam -- it's for old retail half-life meaning if you plan to use it with steam it won't work. Use http://hpb-bot.bots-united.com/ instead (The site looks the same, but it's run by different people and the content is also different).

  4. #4
    Registered User
    Join Date
    Sep 2007
    Posts
    127
    Thanks for the responses guys, I really appreciate that. I'm downloading the Platform SDK as I write this.
    Last edited by bengreenwood; 10-19-2007 at 03:30 PM.

  5. #5
    Registered User
    Join Date
    Sep 2007
    Posts
    127
    Okay, so I downloaded and installed the platform SDK, and also the new bot template, but it still doesn't work. I get the same error messages.

    BTW when I open the bot template I get the following messages from VS Express:

    "The project 'HPB_bot.dsp' must be converted to the current Visual C++ project format. After it has been converted, you will not be able to edit this project in previous versions of Visual Studio. Convert and open this project?"

    "The source control provider associated with this solution could not be found. The projects will be treated as not under source control. Do you want to permanently remove the source control bindings from the projects?"

    Is it okay to click yes to both of them?

    Also when I installed the SDK I noticed there was a register PSDK directories program. I tried running this- it then asked me a question which I said yes to but it didn't seem to do anything noticeable.

    Any ideas why the template still won't build? Thanks for your help.

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    > Is it okay to click yes to both of them?
    Yes - assuming you're just looking to do a bit of solo development, and not check back any changes to some online repository.

    Is it the same error message, or something else now?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  7. #7
    Registered User
    Join Date
    Sep 2007
    Posts
    127
    Yeah, it's the same as before.

  8. #8
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    If you do this at a command prompt, do you see a list of directories?
    Code:
    $> echo %INCLUDE%
    C:\PROGRA~1\MICROS~3\VC98\ATL\INCLUDE;C:\PROGRA~1\MICROS~3\VC98\INCLUDE;C:\PROGR
    A~1\MICROS~3\VC98\MFC\INCLUDE;C:\Program Files\Microsoft Visual Studio\VC98\atl\
    include;C:\Program Files\Microsoft Visual Studio\VC98\mfc\include;C:\Program Fil
    es\Microsoft Visual Studio\VC98\include
    
    $> echo %LIB%
    C:\PROGRA~1\MICROS~3\VC98\LIB;C:\PROGRA~1\MICROS~3\VC98\MFC\LIB;C:\Program Files
    \Microsoft Visual Studio\VC98\mfc\lib;C:\Program Files\Microsoft Visual Studio\V
    C98\lib
    Using explorer, do those directories exist?

    Is windows.h in one of those directories?

    Have you restarted windows/restarted Visual studio since installing the PSDK ?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  9. #9
    Registered User
    Join Date
    Sep 2007
    Posts
    127
    Actually I got it to work shortly after writing that message, but for some reason this message board wouldn't load up all last night. Thanks for the advice anyway.

    Basically I googled the error message and the solution from an existing thread was to go into Tools/options/projects and solutions/vc++ directories and from there add the include and library folders to those already in the list. Pretty fortunate that the solution turned out to be so simple because I hate screwing around with stuff like that.

    By the way do you understand the workings of this particular bot? This will sound dumb but I'm wondering how does the mod get information out of the game itself? I mean, I noticed that if you want to write something on the screen in Half-Life, you can use the code:

    ClientPrint( pPlayer, HUD_PRINTNOTIFY, "Hello world.\n");

    The problem is you can only do this if you've got the edict_t *pPlayer pointer in your function definition. And I mean.. it's not like you can just create a new function and slap that pointer in the definition, because you've got to access it (edict_t *pPlayer) in the right way. And presumably that edict_t *pPlayer thing refers to something in Half-Life itself, right? So how do you get to that?

    Again I apologise if that sounds really dumb. I'm learning C++ from a book as well, it's just that this is much more interesting. Anyway, thanks for your help again.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. help with making Borland C++ compiler work
    By Masada in forum C++ Programming
    Replies: 3
    Last Post: 06-29-2003, 11:02 AM
  2. Replies: 5
    Last Post: 11-19-2002, 07:49 PM
  3. fopen();
    By GanglyLamb in forum C Programming
    Replies: 8
    Last Post: 11-03-2002, 12:39 PM
  4. Making the Dihydrogen Oxide work for you.
    By sean in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 02-16-2002, 04:43 PM
  5. making less than and greater than work
    By mikezmr2 in forum C++ Programming
    Replies: 3
    Last Post: 09-19-2001, 07:40 PM