cod4x Scripts found on cod4x.meBot script for cod4x

I decided to gather scripts on cod4x.me and post them here
these are not my scripts and only posted for informational purposes only.
Post Reply
User avatar

Topic author
Gen Stranger
KAB Administrator
Posts: 363
Joined: 19 Jan 2004 18:28
20
Contact:

Bot script for cod4x

Post by Gen Stranger »

|\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
///////////CoD4x Bot Warfare//////////////
Feel free to use code, however give credit where credit is due!
-INeedGames/INeedBot(s) @ ineedbots@outlook.com
|________________________________________|
prcod4xbots.zip
bot script for cod4x
(223.29 KiB) Downloaded 1682 times
prcod4xbots.zip
bot script for cod4x
(223.29 KiB) Downloaded 1682 times
Contents:
1: Features
2: Installation/Requirements
3: FAQs/Usage
4: Changelog
5: Credits

|\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
///////////////1: Features////////////////
This is a beta. Not all features are yet available.
Expect bomb type gamemodes, bots camping, following and nade shotting in the final release.
And a more detailed readme and tutorial...


Bots will play all objectives except for the bomb gametypes, that will be in the final release.


Still need botLookAtPlayer (https://github.com/callofduty4x/CoD4x_Server/issues/261) and SwitchToWeapon (https://github.com/callofduty4x/CoD4x_Server/issues/243) GSC functions to work for the bots.
And fixing the 'bot movement done' spam when 'developer' is disabled.


---

Whats different?

Well this makes use of CoD4x's custom GSC bot functions, these functions allows bots to be controlled in a more natural way.
Bots can ADS, jump, knife, mount, move, sprint etc.

Not only that, but the scripts are MUCH more efficient then any bot mod previously for the cod games. Every script has been remade from scratch with optimization in mind the whole time.
For example, I can have a 20v20 game of bots with only 7% CPU utilization on my 6700k.

The mod is stable and rid of any script errors.
But having too many bots in the game (over 32) may cause the exceeded script variables error. This is just a hard limit of the engine.

The AStar search has been completely remade, it makes use of heaps, sets and KDTrees for much better performance.
It also has been modified to make paths that bots are taking more expensive, so that the bots may split up instead of all of them taking the same 'best path'.
|________________________________________|

|\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
///////2: Installation/Requirements///////
This mod requires CoD4x client + server. You can find everything you need at https://cod4x.me/

Once you got a working CoD4x server, simply add the 'main_shared' folder found in 'Add to root of CoD4x server' folder to the root of your CoD4x server installation.

Start the server and you can use the new DVARs (or add them to your server.cfg) provided below to customize your game with bots.

You can now connect to your server with the CoD4x client and play with the bots.
|________________________________________|

|\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
///////////////3: FAQs/Usage//////////////
Server DVARs:
bots_manage_add - an integer amount of bots to add to the game, resets to 0 once the bots have been added.
for example: 'bots_manage_add 10' will add 10 bots to the game.

bots_manage_fill - an integer amount of players/bots (depends on bots_manage_fill_mode) to retain on the server, it will automatically add bots to fill player space.
for example: 'bots_manage_fill 10' will have the server retain 10 players in the server, if there are less than 10, it will add bots until that value is reached.

bots_manage_fill_mode - a value to indicate if the server should consider only bots or players and bots when filling player space.
0 will consider both players and bots.
1 will only consider bots.

bots_manage_fill_kick - a boolean value (0 or 1), whether or not if the server should kick bots if the amount of players/bots (depends on bots_manage_fill_mode) exceeds the value of bots_manage_fill.

bots_manage_fill_spec - a boolean value (0 or 1), whether or not if the server should consider players who are on the spectator team when filling player space.


bots_team - a string, the value indicates what team the bots should join:
'autoassign' will have bots balance the teams
'allies' will have the bots join the allies team
'axis' will have the bots join the axis team
'custom' will have bots_team_amount bots on the axis team, the rest will be on the allies team

bots_team_amount - an integer amount of bots to have on the axis team if bots_team is set to 'custom', the rest of the bots will be placed on the allies team.
for example: there are 5 bots on the server and 'bots_team_amount 3', then 3 bots will be placed on the axis team, the other 2 will be placed on the allies team.

bots_team_force - a boolean value (0 or 1), whether or not if the server should enforce periodically the bot's team instead of just a single team when the bot is added to the game.
for example: 'bots_team_force 1' and 'bots_team autoassign' and the teams become to far unbalanced, then the server will change a bot's team to make it balanced again.

bots_team_mode - a value to indicate if the server should consider only bots or players and bots when counting players on the teams.
0 will consider both players and bots.
1 will only consider bots.


bots_skill - value to indicate how difficult the bots should be.
0 will be mixed difficultly
1 will be the most easy
2-6 will be in between most easy and most hard
7 will be the most hard.
8 will be custom.

bots_skill_axis_hard - an integer amount of hard bots on the axis team.
bots_skill_axis_med - an integer amount of medium bots on the axis team.
bots_skill_allies_hard - an integer amount of hard bots on the allies team.
bots_skill_allies_med - an integer amount of medium bots on the allies team, if bots_skill is 8 (custom). The remaining bots on the team will become easy bots.
for example: having 5 bots on the allies team, 'bots_skill_allies_hard 2' and 'bots_skill_allies_med 2' will have 2 hard bots, 2 medium bots, and 1 easy bot on the allies team.


bots_loadout_reasonable - a boolean value (0 or 1), whether or not if the bots should filter out bad create a class selections (like no silenced miniuzi with overkill perk, etc)

bots_loadout_allow_op - a boolean value (0 or 1), whether or not if the bots are allowed to use jug, marty and laststand.
|________________________________________|

|\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
///////////////4: Changelog///////////////
Prerelease (1/2/2019):
Initial release.
|________________________________________|

|\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
////////////////5: Credits////////////////
INeedGames(me) - creator: http://www.moddb.com/mods/bot-warfare
PeZBOT team - snippets and inspiration: https://www.moddb.com/mods/pezbot
CoD4x team - for the CoD4x server and client: https://cod4x.me/
|________________________________________|


Feel free to use code, host on other sites, host on servers, mod it and merge mods with it, just give credit where credit is due!
-INeedGames/INeedBot(s) @ ineedbots@outlook.com
Gen Stranger
Stranger-KAB

kill3ill
Registered
Posts: 7
Joined: 04 Jan 2020 16:51
4
Contact:

Re: Bot script for cod4x

Post by kill3ill »

hello all,

I installed this bot mod on my server but i have an issue.Bots don't appear on server start, i have to add themwith command "rcon bots_manage_add "
, more they stay in spec.

Can you help me please?

Thanks,

kill3ill
User avatar

Topic author
Gen Stranger
KAB Administrator
Posts: 363
Joined: 19 Jan 2004 18:28
20
Contact:

Re: Bot script for cod4x

Post by Gen Stranger »

the above post does not explain this section which was further down in the post on cod4x.me
Posted July 9, 2019


On 7/9/2019 at 8:49 PM, TRAGEDY said:

Do we need to set the vars

manually?

I just put em in config like this:


set bots_team "autoassign" // autoassign; allies; axis; custom
// set bots_team_amount "4" // Кол-во axis при 'custom'
set bots_team_mode "0" // 0 = учитывать всех, 1 = ботов
set bots_manage_fill_mode "0" // 0 = учитывать всех, 1 = ботов
set bots_manage_fill "8"
set bots_manage_fill_kick "1"
set bots_manage_fill_spec "0"
set bots_team_force "0" // Боты иногда меняют команду
set bots_skill "0" // 0 = mix, 1 - 7, 8 = custom
set bots_loadout_allow_op "1"
set bots_loadout_reasonable "1"

So with that there always will be 8 players on server, but if someone joins(non-spec) one of the bots will leave
P.S Difficulty is in MIX mode
So you have to add the following to your server config file (server.cfg)

set bots_team "autoassign" // autoassign; allies; axis; custom
// set bots_team_amount "4" // ???-?? axis ??? 'custom'
set bots_team_mode "0" // 0 = ????????? ????, 1 = ?????
set bots_manage_fill_mode "0" // 0 = ????????? ????, 1 = ?????
set bots_manage_fill "8" //controls the amount of bots on the server
set bots_manage_fill_kick "1"
set bots_manage_fill_spec "0"
set bots_team_force "0" // ???? ?????? ?????? ???????
set bots_skill "0" // 0 = mix, 1 - 7, 8 = custom
set bots_loadout_allow_op "1"
set bots_loadout_reasonable "1"//?


after you add that to your server.cfg restart the server and see if it now works.

I use that on mine which is running on 24.0.236.155:28960 in TDM mode if you want to see how it works.
Gen Stranger
Stranger-KAB
User avatar

Topic author
Gen Stranger
KAB Administrator
Posts: 363
Joined: 19 Jan 2004 18:28
20
Contact:

Re: Bot script for cod4x

Post by Gen Stranger »

BTW here is the post with all replies on cod4x.me about the bots

https://cod4x.me/index.php?/forums/topi ... ment-15689
Gen Stranger
Stranger-KAB

kill3ill
Registered
Posts: 7
Joined: 04 Jan 2020 16:51
4
Contact:

Re: Bot script for cod4x

Post by kill3ill »

Hey Gen Stranger,

Thanks a lot for your help. It finally works , but i had to add this line : set bots_manage_add "4" , because i had to launch them manually in console.

By the way, do you know how to rename the bots?

Thanks again,

kill3ill
User avatar

Topic author
Gen Stranger
KAB Administrator
Posts: 363
Joined: 19 Jan 2004 18:28
20
Contact:

Re: Bot script for cod4x

Post by Gen Stranger »

kill3ill wrote: 07 Jan 2020 18:03 Hey Gen Stranger,

Thanks a lot for your help. It finally works , but i had to add this line : set bots_manage_add "4" , because i had to launch them manually in console.

By the way, do you know how to rename the bots?

Thanks again,

kill3ill
The question was asked on Cod4x.me but never answered - as for me I do not know how to rename them. (it would be nice to be able to)
Gen Stranger
Stranger-KAB

kill3ill
Registered
Posts: 7
Joined: 04 Jan 2020 16:51
4
Contact:

Re: Bot script for cod4x

Post by kill3ill »

Thanks for your reply :)

KB

kill3ill
Registered
Posts: 7
Joined: 04 Jan 2020 16:51
4
Contact:

Re: Bot script for cod4x

Post by kill3ill »

Hey everyone,

Do you get lag issues sometimes? I mean, when bots disconnect it occures sometimes big lags.

Thanks,

KB
User avatar

Topic author
Gen Stranger
KAB Administrator
Posts: 363
Joined: 19 Jan 2004 18:28
20
Contact:

Re: Bot script for cod4x

Post by Gen Stranger »

kill3ill wrote: 09 Jan 2020 16:38 Hey everyone,

Do you get lag issues sometimes? I mean, when bots disconnect it occures sometimes big lags.

Thanks,

KB
when I play in my server I never saw lag issues with the bots
check out 24.0.238.155:28960 and let me know if there is lag on your end.
Gen Stranger
Stranger-KAB

kill3ill
Registered
Posts: 7
Joined: 04 Jan 2020 16:51
4
Contact:

Re: Bot script for cod4x

Post by kill3ill »

I visited your server and got no lag. By my side it occures when maprotate, maybe something wrong with it?

I also noticed you don't use cod4 New Experience, so maybe smthg to do with it?

Btw, your ip is : 24.0.236.155:28960 and not 24.0.238.155:28960

I also noticed in my gamelog that message:
"R_MarkFragments:Too many triangles to mark, max 255 radius 200.00 at -216.00 -912.00 72.00" I don't know if it has smthg to do with it?

Thanks,

KB
User avatar

Topic author
Gen Stranger
KAB Administrator
Posts: 363
Joined: 19 Jan 2004 18:28
20
Contact:

Re: Bot script for cod4x

Post by Gen Stranger »

kill3ill wrote: 09 Jan 2020 17:39 I visited your server and got no lag. By my side it occures when maprotate, maybe something wrong with it?

I also noticed you don't use cod4 New Experience, so maybe smthg to do with it?

Btw, your ip is : 24.0.236.155:28960 and not 24.0.238.155:28960

I also noticed in my gamelog that message:
"R_MarkFragments:Too many triangles to mark, max 255 radius 200.00 at -216.00 -912.00 72.00" I don't know if it has smthg to do with it?

Thanks,

KB
try running without the NE and see how it lags
as for the error message post on cod4x.me see if someone has an answer - I never saw that error.
Gen Stranger
Stranger-KAB

kill3ill
Registered
Posts: 7
Joined: 04 Jan 2020 16:51
4
Contact:

Re: Bot script for cod4x

Post by kill3ill »

Hey Gen Stranger,

I finally found a way to rename bots . Just download the lastest release of cod4 bots here: https://www.moddb.com/downloads/cod4x-b ... re-latest2. In the zipfile you got a botnames text you can modify, place it in cod4x server root . Launch the server and see what happens!

Regards,

kill3ill
User avatar

Topic author
Gen Stranger
KAB Administrator
Posts: 363
Joined: 19 Jan 2004 18:28
20
Contact:

Re: Bot script for cod4x

Post by Gen Stranger »

I downloaded that file and unzipped it but there is no botnames text file in it did you upload the correct file?
why not upload it here so I can test it.
Gen Stranger
Stranger-KAB

kill3ill
Registered
Posts: 7
Joined: 04 Jan 2020 16:51
4
Contact:

Re: Bot script for cod4x

Post by kill3ill »

hey Gen Stranger,

Yes i downloaded the good one. Ofc i can upload it ,but i think u can creat one cause it's only a text file with names in it lol

Try this ,

Reagrds ,
ps: You can comem and see my bots here:

Name: [HC*Bad_Boyz]FFA
IP: 37.59.38.56: 28960
Kb :)
prcod4xbw2 (1).zip
(223.58 KiB) Downloaded 1302 times
prcod4xbw2 (1).zip
(223.58 KiB) Downloaded 1302 times
Post Reply