.:: 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
To many bots!
Old
  (#1)
andrewcaus
Member
 
Status: Offline
Posts: 15
Join Date: Jul 2005
Default To many bots! - 21-08-2005

Ok, I am making my own bots, and I have got them to initialize/join game.

Now, I set it so that only 5 bots can join:

if (botcount < 5) {
...bot code...
botcount++;
}

I started a dedicated server with maxplayers set to 10, and what happens is this:

bot joining...
bot joining...
bot joining...
bot joining...
bot joining...

BUT! The number is 5, but then automatically changes to 10. I type "status", and it's got:

Bot
(1)Bot
etc... all the way to 10.

If I start a server with maxplayers of 32, 32 bots will join. Why is this happening?
  
Reply With Quote
Re: To many bots!
Old
  (#2)
KWo
Developer of PODBot mm
 
KWo's Avatar
 
Status: Offline
Posts: 3,425
Join Date: Apr 2004
Default Re: To many bots! - 21-08-2005

Probably Your variable botcount is cleared at the beginning of the next frame - so the new frame You still have ( botcount < 5 ) - the new bots join the server...
  
Reply With Quote
Re: To many bots!
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: To many bots! - 21-08-2005

Yes, declare botcount a static variable, or put it at global scope. StartFrame() isn't comparable to a sort of "int main()" function, StartFrame() is called EVERY game tick, which corresponds if you are running a listen server to your frame rate.



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