Raised This Month: $7 Target: $400
 1% 

[L4D2] Defib using Bots (Updated 09-25-2020)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Plugin ID:
4607
Plugin Version:
1.5
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    101 
    Plugin Description:
    This plugin has a customized AI behavior that allows Survivor bots to defib dead team mates
    Old 04-15-2015 , 15:41   [L4D2] Defib using Bots (Updated 09-25-2020)
    Reply With Quote #1

    About : Ever tired of dying, when a survivor bot has a defib, and the game just goes on without you because bots won't defib you? Well, No more!

    How it works :
    This plugin scans the map for any survivor death models, after it finds one, if certain criterias are met, a bot with a defib will then be forced to walk up to the dead body, then he is forced to aim at the dead body, take out his defib, and use +ATTACK to successfully defib a dead survivor.

    Video Demonstration here

    The criterias for bots to defib survivors are as following :
    1) There is distance limit, we don't want bots going halfway across the map just to defib one person
    2) No survivors must need help (IE Trapped by a SI, incapacitated or hanging from a ledge)
    3) There must be no visible threats to the survivor bots for them to accomplish this
    Spoiler


    Admin Commands (Added in Version 1.3 and 1.4, Root access required) :
    sm_regroup - Orders all survivor bots to regroup and move to where the person who issued this command is located
    sm_resetbots - Resets all bots and interrupts their current action.
    sm_retreat - Orders all survivor bots to retreat from the special infected you are currently aiming at
    sm_attack - Orders all survivor bots to focus and attack the special infected you are currently aiming at

    Note that these 2 commands also have the same limitations put into place as the defib usage on bots


    Code:
    Version 1.0    04-15-2015 (55 views)
    - Initial Release
    
    Version 1.1   04-16-2015 (16 views)
    - Improved the AI a bit
    - Fixed a bug where in certain situations the bots would shoot non stop
    
    Version 1.2   04-17-2015 (42 views)
    - Fixed an oversight where bots would never stop swinging melee weapons
    - Added defib tracking for bots into the plugin!
    
    Version 1.3  04-18-2015 (33 views)
    - Fixed an oversight where in certain odd conditions bots would not heal
    - Added 2 new admin commands to control bots! (Root access required)
    
    Version 1.4  04-19-2015 (99 views)
    - Fixed an Invalid Client Array Issue in a timer
    - Added sm_retreat and sm_attack admin commands
    
    Version 1.5  04-29-2015 (297 views)
    - Small Code Cleanup to make plugin more easily readble
    - Completely new system is being used for defib pickup (left4dowtown2 is needed for it to work!)
    - As a result, if the defib pickup function is desired, left4downtown2 is needed (Plugin will work without downtown, but bots will not pick up defibs)
    
    Version 1.6  06-24-2015 (15543 views)
    - Fixed a small oversight where bots would attempt to pick up a defib another person had already picked up, resulting in them never picking up any other defibs (thanks to yurikon for pointing it out!)
    
    Version 1.7  09-25-2020
    - Small update, completely removed code for bots picking up defibs that relied on Left4downtown, it is encouraged to run gear transfer instead.
    To DO :
    Code:
    - Requests(?)
    Thanks to dcx2 for suggesting "use weapon_defibrillator" !

    It is suggested you run Gear Transfer!

    If there is an instance where the bots go all dumb and defib people while ignoring zombies please let me know, as this shouldn't be the case.

    Attached Files
    File Type: sp Get Plugin or Get Source ([L4D2] Defib using bots.sp - 9628 views - 9.2 KB)
    __________________

    Last edited by DeathChaos25; 09-25-2020 at 02:58.
    DeathChaos25 is offline
    starstrucktiger
    Member
    Join Date: Jul 2012
    Location: Kansas
    Old 04-15-2015 , 16:13   Re: [L4D2] Defib using Bots
    Reply With Quote #2

    Incredible. Love it!

    Now if we can get those pesky bots to throw grenades ;)
    starstrucktiger is offline
    DeathChaos25
    Senior Member
    Join Date: Jan 2014
    Location: Puerto Rico
    Old 04-15-2015 , 16:16   Re: [L4D2] Defib using Bots
    Reply With Quote #3

    Quote:
    Originally Posted by starstrucktiger View Post
    Incredible. Love it!

    Now if we can get those pesky bots to throw grenades ;)
    Uh, trust me, we want anything BUT that...
    __________________
    DeathChaos25 is offline
    starstrucktiger
    Member
    Join Date: Jul 2012
    Location: Kansas
    Old 04-15-2015 , 16:23   Re: [L4D2] Defib using Bots
    Reply With Quote #4

    Quote:
    Originally Posted by DeathChaos25 View Post
    Yeah I can just imagine all the idiotic throws they'd end up doing
    starstrucktiger is offline
    leonardo martinez
    Member
    Join Date: Jun 2014
    Old 04-15-2015 , 16:45   Re: [L4D2] Defib using Bots
    Reply With Quote #5

    Ooooh this looks nice!
    leonardo martinez is offline
    DeathChaos25
    Senior Member
    Join Date: Jan 2014
    Location: Puerto Rico
    Old 04-16-2015 , 22:09   Re: [L4D2] Defib using Bots (Updated 04-16-2015)
    Reply With Quote #6

    Alright, so I noticed that bots sometimes would randomly hold down the trigger and not stop, so I decided to fix that by adding multiple checks, also eased up a little bit on the distance restriction.
    __________________
    DeathChaos25 is offline
    DeathChaos25
    Senior Member
    Join Date: Jan 2014
    Location: Puerto Rico
    Old 04-17-2015 , 12:20   Re: [L4D2] Defib using Bots (Updated 04-17-2015)
    Reply With Quote #7

    So, I noticed that because of the way the plugin forces the bots to use defibs, they would sometimes never stop swinging melee weapons, this has been fixed!

    I also noticed that for some reason, Gear Transfer isn't correctly forcing bots to pick up defibs most of the time, so I added my very own defib check into this plugin so that bots will now pick up defibs too!

    Do note that if you drop a defib, under some very specific odd circumstances, the defib may be visually stuck in the air, don't worry as the defib can still be picked up and used normally, this is just a side effect of how the bots are forced to pick up defibs.
    __________________
    DeathChaos25 is offline
    Marcus101RR
    Veteran Member
    Join Date: Aug 2009
    Location: Tampa, FL
    Old 04-17-2015 , 15:18   Re: [L4D2] Defib using Bots
    Reply With Quote #8

    Quote:
    Originally Posted by DeathChaos25 View Post
    My L4D 1 server has that feature where bots CAN throw grenades. It is not perfect, but it is based on stress level from infected, if it gets too high, a bot will throw their grenade, this includes molly. You would require alot more checks to make it safe:
    • Check if bot has grenade
    • Check if the stress level of that bot reached threshhold
    • is a target infected available
    • If target, is it far away?
    • if far away, is it in plain sight?
    • If in plain sight, is it targeting?

    A. If pipebomb, throw it regardless of wall.

    B. If molotov, lets make sure it lands where it aims.

    Very difficulty, but possible with alot of coding
    __________________
    Marcus101RR is offline
    Send a message via AIM to Marcus101RR Send a message via Skype™ to Marcus101RR
    DeathChaos25
    Senior Member
    Join Date: Jan 2014
    Location: Puerto Rico
    Old 04-17-2015 , 16:02   Re: [L4D2] Defib using Bots
    Reply With Quote #9

    Quote:
    Originally Posted by Marcus101RR View Post
    My L4D 1 server has that feature where bots CAN throw grenades. It is not perfect, but it is based on stress level from infected, if it gets too high, a bot will throw their grenade, this includes molly. You would require alot more checks to make it safe:
    • Check if bot has grenade
    • Check if the stress level of that bot reached threshhold
    • is a target infected available
    • If target, is it far away?
    • if far away, is it in plain sight?
    • If in plain sight, is it targeting?

    A. If pipebomb, throw it regardless of wall.

    B. If molotov, lets make sure it lands where it aims.

    Very difficulty, but possible with alot of coding
    Yeah, I plan on eventually doing this, with a LOT of limitations and checks.
    I will be specifically heavy on the limitations with molotovs, since on Expert a single molly can wipe every survivor very easily.

    They easily use grenades by themselves too, you just need to force them as their active weapon.
    __________________
    DeathChaos25 is offline
    bazrael
    Senior Member
    Join Date: Jan 2010
    Location: Where Lucy became superw
    Old 04-17-2015 , 22:15   Re: [L4D2] Defib using Bots (Updated 04-17-2015)
    Reply With Quote #10

    Let's think about a possible case:
    Tank kills a player and another bot survivor. Only one alive bot HAL9000 carrying a defibrillator and saves dead bot!

    Now we Left player 4 Dead. T-T
    __________________
    Kill all the son of a bitches, that's my official instructions.
    L4Dε Modified Talker
    bazrael 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 04:47.


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