Senior Member
Join Date: Jan 2014
Location: Puerto Rico
|
06-12-2015
, 22:16
[L4D2] Bots Weapon Preferences Editor (UPDATED 09-11-2017)
|
#1
|
About : This plugin allows some level of manipulation over which primary weapons we want to allow the survivor bots to use.
How it works :
Via a cfg file, we use cvars to allow or disallow bots from picking up certain primary weapons, and what kind of restriction to apply.
The weapon restrictions are all categorized and divided on a per survivor bot basis, for example, you can manipulate and change what survivor bot Coach can use, and make it different, or the same as, what survivor bot Nick will use.
Here is a video showing the new swap commands!
Code:
Version 1.0 04-15-2015 (15 views)
- Initial Release
Version 1.1 06-14-2015 (142 views)
- Fixed an oversight causing memory leaks
Version 1.2 (61 views)
- Very minor code changes
- Fixed a bug where in very rare cases a memory leak happened if a map ran long enough
- Better compatibility with Single Player or Listen Servers
Version 1.3 09-10-2015
- Fixed an oversight where bots would try to grab the map entity, and as a result would stand around in one place trying to grab nothing for an indefinite amount of time
- Fixed Memory Leak and merged sub plugin into main plug
- 2 New Features!
- sm_swapprimary allows you to swap your primary with whatever bot you're aiming at
- sm_swapsecondary, same as above but with secondary (such as melees or pistols)
Version 1.4 07-25-2016 (575 views)
- Cleaned up the interaction between pistols/melee/magnums, should be much cleaner now instead of having the bots endlessly swap between the three when wanting to use a melee.
- Drastically lowered the distance at which the bots will scan and move to pick up a weapon, this means bots should no longer be running off and making a mad dash to grab weapons (like Dead Center 1)
Version 1.5 09-11-2017
- Cleaned up interactions between allowed Tier 1 Weapons and allowed Tier 2 weapons,
this should completely stomp out any of those edge cases where a bot could upgrade
from T1 to T2 but would not do so until running low on ammo.
To DO :
Code:
- Nothing as of now (NOTE : MELEE WEAPONS ARE NOT PLANNED TO BE IMPLEMENTED AND WILL NEVER BE)
When the plugin is first used, a cfg file will be created called l4d2_bots_weapon_preferences_manipulation
CVARS from the CFG FILE
Spoiler
Code:
// ConVars for plugin "[L4D2] Bots Weapon Preference Manipulation.smx"
// Can Bill use assault rifles? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
bill_enable_assault_rifles "1"
// Can Bill use magnums? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
bill_enable_magnums "1"
// Can Bill use pistols? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
bill_enable_pistols "1"
// Can Bill use smgs? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
bill_enable_smgs "1"
// Can Bill use snipers? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
bill_enable_snipers "1"
// Can Bill use t1 shotguns? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
bill_enable_t1_shotguns "1"
// Can Bill use t2 shotguns? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
bill_enable_t2_shotguns "1"
// Can Coach use assault rifles? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
coach_enable_assault_rifles "1"
// Can Coach use magnums? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
coach_enable_magnums "1"
// Can Coach use pistols? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
coach_enable_pistols "1"
// Can Coach use smgs? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
coach_enable_smgs "1"
// Can Coach use snipers? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
coach_enable_snipers "1"
// Can Coach use t1 shotguns? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
coach_enable_t1_shotguns "1"
// Can Coach use t2 shotguns? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
coach_enable_t2_shotguns "1"
// Can Ellis use assault rifles? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
ellis_enable_assault_rifles "1"
// Can Ellis use magnums? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
ellis_enable_magnums "1"
// Can Ellis use pistols? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
ellis_enable_pistols "1"
// Can Ellis use smgs? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
ellis_enable_smgs "1"
// Can Ellis use snipers? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
ellis_enable_snipers "1"
// Can Ellis use t1 shotguns? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
ellis_enable_t1_shotguns "1"
// Can Ellis use t2 shotguns? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
ellis_enable_t2_shotguns "1"
// Can Francis use assault rifles? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
francis_enable_assault_rifles "1"
// Can Francis use magnums? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
francis_enable_magnums "1"
// Can Francis use pistols? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
francis_enable_pistols "1"
// Can Francis use smgs? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
francis_enable_smgs "1"
// Can Francis use snipers? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
francis_enable_snipers "1"
// Can Francis use t1 shotguns? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
francis_enable_t1_shotguns "1"
// Can Francis use t2 shotguns? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
francis_enable_t2_shotguns "1"
// Can Louis use assault rifles? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
louis_enable_assault_rifles "1"
// Can Louis use magnums? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
louis_enable_magnums "1"
// Can Louis use pistols? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
louis_enable_pistols "1"
// Can Louis use smgs? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
louis_enable_smgs "1"
// Can Louis use snipers? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
louis_enable_snipers "1"
// Can Louis use t1 shotguns? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
louis_enable_t1_shotguns "1"
// Can Louis use t2 shotguns? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
louis_enable_t2_shotguns "1"
// Can Nick use assault rifles? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
nick_enable_assault_rifles "1"
// Can Nick use magnums? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
nick_enable_magnums "1"
// Can Nick use pistols? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
nick_enable_pistols "1"
// Can Nick use smgs? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
nick_enable_smgs "1"
// Can Nick use snipers? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
nick_enable_snipers "1"
// Can Nick use t1 shotguns? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
nick_enable_t1_shotguns "1"
// Can Nick use t2 shotguns? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
nick_enable_t2_shotguns "1"
// What kind of restrictions will be applied to disabled weapons? (0 = Bots may pick up disabled weapons when it is their only choice, 1 = Bots will NEVER pick up restricted weapons)
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
restriction_type "0"
// Can Rochelle use assault rifles? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
rochelle_enable_assault_rifles "1"
// Can Rochelle use magnums? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
rochelle_enable_magnums "1"
// Can Rochelle use pistols? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
rochelle_enable_pistols "1"
// Can Rochelle use smgs? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
rochelle_enable_smgs "1"
// Can Rochelle use snipers? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
rochelle_enable_snipers "1"
// Can Rochelle use t1 shotguns? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
rochelle_enable_t1_shotguns "1"
// Can Rochelle use t2 shotguns? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
rochelle_enable_t2_shotguns "1"
// [L4D2] Bots Weapon preferences manipulation Version
// -
// Default: "1.0"
sm_bots_weapon_preferences_manipulation_version "1.0"
// Can Zoey use assault rifles? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
zoey_enable_assault_rifles "1"
// Can Zoey use magnums? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
zoey_enable_magnums "1"
// Can Zoey use pistols? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
zoey_enable_pistols "1"
// Can Zoey use smgs? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
zoey_enable_smgs "1"
// Can Zoey use snipers? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
zoey_enable_snipers "1"
// Can Zoey use t1 shotguns? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
zoey_enable_t1_shotguns "1"
// Can Zoey use t2 shotguns? (0 = No, 1 = Yes)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
zoey_enable_t2_shotguns "1"
About the "restriction_type" cvar, it works like this:
if the cvar is set to 0, bots will pick up disabled weapons, but only if they have no other choice, if set to 1, they will NEVER pick up disabled weapons at all.
This means if the CVAR is set to 1, and the bot has no primary, but they only found disabled weapons, they will not pick anything up because they are disabled, and as such they will be stuck with only their pistol/melee in this case, so choose your restrictions carefully.
ABOUT PISTOLS/MAGNUMS:
This plugin forces all bots to default to magnums over pistols, if this is unwanted, just disable magnum usage for whatever bots you don't want using magnums.
THIS PLUGIN ABSOLUTELY REQUIRES Left4Downtown2 TO FUNCTION!
(Huge thanks to Sev for extensively testing this with me!)
Huge Thanks to Spummer for getting Linux signatures!
__________________
Last edited by DeathChaos25; 09-11-2017 at 08:52.
|
|