Left 4 Dead 2

Left 4 Dead 2

Left 4 Bots 2
 This topic has been pinned, so it's probably important
smilzo  [developer] Aug 28, 2023 @ 4:18am
Addon customization
This addon comes with 12 configuration files that are automatically created in the "left4dead2\ems\left4bots2\cfg" folder the first time you host the game with the addon enabled.
Don't be afraid of edit them to customize the addon the way you want.
If you fu** up something, simply delete the file or the entire "left4bots2\cfg" folder and let the addon recreate them with the default values.

settings.txt file
There are over 160 settings in this file, each one with a default value you can change.
Here you can find more info on what the settings do:
https://github.com/smilz0/Left4Bots/blob/main/root/scripts/vscripts/left4bots_settings.nut
The settings can also be changed on the fly while you are in the game with the following commands:
  • Via chat: !l4b settings [setting] [value]
  • Via console: scripted_user_func l4b,settings,[setting],[value]


convars.txt file
The convars are a sort of settings but they are handled by the game itself.
They are used to change some of the mechanics of the game or to alter some of the parameters of the vanilla AI.
Remember that the vanilla AI is still there, even with L4B2 ON. This addon only adds some features but the vanilla AI is still there most of the time.
In this file you can add your own improvement convars or delete the default ones you don't like.
For example, if you want the chapter to restart when the human survivors die (normal behavior), simply delete these lines from the file:
allow_all_bot_survivor_team 1 sb_all_bot_game 1
Here is the official list of the game convars:
https://developer.valvesoftware.com/wiki/List_of_Left_4_Dead_2_console_commands_and_variables

Many other AI improvement addons (like Competitive-Bots+) use the convars to improve the vanilla AI.
These addons are perfectly compatible with L4B2 but, if you want to make sure that L4B2 will not override the convar values of the other addon, you need to delete all the L4B2 convar changes in the convars.txt file.
However i suggest to keep this line: "sb_debug_apoproach_wait_time 0.5" as it defines how long the bots "dance" on the spot after executing a MOVE command from the addon. The default value is 5 and you probably don't want them to dance for so long. :D


vocalizer.txt file
This file maps the vocalizer lines to the L4B2 commands.
It looks like this:
PlayerLeadOn = bots lead PlayerWaitHere = bots wait PlayerEmphaticGo = bots goto PlayerWarnWitch = bot witch PlayerMoveOn = bot use PlayerStayTogether = bots cancel PlayerFollowMe = bot follow me iMT_PlayerSuggestHealth = bots heal AskForHealth2 = bot heal me
The first is the vocalizer command (you can find them on google).
After the = comes the L4B2 command that you want to bind to that vocalizer line.
Here is the list of L4B2 commands:
https://github.com/smilz0/Left4Bots/blob/main/COMMANDS.md

Remember that the L4B2 commands come in 3 versions:
  • bot command [parameter] (the bot to use for the command is selected automatically by the addon)
  • bots command [parameter] (all the bots will execute the command)
  • name_of_the_bot command [parameter] (you choose which bot to use by adding his name)
In the vocalizer.txt file you have to choose one from the first 2 versions of the command (bot or bots) and this is what is executed when you use the vocalizer line without selecting the bot first.
The 3rd version (with the bot name) is automatically used when you select the bot before the vocalizer line.

To cancel the previous commands you only need to use: bots cancel [parameter]. There is no "bot" version of that command but the version with the name of the bot is still used when you select the bot first.

You can remap the commands the way you want.
For example you can bind the "cancel" command to the "Let's go" and "Follow me" lines too, so you have more options to cancel the orders.
Then you can re-bind the "use" and "follow" orders to other vocalizer lines. You only have to find vocalizer lines that "sound" related to the commands so they are easier to remember, but even if they don't, they will still work so you can even bind the "use" command to the "Death Scream" vocalizer line if you want. :)


itemstoavoid.txt
In L4B1 this was the list of items that you don't want the vanilla AI to pick-up.
In L4B2 this depends on the "items_not_to_avoid" setting.
If items_not_to_avoid is "0" then it's still the same logic.
If items_not_to_avoid is "1" (default) this file works in reverse logic, so the vanilla AI will only pick-up the items in this file and ignore all the others.
By default it works in reverse logic to allow the L4B2 weapon preference feature to work correctly.


weapons folder
This folder contains the weapon preference files for all the survivor characters.
Each character has his own preference file.
Each file has 5 lists on 5 different lines, one for each inventory slot:
  1. Primary weapon
  2. Secondary weapon
  3. Throwable
  4. Medkit
  5. Pills
Each list defines the weapon priority from the highest to the lowest.
You can change the priorities as you like.
If you don't want the bot to pick-up a particular weapon, you simple remove the weapon from the list.
Grenade launcher, M60 and chainsaw no longer need you to install external addons like this:
https://steamcommunity.com/sharedfiles/filedetails/?id=2634219419
As long as these weapons are in the list, the bot will be able to pick them up anyway.


Not enough customization?
You can easily change the VScript code of the addon.
Look here:
https://github.com/smilz0/Left4Bots/tree/main#want-to-customize-the-addon-even-further
Last edited by smilzo; Aug 28, 2023 @ 4:28am
< >
Showing 1-15 of 54 comments
Ezplorer Sep 29, 2023 @ 6:33am 
This is awesome dude:steamthumbsup:
Jerkakame Nov 29, 2023 @ 6:10pm 
is there a way to disable the weapon preferences?
Shrtony Dec 16, 2023 @ 8:12am 
What do the signal settings do? Like signal chat
Jerkakame Dec 17, 2023 @ 6:19am 
Originally posted by ♥ Peculiar Shrtony 08 ♥:
What do the signal settings do? Like signal chat
telling players in chat if they find weapons, ammo or items
Shrtony Dec 17, 2023 @ 7:48am 
Ah, thankk. Thats useful
GGiz Feb 1, 2024 @ 1:10am 
itemstoavoid.txt and weapons folder seems to not working.

Goal: Bots to not pick up grenades

Itemstoavoid.txt - i put the 3 nades inside the text file, but seems to not working whatever I set to items not to avoid settings to 1 or 0.

Weapons folder - i tried to delete all 3 nades for all the characters, but after deleting 3 nades, it doesnt pick up nades but also medkit and pills. Bots will now just pick up the primary and secondary weapon.

tried steam and github version already.
Jerkakame Feb 1, 2024 @ 6:32am 
try adding a random word in the grenade line

I added "penis" and the bots started picking up medkits and pills again
smilzo  [developer] Feb 3, 2024 @ 1:37am 
Originally posted by GGᶦᶻ:
itemstoavoid.txt and weapons folder seems to not working.

Goal: Bots to not pick up grenades

Itemstoavoid.txt - i put the 3 nades inside the text file, but seems to not working whatever I set to items not to avoid settings to 1 or 0.

Weapons folder - i tried to delete all 3 nades for all the characters, but after deleting 3 nades, it doesnt pick up nades but also medkit and pills. Bots will now just pick up the primary and secondary weapon.

tried steam and github version already.
You removed the line related to the throwables inventory slot and now it thinks that the line with the medkits is for the throwables and so both no longer work.
You must leave a blank line or, like Jerkakame said, write something that doesn't exist in it.
Dontae Mar 11, 2024 @ 3:56pm 
Why does half my txt files have random Chinese words in it? Translating them is actually incoherent rambling about a hedgehog or something. I am trying to edit the weapons folder

This is what I see


楲汦彥歡㜴爬晩敬獟㕧㈵爬晩敬摟獥牥ⱴ楲汦ⱥ畡潴桳瑯畧Ɱ桳瑯畧彮灳獡猬楮数彲業楬慴祲栬湵楴杮牟晩敬爬晩敬浟〶本敲慮敤江畡据敨Ⱳ湳灩牥獟潣瑵猬楮数彲睡Ɒ浳彧灭ⰵ浳彧楳敬据摥猬潨杴湵损牨浯ⱥ浳Ⱨ異灭桳瑯畧൮⨊洬捡敨整本汯捦畬Ɫ慫慴慮昬物慥數挬潲扷牡挬楲正瑥扟瑡戬獡扥污彬慢ⱴ潴普ⱡ楲瑯桳敩摬猬潨敶ⱬ汥捥牴捩束極慴Ⱳ湫晩ⱥ牦楹杮灟湡瀬瑩档潦歲瀬獩潴彬慭湧浵瀬獩潴ⱬ档楡獮睡਍楰数扟浯Ɫ潭潬潴ⱶ潶業橴牡਍楦獲彴楡彤楫ⱴ敤楦牢汩慬潴Ⱳ灵牧摡灥捡彫硥汰獯癩ⱥ灵牧摡灥捡彫湩散摮慩祲਍慰湩灟汩獬愬牤湥污湩e
smilzo  [developer] Mar 12, 2024 @ 8:04am 
Originally posted by Dontae:
Why does half my txt files have random Chinese words in it? Translating them is actually incoherent rambling about a hedgehog or something. I am trying to edit the weapons folder

This is what I see


楲汦彥歡㜴爬晩敬獟㕧㈵爬晩敬摟獥牥ⱴ楲汦ⱥ畡潴桳瑯畧Ɱ桳瑯畧彮灳獡猬楮数彲業楬慴祲栬湵楴杮牟晩敬爬晩敬浟〶本敲慮敤江畡据敨Ⱳ湳灩牥獟潣瑵猬楮数彲睡Ɒ浳彧灭ⰵ浳彧楳敬据摥猬潨杴湵损牨浯ⱥ浳Ⱨ異灭桳瑯畧൮⨊洬捡敨整本汯捦畬Ɫ慫慴慮昬物慥數挬潲扷牡挬楲正瑥扟瑡戬獡扥污彬慢ⱴ潴普ⱡ楲瑯桳敩摬猬潨敶ⱬ汥捥牴捩束極慴Ⱳ湫晩ⱥ牦楹杮灟湡瀬瑩档潦歲瀬獩潴彬慭湧浵瀬獩潴ⱬ档楡獮睡਍楰数扟浯Ɫ潭潬潴ⱶ潶業橴牡਍楦獲彴楡彤楫ⱴ敤楦牢汩慬潴Ⱳ灵牧摡灥捡彫硥汰獯癩ⱥ灵牧摡灥捡彫湩散摮慩祲਍慰湩灟汩獬愬牤湥污湩e
I don't know. All i know is that windows notepad shows that, other editors like notepad++ open it correctly and i haven't touched the code for a while. I cannot say 100% for sure it's not a bug of the addon but there is a good chance that microsoft broke notepad in a recent update. Or maybe it's one of the recent game patches. I really have no idea, sorry.
Last edited by smilzo; Mar 12, 2024 @ 8:04am
Dontae Mar 12, 2024 @ 9:30am 
Originally posted by smilzo:
Originally posted by Dontae:
Why does half my txt files have random Chinese words in it? Translating them is actually incoherent rambling about a hedgehog or something. I am trying to edit the weapons folder

This is what I see


楲汦彥歡㜴爬晩敬獟㕧㈵爬晩敬摟獥牥ⱴ楲汦ⱥ畡潴桳瑯畧Ɱ桳瑯畧彮灳獡猬楮数彲業楬慴祲栬湵楴杮牟晩敬爬晩敬浟〶本敲慮敤江畡据敨Ⱳ湳灩牥獟潣瑵猬楮数彲睡Ɒ浳彧灭ⰵ浳彧楳敬据摥猬潨杴湵损牨浯ⱥ浳Ⱨ異灭桳瑯畧൮⨊洬捡敨整本汯捦畬Ɫ慫慴慮昬物慥數挬潲扷牡挬楲正瑥扟瑡戬獡扥污彬慢ⱴ潴普ⱡ楲瑯桳敩摬猬潨敶ⱬ汥捥牴捩束極慴Ⱳ湫晩ⱥ牦楹杮灟湡瀬瑩档潦歲瀬獩潴彬慭湧浵瀬獩潴ⱬ档楡獮睡਍楰数扟浯Ɫ潭潬潴ⱶ潶業橴牡਍楦獲彴楡彤楫ⱴ敤楦牢汩慬潴Ⱳ灵牧摡灥捡彫硥汰獯癩ⱥ灵牧摡灥捡彫湩散摮慩祲਍慰湩灟汩獬愬牤湥污湩e
I don't know. All i know is that windows notepad shows that, other editors like notepad++ open it correctly and i haven't touched the code for a while. I cannot say 100% for sure it's not a bug of the addon but there is a good chance that microsoft broke notepad in a recent update. Or maybe it's one of the recent game patches. I really have no idea, sorry.






I understand. Maybe it's because of my crappy windows 11 or my notes app, but I'll mess around with it until I get it right since I have somewhat decent experience with editing addons. Thank you for responding
smilzo  [developer] Mar 12, 2024 @ 10:34am 
Originally posted by Dontae:
Originally posted by smilzo:
I don't know. All i know is that windows notepad shows that, other editors like notepad++ open it correctly and i haven't touched the code for a while. I cannot say 100% for sure it's not a bug of the addon but there is a good chance that microsoft broke notepad in a recent update. Or maybe it's one of the recent game patches. I really have no idea, sorry.






I understand. Maybe it's because of my crappy windows 11 or my notes app, but I'll mess around with it until I get it right since I have somewhat decent experience with editing addons. Thank you for responding
No i don't think it's your windows 11 it's probably everyone's windows 11, i have the same issue, i noticed it few days ago. I've looked up on internet and it seems that notepad had an update this month, maybe that is what broke it but i can't tell for sure. Hopefully it will be fixed, meanwhile there are valid free advanced editors out there, like notepad++ that seem to open the files just fine.
BrainyPepper Mar 14, 2024 @ 3:05pm 
Bots keep healing me in the middle of combat. How do you cancel it when they're doing that?
ErikKson Mar 19, 2024 @ 1:10pm 
Can i use Competitive Bots and Fix Sniper Bots addons next to this from this video (in description)?:
If yes, i need to disable "load_convars", right ?
https://youtu.be/kN5ej9PUskw
Thanks for this awesome addon and keep up the good work! <3
Last edited by ErikKson; Mar 19, 2024 @ 2:16pm
smilzo  [developer] Mar 20, 2024 @ 8:04am 
Originally posted by ErikKson:
Can i use Competitive Bots and Fix Sniper Bots addons next to this from this video (in description)?:
If yes, i need to disable "load_convars", right ?
https://youtu.be/kN5ej9PUskw
Thanks for this awesome addon and keep up the good work! <3
No need to, in this version there is nothing in the default convars.txt file that could conflict with competitive bots. You can if you want but my suggestion is to keep load_convars to 1 as there is an important convar to be loaded.
< >
Showing 1-15 of 54 comments
Per page: 1530 50