.:: 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
Beginner / noob - need help :/
Old
  (#1)
Kn@rF
Guest
 
Status:
Posts: n/a
Default Beginner / noob - need help :/ - 02-07-2004

I figured i'd start making a bot, now i've spent the last 4 hours reading about HPB, and playing around in MSVS.

I want to make a bot for the mod NS (Natural-Selection)
I used the exports.c, and removed the dublicates, added it to linkfunc.cpp

next I added
Quote:
else if (strcmpi(mod_name, "nsp") == 0)
{
mod_id = NSP_DLL; #ifndef __linux__
// test if the game DLL file is NOT available outside of the Steam/PAK cache
if (access("nsp/dlls/ns.dll", 0) == -1)
{
filebuf = LOAD_FILE_FOR_ME ("dlls/ns.dll", &filesize);
filep = fopen ("nsp/dlls/ns.dll", "wb");
if (filep != NULL)
{
fwrite (filebuf, 1, filesize, filep); // if in cache, then extract it fclose (filep);
}
}
h_Library = LoadLibrary("nsp/dlls/ns.dll");
#else
h_Library = dlopen("nsp/dlls/ns_i386.so", RTLD_NOW);
#endif
}
to the h_export.cpp

and in bot.h I added #define NSP_DLL 6

so far so good, I then compiled the DLL file

changed the liblist.gam to the name of the DLL

opened NS, created a server. and puff back to the desktop :/

Is there any way i can get error logs or something :/ or do someone know what might be wrong?
  
Reply With Quote
Re: Beginner / noob - need help :/
Old
  (#2)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: Beginner / noob - need help :/ - 02-07-2004

change all the "ALERT(at_error, "blahblah")" to make it log into a file.
  
Reply With Quote
Re: Beginner / noob - need help :/
Old
  (#3)
Kn@rF
Guest
 
Status:
Posts: n/a
Default Re: Beginner / noob - need help :/ - 02-07-2004

Quote:
Originally Posted by Whistler
change all the "ALERT(at_error, "blahblah")" to make it log into a file.
Would you mind explaining a bit more precise what I should do?
I have no idea on how I can make it to log into a file
  
Reply With Quote
Re: Beginner / noob - need help :/
Old
  (#4)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: Beginner / noob - need help :/ - 02-07-2004

Code:
FILE *fp = fopen("logfile.txt", "a");
 fprintf(fp, "Insert Error Message Here!!!\n");
 fclose(fp);
If you don't know standard C I/O routines like 'fopen', 'fprintf', or 'fclose', search for them on google.com.

botman
  
Reply With Quote
Re: Beginner / noob - need help :/
Old
  (#5)
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: Beginner / noob - need help :/ - 02-07-2004

run a dedicated server and tie the bot DLL to the MSVC debugger... then set breakpoints on the critical functions such as GetEntityAPI() and GiveFnptrsToDll()
It'll tell you what's wrong since you'll be able to *see* how the code performs



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: Beginner / noob - need help :/
Old
  (#6)
Kn@rF
Guest
 
Status:
Posts: n/a
Default Re: Beginner / noob - need help :/ - 02-07-2004

Quote:
Originally Posted by Pierre-Marie Baty
run a dedicated server
Should the server load the bot DLL here, or the standard .dll file ?

Quote:
Originally Posted by Pierre-Marie Baty
and tie the bot DLL to the MSVC debugger...
Could you explain this a little more precisely?
  
Reply With Quote
Re: Beginner / noob - need help :/
Old
  (#7)
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: Beginner / noob - need help :/ - 02-07-2004


A picture is worth a thousand words...

Of course the server should load the bot DLL
And of course, the bot DLL should be compiled in DEBUG mode.

Then instead of starting the HL server the normal way, click on the "start debug" (F5) button in the MSVC toolbar. This will launch the server for you. Don't forget to set a few breakpoints before



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."

Last edited by Pierre-Marie Baty; 02-07-2004 at 18:28..
  
Reply With Quote
Re: Beginner / noob - need help :/
Old
  (#8)
Kn@rF
Guest
 
Status:
Posts: n/a
Default Re: Beginner / noob - need help :/ - 07-07-2004

the first thing that happens is that it says one or more breakpoints hav ebeen disabled, then it shows a dissasembly window :>tried to step into and so on, but can't figure out what is wrong :/
  
Reply With Quote
Re: Beginner / noob - need help :/
Old
  (#9)
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: Beginner / noob - need help :/ - 08-07-2004

That's because you haven't compiled in debug mode, the debug symbols are not enabled. Normally in place of these assembly codes you would see your C/C++ code if it was compiled with debug symbols.

To enable that you must set the appropriate options in the "C/C++" and "Link" tabs of your project settings (in the same window as the screenshot I posted above)



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: Beginner / noob - need help :/
Old
  (#10)
Kn@rF
Guest
 
Status:
Posts: n/a
Default Re: Beginner / noob - need help :/ - 09-07-2004

Would you mind cutting it out in pieces what I should do, under debug I have added what I need, apparently I can't figure out the other parts, C/C++ should be set to optimizations (Default), and link to (debug) Is this correct?
  
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