Raised This Month: $32 Target: $400
 8% 

[L4D & L4D2] Survivor Bot Sniper Rifle AI Fix


Post New Thread Reply   
 
Thread Tools Display Modes
Author
sereky
Member
Join Date: Aug 2011
Plugin ID:
3051
Plugin Version:
1.1
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Survivor bots will not prefer pistols if they have sniper rifle.
    Old 06-29-2012 , 15:03   [L4D & L4D2] Survivor Bot Sniper Rifle AI Fix
    Reply With Quote #1

    About:

    In Left 4 dead (2), if the survivor bots have sniper rifle and if the infecteds are close to them, they always fight with their pistols instead of their sniper rifle. These bots are useless because they often get incapacitated and they kill the least amount of infecteds.

    This plugin prevents bots with sniper from switch to their pistols except if they don't have ammo or they are incapacitated. (It will not block switching to magnum or melee weapon.)

    Changelog:

    Code:
    1.1 (2012-Jul-5)
    - Added "IsClientConnected" check.
    
    1.0 (2012-Jun-29)
    - Initial release.
    Installation

    Download the l4d_bot_sniper_rifle_aifix.smx file and put into your \addons\sourcemod\plugins\ folder.

    Important:

    This plugin requires the SDKHooks extension. Therefore do not click "Get Plugin" because it will not work. You can download the compiled .smx file.
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d_bot_sniper_rifle_aifix.sp - 2483 views - 2.4 KB)
    File Type: smx l4d_bot_sniper_rifle_aifix.smx (3.4 KB, 6913 views)

    Last edited by sereky; 08-08-2012 at 14:49.
    sereky is offline
    SyluxLockjaw100
    Senior Member
    Join Date: Jul 2010
    Location: Novaya Russia
    Old 06-29-2012 , 23:17   Re: [L4D & L4D2] Bot Sniper Rifle AI Fix
    Reply With Quote #2

    Nice! Thank you.
    SyluxLockjaw100 is offline
    Boxmanbr
    Junior Member
    Join Date: Feb 2012
    Old 07-01-2012 , 19:21   Re: [L4D & L4D2] Bot Sniper Rifle AI Fix
    Reply With Quote #3

    Thanks man.
    Boxmanbr is offline
    sereky
    Member
    Join Date: Aug 2011
    Old 07-05-2012 , 14:45   Re: [L4D & L4D2] Bot Sniper Rifle AI Fix
    Reply With Quote #4

    Updated:

    - Added "IsClientConnected" check.
    sereky is offline
    Pyc
    Senior Member
    Join Date: Jan 2014
    Old 05-20-2016 , 17:51   Re: [L4D & L4D2] Survivor Bot Sniper Rifle AI Fix
    Reply With Quote #5

    this plugin crash my server
    Code:
    L 05/21/2016 - 00:18:28: SourceMod error session started
    L 05/21/2016 - 00:18:28: Info (map "c2m1_highway") (file "errors_20160521.log")
    L 05/21/2016 - 00:18:28: [SM] Native "GetEdictClassname" reported: Invalid edict (-1 - -1)
    L 05/21/2016 - 00:18:28: [SM] Displaying call stack trace for plugin "l4d_bot_sniper_rifle_aifix.smx":
    L 05/21/2016 - 00:18:28: [SM]   [0]  Line 52, D:\SOURCEMOD\addons\sourcemod\scripting\l4d_bot_sniper_rifle_aifix.sp::OnWeaponSwitch()

    Last edited by Pyc; 05-20-2016 at 17:52.
    Pyc is offline
    cravenge
    Veteran Member
    Join Date: Nov 2015
    Location: Chocolate Factory
    Old 05-21-2016 , 02:15   Re: [L4D & L4D2] Survivor Bot Sniper Rifle AI Fix
    Reply With Quote #6

    Here you go, Pyc. This is a fixed version of the plugin with all the IsValidEdict checks needed to deal with invalid edicts error logs and game crashes.
    Attached Files
    File Type: sp Get Plugin or Get Source (sniper_using_bots_fix.sp - 1853 views - 2.5 KB)
    cravenge is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Cat
    Old 05-21-2016 , 02:33   Re: [L4D & L4D2] Survivor Bot Sniper Rifle AI Fix
    Reply With Quote #7

    Quote:
    Originally Posted by cravenge View Post
    Here you go, Pyc. This is a fixed version of the plugin with all the IsValidEdict checks needed to deal with invalid edicts error logs and game crashes.
    You should use IsValidEntity(iEntity)
    because not everything is an edict + Entity check is safer
    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D
    Lux is offline
    krokroJoujou
    Member
    Join Date: Mar 2017
    Old 01-29-2018 , 12:48   Re: [L4D & L4D2] Survivor Bot Sniper Rifle AI Fix
    Reply With Quote #8

    which version should i use?
    krokroJoujou is offline
    DreadedGhoul575
    Senior Member
    Join Date: Apr 2016
    Old 08-26-2019 , 14:36   Re: [L4D & L4D2] Survivor Bot Sniper Rifle AI Fix
    Reply With Quote #9

    Same happens with shotgun AI, only it's reversed of course.
    DreadedGhoul575 is offline
    BloodyBlade
    Senior Member
    Join Date: Feb 2018
    Old 09-17-2019 , 19:26   Re: [L4D & L4D2] Survivor Bot Sniper Rifle AI Fix
    Reply With Quote #10

    * Converted plugin source to the latest syntax utilizing methodmaps. Requires SourceMod 1.8 or newer.
    Attached Files
    File Type: sp Get Plugin or Get Source (sniper_using_bots_fix.sp - 2051 views - 2.5 KB)
    BloodyBlade is offline
    Reply



    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 15:02.


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