.:: 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 > RealBot > Help request
Help request Need help? Ask around here! (for questions about the source code, go to the RealBot 'Source')

Reply
 
Thread Tools
Problem with AMX script
Old
  (#1)
pinstripebert
Guest
 
Status:
Posts: n/a
Default Problem with AMX script - 25-02-2004

I'm trying to get this script working that will automatically add/remove bots to keep the server at a minimum amount of players (4 bots, 3 bots 1 player, 2 bots 2 players, etc). It works fine to begin, puts 4 bots in. However, when the first player joins the player count goes up to 5, so the program kicks a bot (using "realbot remove 1"). The problem is that after this happens the player count stays at 5, so next cycle it kicks another bot, and so on untill it is trying to remove bots when there are none. I tried using the
Code:
  get_playersnum(flag = 0)
  get_players(players[32], &num ,const flags[]="", const team[]="")
functions to get the count, but they both produce the same problem.

Does anyone have any ideas to help me????
  
Reply With Quote
Re: Problem with AMX script
Old
  (#2)
Terran
Member
 
Terran's Avatar
 
Status: Offline
Posts: 431
Join Date: Jan 2004
Default Re: Problem with AMX script - 25-02-2004

There is a bug if you use AMX and any bot. After some connects and disconnects AMX fails to initialize the players data structures! Therefore AMX reports wrong player numbers which confuses any AMX plugins which depend on them (PTB, WC3...).
The only way to get arount this problem is to do the playercount on your own. This is quite easy all you need is do add two log events: "entered game" and "disconnected". For an example have a look at my joebot_control AMX plugin.
I hadn't time yet to port the plugin back to realbot but it's not that hard to do...
  
Reply With Quote
Re: Problem with AMX script
Old
  (#3)
pick#pocket
Guest
 
Status:
Posts: n/a
Default Re: Problem with AMX script - 26-02-2004

Im kinda having the same problem, rather then wanting the info of all the players on the server. I want the info on one team.

Code:
get_players(players,num,"ae","CT")
This would sometimes work.

I get what your trying to say by logging the connects and disconnects to get the client count, but is there a way to log which client joins which team?
  
Reply With Quote
Re: Problem with AMX script
Old
  (#4)
Terran
Member
 
Terran's Avatar
 
Status: Offline
Posts: 431
Join Date: Jan 2004
Default Re: Problem with AMX script - 26-02-2004

You could register a "joined ... team" log event.
But there are some other difficulties with this approach as you need to know which player is in which team but this can be done with those log events.
  
Reply With Quote
Re: Problem with AMX script
Old
  (#5)
Terran
Member
 
Terran's Avatar
 
Status: Offline
Posts: 431
Join Date: Jan 2004
Default Re: Problem with AMX script - 26-02-2004

I've written a small AMX plugin as a workaround to those problems. It provides five cvars which contain the current numbers of players in each team (and more).
You can download playertrack at my website...
  
Reply With Quote
Re: Problem with AMX script
Old
  (#6)
pick#pocket
Guest
 
Status:
Posts: n/a
Default Re: Problem with AMX script - 27-02-2004

Nice plugin, will work nicely

Thanks Terran
  
Reply With Quote
Re: Problem with AMX script
Old
  (#7)
Terran
Member
 
Terran's Avatar
 
Status: Offline
Posts: 431
Join Date: Jan 2004
Default Re: Problem with AMX script - 08-03-2004

new version available:

Changelog:
v0.2: two new cvars added: tn_pt_humans and tn_pt_bots
  
Reply With Quote
Re: Problem with AMX script
Old
  (#8)
pick#pocket
Guest
 
Status:
Posts: n/a
Default Re: Problem with AMX script - 08-03-2004

Those cvars would be used for player-bot balancing, correct?
  
Reply With Quote
Re: Problem with AMX script
Old
  (#9)
Terran
Member
 
Terran's Avatar
 
Status: Offline
Posts: 431
Join Date: Jan 2004
Default Re: Problem with AMX script - 09-03-2004

You could use it this way for your own plugins .
The current versions of my bot plugins don't depend on the playertrack plugin, they do the count on their own...
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 - 2025, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com