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

L4D Ledge Release


Post New Thread Reply   
 
Thread Tools Display Modes
Author
madcap
Senior Member
Join Date: Feb 2009
Plugin ID:
866
Plugin Version:
1.4.3
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Allow players who are hanging form a ledge to let go.
    Old 04-25-2009 , 00:07   L4D Ledge Release
    Reply With Quote #1

    L4D Ledge Release - Allows players to let go when hanging from a ledge by pressing their CROUCH key.

    When you run this plugin for the first time the file /cfg/sourcemod/sm_plugin_ledge_release.cfg will be created giving you some options if you wish to modify the behavior.

    ledge_drop_damage
    The minimum amount of damage you take from letting go (regardless of fall damage). Default is 2.

    ledge_message
    The message displayed to players to notify them they can drop from a ledge. Default is "If you'd like to let go of this ledge press your CROUCH key.".

    ledge_min_hang_time

    The minimum amount of time (in seconds) a player must hang from a ledge before they can let go. Default is 3 seconds. This gives the player enough time to realize their situation before possibly accidentally letting go.

    Players can not let go while they are being rescued or once all the survivors have been incapped. Note that you start falling when you release your crouch key, not when you first press it. If you were already crouching when you started hanging you'll need to release the button, press it again and release it again.

    Quote:
    Change Log
    1.4.1 - Official version now that the forums are working again.
    1.4.2 - Fixed health overflow bug.
    1.4.3 - Updated to support more than 8 players.
    This idea has been floating around for a long time. AltPluzF4 finally figured out a good way to implement it. I'm only the maintainer, AltPluzF4 deserves the credit for this.
    Attached Files
    File Type: sp Get Plugin or Get Source (ledge_release.sp - 6541 views - 5.7 KB)

    Last edited by madcap; 09-27-2009 at 09:43. Reason: update
    madcap is offline
    Damed
    Junior Member
    Join Date: Mar 2009
    Location: St. Petersburg, Russia
    Old 04-25-2009 , 04:38   Re: L4D Ledge Release
    Reply With Quote #2

    failed to compile o_o
    Damed is offline
    Send a message via ICQ to Damed
    CrimsonGT
    Veteran Member
    Join Date: Oct 2007
    Location: Gainesville, FL
    Old 04-25-2009 , 06:01   Re: L4D Ledge Release
    Reply With Quote #3

    Fixed version, one of the convars was just missing an empty parameter. Ill delete this after you update yours madcap, just throwing it up so people can test your mod out until you log back in.

    Great plugin btw, I know this was a huge request on the plugin request forums. Its definitely not a very efficient method, but sadly probably the only one that will actually work without some hefty extension work backing it.
    Attached Files
    File Type: sp Get Plugin or Get Source (ledge_release.sp - 2378 views - 4.1 KB)
    __________________
    CrimsonGT is offline
    danielsumi
    Member
    Join Date: Feb 2009
    Old 04-25-2009 , 06:56   Re: L4D Ledge Release
    Reply With Quote #4

    Thank you madcap, sounds great.
    And crimson for fixing it a bit

    Going to test it and feedback asap.
    danielsumi is offline
    AtomicStryker
    Veteran Member
    Join Date: Apr 2009
    Location: Teutonia!!
    Old 04-25-2009 , 13:18   Re: L4D Ledge Release
    Reply With Quote #5

    Works fine, though the 'You can let go..' message seems to come up twice
    AtomicStryker is offline
    madcap
    Senior Member
    Join Date: Feb 2009
    Old 04-25-2009 , 16:03   Re: L4D Ledge Release
    Reply With Quote #6

    Sorry about that, I changed the wording at the last minute and forgot to make sure it compiled. Should be all better now.

    Is anyone else seeing the message twice? I'm not. Probably something we can figure out though.
    madcap is offline
    AltPluzF4
    Senior Member
    Join Date: Aug 2007
    Old 04-25-2009 , 18:35   Re: L4D Ledge Release
    Reply With Quote #7

    Eh, just tried some profiling...

    OnGameFrame lasted 0.000039

    That's the highest I recorded in my test. Running dedicated server on same box that I joined on. Q6600

    That doesn't seem too bad. I do have an idea that might be better, but I don't know a way to actually profile it. I'll get back to you when I try some stuff...
    AltPluzF4 is offline
    madcap
    Senior Member
    Join Date: Feb 2009
    Old 04-25-2009 , 19:08   Re: L4D Ledge Release
    Reply With Quote #8

    As I understand it OnGameFrame runs once for every server tick, so it is running 33/66/100 times per second.

    It's not really a problem right now otherwise my host would have emailed me by now saying I'm using too much CPU. But if there was a way to move this to a totally event driven system it would be a lot more efficient.

    I have some ideas but none of them would be nearly as elegant as the current solution. I'm thinking all the events we need are there. We can track health with player_hurt and we can track when someone starts hanging with the incap/revive events. If we moved the drop functionality to a console command then I think we could eliminate all the need for OnGameFrame(). I'll be playing around with it. But like I said, it wouldn't be nearly as elegant as this.
    madcap is offline
    AltPluzF4
    Senior Member
    Join Date: Aug 2007
    Old 04-25-2009 , 21:38   Re: L4D Ledge Release
    Reply With Quote #9

    Well... I guess we could keep track of the health and then on ledge grab create a repeating timer. The timer can check for the use of the crouch key, and release the player. That would probably be more efficient. Keeping track of the health might be a problem though... It's a shame the player_ledge_grab event is fired after the health is modified!

    Also, you can remove all of the revived events. Just get the clients m_reviveOwner sendprop, and if it's greater than 0 (can be 0 or -1 from my tests), refuse them the ability to drop.
    AltPluzF4 is offline
    Zeusbba
    Member
    Join Date: Jan 2009
    Location: NY
    Old 04-26-2009 , 21:26   Re: L4D Ledge Release
    Reply With Quote #10

    Nice work on this, it is something myself and several clanmates had discussed alot as should have been in L4D originally, hanging 6 inches from the ground and dying??
    Zeusbba 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 03:20.


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