.:: 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
How to make some change in buying
Old
  (#1)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,618
Join Date: Jul 2004
Location: Bulgaria
Default How to make some change in buying - 05-12-2004

For E[POD]bot to get the bots to buy granede I must write
Code:
   FakeClientCommand(pEdict, "menuselect","8", NULL);
   FakeClientCommand(pEdict, "menuselect","4", NULL);
But if tape
Code:
   FakeClientCommand(pEdict, "buy;menuselect 8;menuselect 4", NULL, NULL);
The bots don't buy granede ???
How can I fix this.

This is not problem for Counter-Strike 1.6 becose now the bots buy weapon with shortcuts and in the shortcut is taped
Code:
   FakeClientCommand(pEdict, "buy;menuselect 4;menuselect 3", NULL, NULL);
For that reason the bots in Counter-Strike 1.5 can't buy weapons but in Counter-Strike 1.6 there is no problem becose there the bots don't use buy;menuselect, they directly use the name of weapon to buy it.

For that reason I wont to fix this.

Last edited by The Storm; 05-12-2004 at 15:59..
  
Reply With Quote
Re: How to make some change in buying
Old
  (#2)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: How to make some change in buying - 05-12-2004

i don't understand the problem? You mean in CS 1.5 they do not buy weapons and in CS 1.6 they do?

Or, the bots don't buy weapons for some reason?


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: How to make some change in buying
Old
  (#3)
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: How to make some change in buying - 05-12-2004

this is normal because you must consider that client commands are sent individually.
If a real client can send client commands in a burst separated by semicolons (e.g, "buy;menuselect A;menuselect B"), it's because his client DLL separates each command and calls the client command function THREE TIMES. Once for "buy", another time for "menuselect A", another time for "menuselect B".
The FakeClientCommand() function you are using does not permit to do that. One or two years ago I wrote a different version of FakeClientCommand() coupled with pfnCmd_Argc, Argv and Args, that implements this behaviour and enables bots to send client commands in the same way humans do (i.e, with semicolons to separate each). It is implemented in POD-bot 2.6mm, if you want to give it a look.



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: How to make some change in buying
Old
  (#4)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,618
Join Date: Jul 2004
Location: Bulgaria
Default Re: How to make some change in buying - 05-12-2004

Thanks I now will look in PODbot 2.6mm.


Edit : After 3 hours in working the functioon is changed to the FakeClientComman from PODbot 2.6mm.
Thanks a lot of to PMB.
Now I have a lot of work to change all FakeClientCommand in the bots, so maybe after some day I will tell you is the bots now buy weapon coorect for Counter-Strike 1.5.
I put comments in the new code whit your name PMB .
Thanks again.

Last edited by The Storm; 05-12-2004 at 23:33..
  
Reply With Quote
Re: How to make some change in buying
Old
  (#5)
Rifleman
This user broke our rules and has been BANNED
 
Status: Offline
Posts: 128
Join Date: Sep 2004
Location: Mars
Default Re: How to make some change in buying - 06-12-2004

if you want to do it easily , add a function like :

Code:
void Buy (edict_t *pEdict, char *cmd, char *cmd2)
{
   FakeClientCommand(pEdict, "buy", NULL, NULL);
   FakeClientCommand(pEdict, "menuselect", cmd, NULL);
   FakeClientCommand(pEdict, "menuselect", cmd2, NULL);
}
Then , when you want the bot to buy something like grenade ,

Buy (pEdict, "8", "4");
  
Reply With Quote
Re: How to make some change in buying
Old
  (#6)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,618
Join Date: Jul 2004
Location: Bulgaria
Default Re: How to make some change in buying - 06-12-2004

OK all FakeClientCommand in bot.cpp are changed.
Now the bots buy weapon correctly in CS 1.5 and CS 1.6 with no problem.
Again thanks to PMB .
  
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