.:: 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
Re: FakeClientCommand
Old
  (#11)
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: FakeClientCommand - 22-08-2005

The linker cannot find where FakeClientCommand is defined..
it is externed but not defined anywhere so the function doesn't exist and the linker can't find it.
  
Reply With Quote
Re: FakeClientCommand
Old
  (#12)
andrewcaus
Member
 
Status: Offline
Posts: 15
Join Date: Jul 2005
Default Re: FakeClientCommand - 22-08-2005

I defined it as:

void FakeClientCommand(edict_t *pBot, char *arg1, char *arg2, char *arg3);

Now, if I take it away, i get an error pointing to FakeClientCommand saying undeclared identifier. So what's the linker on about?
  
Reply With Quote
Re: FakeClientCommand
Old
  (#13)
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: FakeClientCommand - 22-08-2005

do you have the body of the function defined somewhere?
  
Reply With Quote
Re: FakeClientCommand
Old
  (#14)
andrewcaus
Member
 
Status: Offline
Posts: 15
Join Date: Jul 2005
Default Re: FakeClientCommand - 22-08-2005

No...

What is the code for it?
  
Reply With Quote
Re: FakeClientCommand
Old
  (#15)
andrewcaus
Member
 
Status: Offline
Posts: 15
Join Date: Jul 2005
Default Re: FakeClientCommand - 22-08-2005

Looking through HPB Bot and POD Bot, I can't find it.
  
Reply With Quote
Re: FakeClientCommand
Old
  (#16)
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: FakeClientCommand - 22-08-2005

Maybe you need by some more C/C++ lesons.
Let me explain:
So if you have the function FakeClientCommand() defined in dll.cpp and you want to use it in other *.cpp like bot.cpp you must define it as global function in some header file *.h like bot.h and you must be sure that bot.cpp will use this header.
So if the function is defined in dll.cpp in this way:
Code:
FakeClientCommand(bla, bla, bla)
{
// bot code 
}
you must define again that function for global to use it everywere in some header like bot.h in this way:
Code:
FakeClientCommand(bla, bla, bla);
But in to the header don't define the hole function again with the code, just define only the name FakeClientCommand(bla, bla, bla);
And now you can use FakeClientCommand() in every .cpp that will use the bot.h header file. I hope that this will help you.
  
Reply With Quote
Re: FakeClientCommand
Old
  (#17)
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: FakeClientCommand - 22-08-2005

...and BTW, the bot can be built either in the DEBUG or in the RELEASE configuration, the only difference will be that in the latter the debug symbols will be stripped out, whereas in the former they're here and all the variables are nulled before use - they aren't in release, their state is undefined.



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
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