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

[L4D] Crawl Balancer


Post New Thread Reply   
 
Thread Tools Display Modes
Author
crazydog
AlliedModders Donor
Join Date: Jan 2006
Plugin ID:
1234
Plugin Version:
1.1
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Increases damage while crawling
    Unapprover:
    Reason for Unapproving:
    requested
    Old 10-20-2009 , 20:17   [L4D] Crawl Balancer
    Reply With Quote #1

    Description:
    This plugin does two things:
    1) Turns on survivor crawling
    2) Deals extra damage to survivors while they are actively crawling.

    I believe the extra damage balances out crawling a little. That way if you incap a survivor in an unreachable place, there's more of a chance that they will still die while crawling to where they can be reached.

    Cvars:
    sm_crawlbalance_multiplier - Multiplier for damage while actively crawling. Default=1.3 (Min=1.0 Max=33.0)
    sm_crawlbalance_version - Shows the version

    Notes:
    This hasn't been extensively tested, so if you notice anyone taking multiplier*damage when they are not crawling, please let me know!

    If someone is holding their forward button while hanging on a ledge, the multiplier will still take effect. For some reason, the "player_ledge_hang" event is NOT only fired when a player is hanging on a ledge. Why? I have no idea. Because of that, I can't just disable the damage from when that event is fired until they are saved or they die. If anyone knows of a reliable way to check if someone is grabbing a ledge, let me know!

    If you have less than 100 health, you won't take the extra damage. This is due to the fact that Left4Dead events are very unorganized, and don't always fire correctly. That means I can't be 100% sure someone is incapped. If anyone knows a reliable way of checking if someone is incapped, let me know!


    Changelog:
    Code:
    1.1
     - Fixed bug where non-incapped survivors would take extra damage
     - Because of that fix, incapped survivors with less than 100 health will take normal damage
    1.0
     - Initial Release
    Attached Files
    File Type: sp Get Plugin or Get Source (crawlbalancer.sp - 1319 views - 3.2 KB)

    Last edited by crazydog; 10-20-2009 at 21:45.
    crazydog is offline
    Dragonshadow
    BANNED
    Join Date: Jun 2008
    Old 10-21-2009 , 09:53   Re: [L4D] Crawl Balancer
    Reply With Quote #2

    Very nice idea!
    Dragonshadow is offline
    Erik V
    Member
    Join Date: Oct 2009
    Old 10-26-2009 , 23:23   Re: [L4D] Crawl Balancer
    Reply With Quote #3

    Quote:
    Originally Posted by crazydog View Post
    If anyone knows of a reliable way to check if someone is grabbing a ledge, let me know!

    If anyone knows a reliable way of checking if someone is incapped, let me know!
    PHP Code:
        g_iIsHanging  FindSendPropInfo("CTerrorPlayer","m_isHangingFromLedge"); 

        
    g_iIsIncapped  FindSendPropInfo("CTerrorPlayer","m_isIncapacitated"); 

    Last edited by Erik V; 10-26-2009 at 23:27.
    Erik V is offline
    crazydog
    AlliedModders Donor
    Join Date: Jan 2006
    Old 10-27-2009 , 02:07   Re: [L4D] Crawl Balancer
    Reply With Quote #4

    Sweet. I'll put that in. Thanks a bunch.

    Wait, how exactly do I use that? How would it check a specific client?

    Last edited by crazydog; 10-27-2009 at 03:30.
    crazydog is offline
    Erik V
    Member
    Join Date: Oct 2009
    Old 10-27-2009 , 10:33   Re: [L4D] Crawl Balancer
    Reply With Quote #5

    PHP Code:

    //Global variables declared before functions for clarity
    new g_iIsHanging  = -1
    new 
    g_iIsIncapped  = -1;

    public 
    OnPluginStart()
    {
        
    // Event hooks
        
    HookEvent("player_ledge_grab"Event_LedgeGrab);
        
    HookEvent("player_incapacitated"Event_Incapped);

        
    //Player offsets
        
    g_iIsHanging  FindSendPropInfo("CTerrorPlayer","m_isHangingFromLedge"); 
        
    g_iIsIncapped  FindSendPropInfo("CTerrorPlayer","m_isIncapacitated");  

    }

    //lets check what's happening
    public Action:Event_Incapped (Handle:event, const String:name[], bool:dontBroadcast)
    {
         new 
    Client GetClientOfUserId(GetEventInt(event"userid"));
         new 
    ClientHang GetEntProp(ClientProp_Sendg_iIsHanging);
         if(
    ClientHang//if true they are incapped
        
    {
             
    //do Stuff to the incapped  
        
    }
    }
    //do same type of thing to check and use hanging from ledge
     
    //or just put the checking in its own function and have it return a true so you can call it where you see fit 

    Last edited by Erik V; 10-27-2009 at 13:06.
    Erik V is offline
    Antithasys
    Moderator
    Join Date: Apr 2008
    Old 11-21-2009 , 02:27   Re: [L4D] Crawl Balancer
    Reply With Quote #6

    current plugin status?
    __________________
    [my plugins]

    When you think about asking a question... consider what have you tried?
    Antithasys is offline
    crazydog
    AlliedModders Donor
    Join Date: Jan 2006
    Old 11-21-2009 , 07:52   Re: [L4D] Crawl Balancer
    Reply With Quote #7

    If necessary you can unapprove it for now. I'll be able to work on it when the semester's over in 3 weeks.
    crazydog 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 23:58.


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