Raised This Month: $ Target: $400
 0% 

[L4D, L4D2] Less Than 4 Dead


Post New Thread Reply   
 
Thread Tools Display Modes
Author
chinagreenelvis
Senior Member
Join Date: Dec 2009
Plugin ID:
2015
Plugin Version:
3.1.0
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Play with less than 4 survivors in multiplayer
    Old 10-18-2010 , 19:31   [L4D, L4D2] Less Than 4 Dead
    Reply With Quote #1

    Less Than 4 Dead allows less than four players to start an online game with no survivor bots. New players who join once the current players have moved out of the starting area are respawned and then teleported to the location of a random living survivor. They are given a random weapon. Survivors whose players leave the server are removed from the game until another player joins.

    Cvars
    lessthan4dead1, 0: Disable plugin, 1: Enable plugin
    lessthan4dead_maxplayers1, Maximum number of players to allow on the server. This should always be higher than lessthan4dead_survivors. Additional plugins are required to enable more than four players.
    lessthan4dead_survivors4, This is the number of survivors the game will start with.

    Recommended additional plugins
    Attached Files
    File Type: txt l4drespawn.txt (1.7 KB, 1054 views)
    File Type: sp Get Plugin or Get Source (cge_l4d2_lessthan4dead.sp - 2927 views - 9.5 KB)

    Last edited by chinagreenelvis; 12-24-2013 at 00:54.
    chinagreenelvis is offline
    do0g
    Junior Member
    Join Date: Aug 2010
    Old 10-19-2010 , 00:48   Re: [L4D, L4D2] BotSlayer
    Reply With Quote #2

    Hi chinagreenelvis, thanks for this.

    I don't mean to rain on your parade but it occurred to me that perhaps a neater approach would be to kick the survivor bots from the server, and add a new bot when a new client connection event occurs?
    do0g is offline
    chinagreenelvis
    Senior Member
    Join Date: Dec 2009
    Old 10-19-2010 , 09:39   Re: [L4D, L4D2] BotSlayer
    Reply With Quote #3

    No raining done - that was also something I had considered, but I don't know how to do it.

    I guess you'd have to

    1. remove all survivor team bots before any clients connect (not sure if you could do this if running from a local server) Edit: actually, director_no_survivor_bots would probably take care of this and the rest would be the workaround for the crash)
    2. add a survivor bot when a client connects
    3. remove the bot if the client disconnects before joining
    4. remove the bot that is left behind when a client leaves the game

    I'm trying to think of any consequences this might have. There might be some issues with bot_player_replace and someone who goes idle.

    If someone could figure out how to do it this way and make it work, I'd be all for it.

    Last edited by chinagreenelvis; 10-19-2010 at 11:19.
    chinagreenelvis is offline
    chinagreenelvis
    Senior Member
    Join Date: Dec 2009
    Old 10-19-2010 , 11:40   Re: [L4D, L4D2] BotSlayer
    Reply With Quote #4

    I need to figure out how to

    a. quietly add a survivor bot when someone connects to the server
    b. quietly kick the last created survivor bot when a client disconnects
    chinagreenelvis is offline
    do0g
    Junior Member
    Join Date: Aug 2010
    Old 10-19-2010 , 20:52   Re: [L4D, L4D2] BotSlayer
    Reply With Quote #5

    How about using "sb_add" on client connect?
    do0g is offline
    chinagreenelvis
    Senior Member
    Join Date: Dec 2009
    Old 10-19-2010 , 23:30   Re: [L4D, L4D2] BotSlayer
    Reply With Quote #6

    I'm close to discovering a way to prevent bots from being rescuable:

    PHP Code:
    public OnPluginStart() 

        
    HookEvent("survivor_call_for_help"Event_SurvivorHelp);
    }

    public 
    ActionEvent_SurvivorHelp(Handle:event, const String:name[], bool:dontBroadcast

        new 
    SurvivorHelpClient GetClientOfUserId(GetEventInt(event"userid"));
        if (
    IsFakeClient(SurvivorHelpClient))  
        {
            new 
    SurvivorHelpEntity GetEventInt(event"subject");
            
    RemoveEdict(SurvivorHelpEntity);
        }

    This works without the IsFakeClient check, but it doesn't work with it. I'm not sure why.

    Also, I don't know how to put the SurvivorHelpEntity back into the game once it's removed. I'll need to be able to do that if a new player joins in.
    chinagreenelvis is offline
    chinagreenelvis
    Senior Member
    Join Date: Dec 2009
    Old 10-21-2010 , 01:56   Re: [L4D, L4D2] BotSlayer
    Reply With Quote #7

    Huh. Apparently the entity resolves itself when a human takes over and a player controlled survivor becomes rescuable again. I don't have to add a thing.

    I am, however, having issues with bot_player_replace. It seems when a player goes idle, he or she is killed, which is annoying. On top of that, I had a client leave the game and the bot he left behind stayed alive.

    [Edit: It turns out I had it backwards and should have used player_bot_replace for when a bot takes over a player.]

    Last edited by chinagreenelvis; 10-21-2010 at 02:50.
    chinagreenelvis is offline
    chinagreenelvis
    Senior Member
    Join Date: Dec 2009
    Old 10-21-2010 , 01:59   Re: [L4D, L4D2] BotSlayer
    Reply With Quote #8

    Also, regarding the bot kicking method, I've come to find that a newly joined player will spawn in addition to a bot instead of taking it over, which still results in a crash. On top of that, there are numerous timing problems when it comes to player connects and disconnects. In the end, this way will work out much better.
    chinagreenelvis is offline
    chinagreenelvis
    Senior Member
    Join Date: Dec 2009
    Old 10-21-2010 , 02:52   Re: [L4D, L4D2] BotSlayer
    Reply With Quote #9

    Having issues with bots not getting killed on map restart and idle players are still being slayed.

    Last edited by chinagreenelvis; 10-21-2010 at 04:12.
    chinagreenelvis is offline
    chinagreenelvis
    Senior Member
    Join Date: Dec 2009
    Old 10-22-2010 , 02:56   Re: [L4D, L4D2] Less Than 4 Dead
    Reply With Quote #10

    I scrapped the instakill idea at round start in favor of a more dramatic approach. (Also, I just couldn't get it to work properly and it looked stupid.)

    The better solution: survivor bots are now extremely vulnerable to enemy damage, so much so that they are almost guaranteed to die instantly, leaving only the human players to continue the map.

    Have fun!
    chinagreenelvis 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 14:28.


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