Raised This Month: $42 Target: $400
 10% 

Bots vs. Humans (co-op) for TFC


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Team Fortress Classic        Category:   Gameplay       
pizzahut
Senior Member
Join Date: Oct 2004
Old 09-29-2012 , 08:48   Bots vs. Humans (co-op) for TFC
Reply With Quote #1

Bots vs. Humans plugin for FoxBot / Team Fortress Classic

Features

- Forces bots into one team, humans into another.
- Maintains a chosen bot-to-human ratio.

CVARs

bvh_enabled (default=1) // 1 = plugin enabled, 0 = disabled
bvh_ratio (default=4) // bot-to-human ratio, bot count = humans * ratio
bvh_bot_team (default=1) // Which team should bots join? (1=blue, 2=red, 3=yellow, 4=green)
bvh_human_team (default=2) // Which team should humans join? (1=blue, 2=red, 3=yellow, 4=green)

Requirements
============

FoxBot settings:

bot_bot_balance 0
bot_team_balance 0
min_bots -1
max_bots -1
Attached Files
File Type: sma Get Plugin or Get Source (bots_vs_humans41.sma - 1027 views - 5.5 KB)
File Type: sma Get Plugin or Get Source (bots_vs_humans42.sma - 984 views - 5.7 KB)

Last edited by pizzahut; 04-03-2013 at 17:27. Reason: v4.2
pizzahut is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 09-29-2012 , 09:43   Re: Bots vs. Humans (co-op) for TFC
Reply With Quote #2

So, it's something like MvM mode in TF2?
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-29-2012 , 13:53   Re: Bots vs. Humans (co-op) for TFC
Reply With Quote #3

Any reason you don't use get_players ?

Also as there is a 1.0 looping task, i don't think that setting the same task to 1.0 on clcmd_spectate and on client_disconnect is worth.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
pizzahut
Senior Member
Join Date: Oct 2004
Old 09-29-2012 , 14:20   Re: Bots vs. Humans (co-op) for TFC
Reply With Quote #4

Quote:
Originally Posted by ConnorMcLeod View Post
Any reason you don't use get_players ?
Thanks for the hint.

Quote:
Originally Posted by ConnorMcLeod View Post
Also as there is a 1.0 looping task, i don't think that setting the same task to 1.0 on clcmd_spectate and on client_disconnect is worth.
It's a different task, I'm trying to minimise CPU load. I wanted the looping task to be a single task, set when a bot changes team (log event), but it didn't work out.

I could merge the two tasks I guess, into the looping one. CPU load would probably still be low enough.

Last edited by pizzahut; 09-29-2012 at 14:51.
pizzahut is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-29-2012 , 18:34   Re: Bots vs. Humans (co-op) for TFC
Reply With Quote #5

My bad about tasks
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
pizzahut
Senior Member
Join Date: Oct 2004
Old 09-30-2012 , 09:05   Re: Bots vs. Humans (co-op) for TFC
Reply With Quote #6

4.1 Changes:
- Replaced looping bot check task in "plugin_init" with single task in "logevent".
- Removing existing bot check tasks prior to setting up a new one.
- Using "get_players".
- Check bots again later if at least one of the bots is in the wrong team or hasn't picked a class (is_something_wrong).

Last edited by pizzahut; 09-30-2012 at 09:06.
pizzahut is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-30-2012 , 10:25   Re: Bots vs. Humans (co-op) for TFC
Reply With Quote #7

Is there like in cs, vgui and old menu to select teams ?
If it's the case, jointeam command may only be sent from vgui menu (and when typed in player console).
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
pizzahut
Senior Member
Join Date: Oct 2004
Old 10-01-2012 , 16:26   Re: Bots vs. Humans (co-op) for TFC
Reply With Quote #8

The old menu is gone since the year 2000 IIRC. There is no choice which kind of menu to use, so it's VGUI or console.

Last edited by pizzahut; 10-01-2012 at 16:28.
pizzahut is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-14-2012 , 03:04   Re: Bots vs. Humans (co-op) for TFC
Reply With Quote #9

Last thing, i think instead of client_cmd (which is delayed by latency and which gonna call again the plugin callback),
it would be better to use engclient_cmd (in that case you have to send each argument separately as strings) that directly sends the command to the game dll.
In that case, you could even send task_adjust_bot_count function without delaying it by 1.0, but anyway this task is ok.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 10-14-2012 at 03:05.
ConnorMcLeod is offline
pizzahut
Senior Member
Join Date: Oct 2004
Old 10-29-2012 , 07:30   Re: Bots vs. Humans (co-op) for TFC
Reply With Quote #10

Can you put this plugin to old / unapproved, I think it needs some more work but I don't know when I come around to finish it.

Last edited by pizzahut; 10-29-2012 at 11:27.
pizzahut is offline
Reply


Thread Tools
Display Modes

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


All times are GMT -4. The time now is 04:30.


Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Theme made by Freecode