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

[L4D2] Spawn Survivor Bots


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Plugin ID:
7842
Plugin Version:
1.0.4b
Plugin Category:
Admin Commands
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    2 
    Plugin Description:
    Spawn survivor bots with a comm-and that's pretty much it. (not a manager plugin)
    Old 11-04-2021 , 09:58   [L4D2] Spawn Survivor Bots
    Reply With Quote #1

    Spawn survivor bots with a command. Takes advantage of the info_l4d1_survivor_spawn entity, and adds a public native for other plugins to use.
    Warning: some plugins may not detect the bots when they spawn due to being on a different team.

    Use the first letter of a survivor name or the m_survivorCharacter numbers to choose who the bots spawn as.
    If used by a player admin, the bot will spawn in their location.
    If used in the server console, the bot will spawn in the first connected player's location.
    The native will only accept m_survivorCharacter numbers, and requires a vector location to be provided to spawn at.

    Uses Silvers' method to spawn the bots, found in the Survivor Bot Holdout plugin.


    Side Note
    The bots will act like they've been rescued if you spawn them after a survivor has already left the saferoom. They'll fire the survivor_rescued event and say thanks as if rescued.
    This only applies if you spawn them on the main Survivor team.


    Examples of sm_survbot use:
    Spoiler


    For developers:
    l4d2_spawnSurvBotsHack.inc -
    Spoiler



    -= Releases =-
    Code:
    Version 1.0.4
    - Fixed bug where Bills provided by the L4D1 campaigns by default (Bill with m_survivorCharacter 0) would just be teleported on attempt to spawn survivor bots.
    - Added include file with a public native for other plugins:
      * l4d2_spawnSurvBotsHack.inc in scripting/include
      Contains L4D2_CreateSurvivorBot_Hack(const float origin[3], int character = -1, int team = 2, int survSet = SURVBOTS_L4D2)
    - Changed plugin name from l4d2_spawn_surv_bots.smx to l4d2_spawnSurvBotsHack.smx
    - Changed sourcemod/cfg config file name from spawn_surv_bots.cfg to l4d2_spawnSurvBotsHack.cfg
    - Added l4d2_spawnBots_nativeTest.sp in sourcemod/scripting to demonstrate native use.
    - Converted to zip file attachment.
    - [Version 1.0.4b] Removed accidental debug PrintToServer in native function.
    Version 1.0.1c
    - Small optimization of valid player checks.
    - Fixed potential temp-bot kicking fail issue.
    Version 1.0.1b
    - Stopped using static for variables that should not persist in attempt to fix a bug with always-Bill bots.
    Version 1.0.1
    - Optimized ConVar value grabbing with Silvers' code.
    - Now compiles for Sourcemod 1.11.
    Version 1.0.0
    - Initial release.

    -= ConVars =-

    sm_spawn_survbot_temp 0 - min:0/max:1
    ^ Kick the Command-spawned bots as soon as they die.
    May be buggy.

    -= How to install =-
    Extract the .ZIP's contents and move the folders into <Your L4D2 Game/Server Installation>\left4dead2
    Example:
    Left 4 Dead 2\left4dead2 (Game)
    l4d2ds\left4dead2 (my Dedicated Server)
    Make sure to remove l4d2_spawn_surv_bots.smx as that is an older, incompatible version of the plugin!
    Attached Files
    File Type: zip l4d2_spawnSurvBotsHack.zip (21.9 KB, 975 views)
    __________________
    ragdoll spam, that is all

    Steam profile, where I game, obviously.
    Youtube channel, where I do Stick Death Maze animations and some other stuff.
    no plugin requests, sorry


    My Plugins:
    -search list-
    Modified Plugins:
    1 | 2 | 3 | 4

    Last edited by Shadowysn; 05-21-2023 at 23:16. Reason: Updated to Version 1.0.4b
    Shadowysn is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 11-04-2021 , 11:51   Re: [L4D2] Spawn Survivor Bots
    Reply With Quote #2

    Nice thanks!

    You can set the bots name using "SetClientName()". I'm guessing you tried this with "targetname"?
    __________________
    Silvers is offline
    Shadowysn
    Senior Member
    Join Date: Sep 2015
    Location: Location:
    Old 11-04-2021 , 12:02   Re: [L4D2] Spawn Survivor Bots
    Reply With Quote #3

    Quote:
    Originally Posted by Silvers View Post
    Nice thanks!

    You can set the bots name using "SetClientName()". I'm guessing you tried this with "targetname"?
    I didn't know about SetClientName() or maybe I forgot about it, but thanks!

    Oh yeah, the DispatchKeyValue(spawn, "targetname", TRICKERY_SPAWNBOT_NAME) line.
    No, I didn't use that to try and set the client name, I tried to use that to... actually I don't remember what I tried to do, but I think it was just a test. My brain is french fry.

    cripes i forgot to credit you for the code used in this plugin

    Last edited by Shadowysn; 11-04-2021 at 12:04.
    Shadowysn is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 11-04-2021 , 12:11   Re: [L4D2] Spawn Survivor Bots
    Reply With Quote #4

    btw to support compiling on 1.11 you need to change:

    PHP Code:
    const float[3origin, const float[3angles 
    to:
    PHP Code:
    const float origin[3], const float angles[3
    __________________
    Silvers is offline
    Shadowysn
    Senior Member
    Join Date: Sep 2015
    Location: Location:
    Old 11-04-2021 , 12:24   Re: [L4D2] Spawn Survivor Bots
    Reply With Quote #5

    Quote:
    Originally Posted by Silvers View Post
    btw to support compiling on 1.11 you need to change:

    PHP Code:
    const float[3origin, const float[3angles 
    to:
    PHP Code:
    const float origin[3], const float angles[3
    Ohh... At first I wasn't sure about those being backwards-compatible with 1.8, but it looks like 1.10 and 1.8 handle it just fine.
    I was never aware that const float[3] origin wasn't recommended for future versions.
    I've found a few other errors with the 1.11 compiler now, so after a few tweaks it should work with 1.11 now.

    Last edited by Shadowysn; 11-04-2021 at 12:25.
    Shadowysn is offline
    kochiurun119
    BANNED
    Join Date: Sep 2014
    Location: GB
    Old 10-02-2023 , 14:04   Re: [L4D2] Spawn Survivor Bots
    Reply With Quote #6

    Can you add sm_cvar with item give to bot when add bot? Weapon , healt , bom
    and add a notification line when creating a bot successfully like this plugin https://forums.alliedmods.net/showthread.php?p=1446781

    Last edited by kochiurun119; 10-02-2023 at 14:10.
    kochiurun119 is offline
    Send a message via ICQ to kochiurun119 Send a message via AIM to kochiurun119 Send a message via Yahoo to kochiurun119 Send a message via Skype™ to kochiurun119
    left4dead2
    New Member
    Join Date: Dec 2023
    Old 12-16-2023 , 23:48   Re: [L4D2] Spawn Survivor Bots
    Reply With Quote #7

    A good plugin is the only one that works.
    But there is a big problem, bots are not visible in the list of server players and I have 0 slots out of 32. Does anyone have a solution to this problem? It is necessary for the bots to be like real players and display in slots so that people enter the server
    left4dead2 is offline
    guyguyga
    Junior Member
    Join Date: Sep 2011
    Old 03-31-2024 , 10:12   Re: [L4D2] Spawn Survivor Bots
    Reply With Quote #8

    If the bot is spawned on the passing team, will they follow the main team or will they just hold out where they are?
    guyguyga is offline
    Shadowysn
    Senior Member
    Join Date: Sep 2015
    Location: Location:
    Old 04-02-2024 , 23:56   Re: [L4D2] Spawn Survivor Bots
    Reply With Quote #9

    Quote:
    Originally Posted by left4dead2 View Post
    A good plugin is the only one that works.
    But there is a big problem, bots are not visible in the list of server players and I have 0 slots out of 32. Does anyone have a solution to this problem? It is necessary for the bots to be like real players and display in slots so that people enter the server
    Can't help you with that. Faking player count is against the rules of Valve's server browsers.
    Quote:
    Originally Posted by guyguyga View Post
    If the bot is spawned on the passing team, will they follow the main team or will they just hold out where they are?
    They will just hold out if sb_l4d1_survivor_behavior is 1 when they are spawned.
    Depending on the nav mesh of the map, they will stand still in the place they spawned in if there's no BATTLESTATION nav squares, or they will run to one of the BATTLESTATION nav squares and hold out on them.
    They will then rotate between the BATTLESTATION nav squares if there is one that's available and not taken by an existing Passing bot.
    This is more-or-less the same behavior used in The Passing.

    Otherwise if spawned when sb_l4d1_survivor_behavior is 0 they will re-use the normal survivor bot behavior, but because the bots are technically on a different team, they won't care about normal survivors.
    __________________
    ragdoll spam, that is all

    Steam profile, where I game, obviously.
    Youtube channel, where I do Stick Death Maze animations and some other stuff.
    no plugin requests, sorry


    My Plugins:
    -search list-
    Modified Plugins:
    1 | 2 | 3 | 4

    Last edited by Shadowysn; 04-03-2024 at 00:00.
    Shadowysn 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 12:59.


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