Raised This Month: $12 Target: $400
 3% 

[L4D2] Bots Weapon Preferences Editor (UPDATED 09-11-2017)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Plugin ID:
4674
Plugin Version:
1.5
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Allows some level of manipulation over what primary weapons survivor bots will use
    Old 06-12-2015 , 22:16   [L4D2] Bots Weapon Preferences Editor (UPDATED 09-11-2017)
    Reply With Quote #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


    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!
    Attached Files
    File Type: smx [L4D2] Bots Weapon Preference Manipulation.smx (34.5 KB, 2141 views)
    File Type: sp Get Plugin or Get Source ([L4D2] Bots Weapon Preference Manipulation.sp - 4308 views - 99.3 KB)
    __________________

    Last edited by DeathChaos25; 09-11-2017 at 08:52.
    DeathChaos25 is offline
    DeathChaos25
    Senior Member
    Join Date: Jan 2014
    Location: Puerto Rico
    Old 06-12-2015 , 22:24   Re: [L4D2] Bots Weapon Preferences Editor
    Reply With Quote #2

    Everyone, I ask of you, bare with me and please have patience as bugs/errors start to pop up.

    Sev and I have extensively and massively tested this plugin over the course of the last few months, and as a result the plugin evolved and changed a lot.

    While this plugin has been released, and should be bug free, it is a very big and complicated plugin (almost as much as FakeZoey!), and as such it is impossible for only 2 people to cover every single possible scenario that may or may not cause a bug.

    So please, as bugs are reported, all I ask is patience!
    __________________

    Last edited by DeathChaos25; 06-12-2015 at 22:25.
    DeathChaos25 is offline
    asmatol
    Junior Member
    Join Date: Nov 2013
    Location: Ukraine
    Old 06-13-2015 , 01:26   Re: [L4D2] Bots Weapon Preferences Editor
    Reply With Quote #3

    Is it possible to do without Left4Downtown2 ?
    asmatol is offline
    alekcei82
    New Member
    Join Date: Jun 2015
    Old 06-13-2015 , 13:26   Re: [L4D2] Bots Weapon Preferences Editor
    Reply With Quote #4

    add cvar for all bots.
    alekcei82 is offline
    legotoytoy
    Junior Member
    Join Date: Apr 2012
    Old 06-14-2015 , 06:38   Re: [L4D2] Bots Weapon Preferences Editor
    Reply With Quote #5

    L 06/14/2015 - 18:28:05: [SM] MEMORY LEAK DETECTED IN PLUGIN (file "[L4D2] Bots Weapon Preference Manipulation.smx")
    L 06/14/2015 - 18:28:05: [SM] Unloading plugin to free 31474 handles.
    L 06/14/2015 - 18:28:05: [SM] Contact the author(s) of this plugin to correct this error.
    L 06/14/2015 - 18:28:05: --------------------------------------------------------------------------
    L 06/14/2015 - 18:28:05: Type Timer | Count 1
    L 06/14/2015 - 18:28:05: Type CellArray | Count 31473
    L 06/14/2015 - 18:28:05: -- Approximately 505040 bytes of memory are in use by (31474) Handles.
    legotoytoy is offline
    DeathChaos25
    Senior Member
    Join Date: Jan 2014
    Location: Puerto Rico
    Old 06-14-2015 , 11:04   Re: [L4D2] Bots Weapon Preferences Editor
    Reply With Quote #6

    Quote:
    Originally Posted by asmatol View Post
    Is it possible to do without Left4Downtown2 ?
    No, Downtown is the only reason this even works in the first place.

    Quote:
    Originally Posted by alekcei82 View Post
    add cvar for all bots.
    What? I don't understand your post. The plugin is already divided in a per bot basis, all bots have their own cvars.

    Quote:
    Originally Posted by legotoytoy View Post
    L 06/14/2015 - 18:28:05: [SM] MEMORY LEAK DETECTED IN PLUGIN (file "[L4D2] Bots Weapon Preference Manipulation.smx")
    L 06/14/2015 - 18:28:05: [SM] Unloading plugin to free 31474 handles.
    L 06/14/2015 - 18:28:05: [SM] Contact the author(s) of this plugin to correct this error.
    L 06/14/2015 - 18:28:05: --------------------------------------------------------------------------
    L 06/14/2015 - 18:28:05: Type Timer | Count 1
    L 06/14/2015 - 18:28:05: Type CellArray | Count 31473
    L 06/14/2015 - 18:28:05: -- Approximately 505040 bytes of memory are in use by (31474) Handles.
    Whoops! Updated the main post and plugin to correct this.
    __________________
    DeathChaos25 is offline
    legotoytoy
    Junior Member
    Join Date: Apr 2012
    Old 06-15-2015 , 06:21   Re: [L4D2] Bots Weapon Preferences Editor
    Reply With Quote #7

    ALL bot is set to 0 " bill_enable_t1_shotguns "0" "
    but in c2mX Often use shotgun

    Last edited by legotoytoy; 06-15-2015 at 06:21.
    legotoytoy is offline
    DeathChaos25
    Senior Member
    Join Date: Jan 2014
    Location: Puerto Rico
    Old 06-15-2015 , 12:03   Re: [L4D2] Bots Weapon Preferences Editor
    Reply With Quote #8

    Quote:
    Originally Posted by legotoytoy View Post
    ALL bot is set to 0 " bill_enable_t1_shotguns "0" "
    but in c2mX Often use shotgun
    If restriction_type is also 0 this means that no other weapon was found so they used Shotguns or they would not have any weapons, you can set restriction_type to 1, but then they will never pick up weapons even if they find nothing else.
    __________________
    DeathChaos25 is offline
    DeathChaos25
    Senior Member
    Join Date: Jan 2014
    Location: Puerto Rico
    Old 06-18-2015 , 23:36   Re: [L4D2] Bots Weapon Preferences Editor
    Reply With Quote #9

    Hmm, no error reports so far makes me happy, looks like this plugin turned out better than I expected.
    __________________
    DeathChaos25 is offline
    eric0279
    AlliedModders Donor
    Join Date: May 2007
    Old 06-19-2015 , 11:32   Re: [L4D2] Bots Weapon Preferences Editor
    Reply With Quote #10

    Quote:
    // G:\addons\sourcemod\scripting\[L4D2] Bots Weap
    on Preference Manipulation.sp(116) : error 001: expected token: ";", but found "
    -identifier-"
    // G:\addons\sourcemod\scripting\[L4D2] Bots Weap
    on Preference Manipulation.sp(123) : error 010: invalid function or declaration
    //
    // 2 Errors.
    eric0279 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 13:44.


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