|
General Bot Coding See what a pain it is to get those little mechs shooting around
|
|
Council Member / E[POD]bot developer
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
|
Re: Need some help for shield support -
01-11-2004
I'm very sorry PMB but if you don't know I now learning C++ and Light Ninja don't send me any tutorial about this bots.
I will continue E[POD]bot but it will take a time.
|
|
|
|
|
Roi de France
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
|
Re: Need some help for shield support -
01-11-2004
Well you don't have to be sorry for anything, everybody can learn, I was just giving you the necessary hints to solve your problem
Did you understand completely my previous post or is there any point you need more explanation for ? Normally you should have enough info to find the bug yourself now ; but if that was not the case, don't hesitate to ask. Always ask precise questions, however. And give us as much info as possible.
RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
|
|
|
|
|
Council Member / E[POD]bot developer
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
|
Re: Need some help for shield support -
01-11-2004
OK PMB I fix all but I can't test the bots becorse I change
void FakeClientCommand(edict_t *pBot, char *arg1, char *arg2, char *arg3)
to
void FakeClientCommand(edict_t *pBot, const char *fmt, ...)
becorce some FakeClientCommand in bots.cpp don't work and now the bots connect but they don't choose a team.
What I must do now.
|
|
|
|
|
Roi de France
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
|
Re: Need some help for shield support -
01-11-2004
Why did you change the FakeClientCommand function then ? The problem was not here...
Ensure that ALL bot client commands end with a "\n" (carriage return) at the end.
RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
|
|
|
|
|
Council Member / E[POD]bot developer
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
|
Re: Need some help for shield support -
02-11-2004
I change FakeClient Command becorse the compilator give me a error mesege
" FakeClientCommand cannot convert char* to char* "
or
" FakeClientCommand cannot convert int to char* "
Last edited by The Storm; 02-11-2004 at 12:20..
|
|
|
|
|
Roi de France
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
|
Re: Need some help for shield support -
02-11-2004
...and as I see you did not want to bother understanding what these errors meant, so you decided to change the WHOLE function and just blindly copy'n'paste the one from POD-bot 2.6mm. >
That's not the right way to work, dude. EPODbot will go nowhere down this road.
If you want this new FakeClientCommand() function to work, you need to also change the Cmd_Argv, args and argc functions, and you also need to redefine g_argv and get rid of the GlobalLock() and GlobalUnlock(). And if you do that you also need to change ALL FakeClientCommand() calls so as to use formatting strings à la printf. Too bad, eh ?
You'd BETTER put back the old FakeClientCommand() code and not change stuff you don't understand yet. It's just an advice.
hint: data types.
RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
|
|
|
|
|
Council Member / E[POD]bot developer
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
|
Re: Need some help for shield support -
02-11-2004
Yes PMB I copy'n'paste this function from PodBot 2.6mm but I do this becorse that function is used from all bots like :
YaPB
PodBot 2.6mm
and your bots RACC
I don't get code from other bots.
I only get shield support from YaPB but the bots don't buy shield.
Other code I'm not get from any bots.I continue E[POD]bot from my ideas(very hard becorse I don't understand C++ very good.You know what is the reason.)
Now I back old function of FakeClientCommand and I will looking for anoder way to resolve the problem.
|
|
|
|
|
Roi de France
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
|
Re: Need some help for shield support -
02-11-2004
Okay. I assume the old FakeClientCommand is now back in place.
When your compiler gives you errors or warnings it also gives you a line number. If you double-click on that error you are being taken to the line containing the bug.
Post these lines so we can see your bugs. I can almost tell what it is, but I won't tell you what to change right now because I want you to understand your error first.
RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
|
|
|
|
|
Council Member / E[POD]bot developer
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
|
Re: Need some help for shield support -
03-11-2004
OK PMB I fix the error and I test the bots and yeah they buy shield but after they buy their weapons the bots stay on one plase 15 sec.
But this change in the weapon system crash my experiment that allow the bots to pickup better pistols.
So for now I will looking for a way for the old weapon system becorse Whistler don't change anything of his buy system in YaPB and his bots buy a shield.
So if you have other ideas how to get that to work with old weapon system please tell me.
Last edited by The Storm; 03-11-2004 at 11:10..
|
|
|
|
|
Council Member / E[POD]bot developer
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
|
Re: Need some help for shield support -
03-11-2004
Quote:
Code:
void BotBuyStuff(bot_t *pBot)
{
//char szMenuSelect[40];
edict_t *pEdict = pBot->pEdict;
#ifdef DEBUG
report_log (LOG_BOTBASE, "BotBuyStuff","Action=%d",pBot->BuyAction);
#endif
// Needs a Weapon ?
if((pBot->BuyAction == MSG_CS_BUYWEAPON_SELECT)
&& (pBot->f_buy_time+ RANDOM_LONG(1,6)/10)<gpGlobals->time)
{
pBot->BuyAction = MSG_CS_IDLE;
if(pBot->pSelected_weapon == NULL || pBot->iBuyCount>1)
{
#ifdef _DEBUG
fp=fopen("PODERROR.txt","a"); fprintf(fp, "ERROR no Weapon selected: MSG_CS_BUYWEAPON_GROUPSELECT: %s - iBuyCount=%d\n",pBot->name,pBot->iBuyCount); fclose(fp);
#endif
return;
}
// fp=fopen("bot.txt","a"); fprintf(fp, "MSG_CS_BUYWEAPON_GROUPSELECT: %s - iBuyCount=%d\n",pBot->name,pBot->iBuyCount); fclose(fp);
pBot->iBuyCount = 2;
pBot->f_buy_time=gpGlobals->time;
//sprintf("menuselect","%d",pBot->pSelected_weapon->buy_shortcut);
FakeClientCommand(pEdict, pBot->pSelected_weapon->buy_shortcut, NULL, NULL);
return;
}
if((pBot->BuyAction == MSG_CS_WEAPONBUY)
&& (pBot->f_buy_time+(20-pBot->Ph)/5 + RANDOM_LONG(1,6)/5)<gpGlobals->time)
{
pBot->BuyAction = MSG_CS_IDLE;
if((pBot->pSelected_weapon == NULL) || (pBot->iBuyCount != 2))
{
fp=fopen("bot.txt","a"); fprintf(fp, "ERROR no Weapon selected: MSG_CS_BUYWEAPON_PSSRM: %s - iBuyCount=%d\n",pBot->name,pBot->iBuyCount); fclose(fp);
return;
}
// fp=fopen("bot.txt","a"); fprintf(fp, "MSG_CS_BUYWEAPON_PSSRM: %s - iBuyCount=%d\n",pBot->name,pBot->iBuyCount); fclose(fp);
pBot->iBuyCount=3;
pBot->f_buy_time=gpGlobals->time;
// sprintf(szMenuSelect,"%d",pBot->pSelected_weapon->iBuyGroup);
// Whistler: changed this for CS 1.6
/* if (g_bIsVersion16)
{
if (UTIL_GetTeam(pBot->pEdict) == 0) // terrorist
sprintf(szMenuSelect,"%d",pBot->pSelected_weapon->iNewBuySelectT);
else // CT
sprintf(szMenuSelect,"%d",pBot->pSelected_weapon->iNewBuySelectCT);
}
else
sprintf(szMenuSelect,"%d",pBot->pSelected_weapon->iBuySelect);*/
FakeClientCommand(pEdict, pBot->pSelected_weapon->buy_shortcut, NULL, NULL);
BotPushMessageQueue(pBot,MSG_CS_BUY);
return;
}
// Needs Ammo ?
if((pBot->BuyAction==MSG_CS_BUYAMMO)
&& (pBot->f_buy_time+(20-pBot->Ph)/8)<gpGlobals->time)
{
pBot->BuyAction=MSG_CS_IDLE;
if(BotHasPrimaryWeapon(pBot)==FALSE) // Pistol ?
FakeClientCommand(pEdict, "menuselect","7", NULL);
else
FakeClientCommand(pEdict, "menuselect","6", NULL);
// fp=fopen("bot.txt","a"); fprintf(fp, "MSG_CS_BUYAMMO: %s - iBuyCount=%d\n",pBot->name,pBot->iBuyCount); fclose(fp);
pBot->iBuyCount=4;
pBot->f_buy_time=gpGlobals->time;
BotPushMessageQueue(pBot,MSG_CS_BUY);
return;
}
|
Well I can't get old weapon buy system to work so I do this what you say me to do PMB.I will fix pickup pistols think later.
Tell me where I wrong!
Now the bots buy shield and all others weapons but after the bots finish with buying they stay in one plase for 15 sec.
What I must do to remove this bug.
Last edited by The Storm; 03-11-2004 at 12:09..
|
|
|
Currently Active Users Viewing This Thread: 2 (0 members and 2 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
HTML code is Off
|
|
|
Powered by vBulletin® Version 3.8.2 Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com
|
|