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

VariableFF


Post New Thread Reply   
 
Thread Tools Display Modes
Author
bl4nk
SourceMod Developer
Join Date: Jul 2007
Plugin ID:
243
Plugin Version:
1.0.3
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Changes the amount of damage done by friendly fire.
    Old 12-31-2007 , 16:02   VariableFF
    Reply With Quote #1

    VariableFF

    Changes the amount of damage done by friendly fire.

    Commands:

    sm_variableff_amount <Amount to scale FF damage by>
    sm_variableff_selfdamage <0\1>

    Examples:
    • sm_variableff_amount
      • 0 = No damage (same as FF off)
      • .5 = Half damage
      • 1 = Default damage (plugin halts)
      • 2 = Double damage
    • sm_variableff_selfdamage
      • 0 = Self damage isn't scaled
      • 1 = Self damage is scaled
    Notes:
    • This plugin should work with any mod. If any problems arise, don't hesitate to post them.
    • Setting the amount to 1 will halt the plugin, as that wouldn't change the damage at all.
    • The "new" damage amount is rounded to the nearest integer to avoid problems with displaying health percentages.
    • Setting the amount to 0 is exactly the same as turning FF off (minus players reacting to being shot).
    • You can't set the amount to anything below 0.
    Installation:
    • Download the .zip file and extract it to your ~/addons/sourcemod folder. If asked, choose to overwrite any file that exists.
    • Check to make sure that ~/addons/sourcemod/plugins/variableff.smx exists.
    • Change the map, manually load the plugin, or restart the server to use the plugin.
    Compiling/Downloading Notes:

    This plugin uses the "Get Damage in TF2" extension, provided by naris. I didn't upload the .sp file directly since the webserver wouldn't be able to compile it due to missing includes. Instead, I put all of the needed files inside of the .zip for you to download. Use the .smx I provided, or compile it yourself.

    Thanks to:
    • naris for the extensions.
    • EKS & teame06 for helping with my float/integer incompetance.
    • joe.to community for requesting the plugin.
    Changelog:
    • 1.0.0
      • Initial release
    • 1.0.1
      • Fixed a typo that could have caused problems.
    • 1.0.2
      • Added new cvar to Enable\Disable scaling of self damage (sm_variableff_selfdamage).
      • Cleaned up the coding a bit.
    • 1.0.3
      • Fixed a problem that could cause errors when used with certain plugins.
    • 1.0.4
      • Reverted changes from 1.0.3 - they were not the problem. Instead, I added an extra check to make sure that players are in-game before the plugin checks to see if they're alive.
    Attached Files
    File Type: zip variableff_1.0.4.zip (8.5 KB, 783 views)

    Last edited by bl4nk; 01-28-2008 at 12:40.
    bl4nk is offline
    bl4nk
    SourceMod Developer
    Join Date: Jul 2007
    Old 01-01-2008 , 17:53   Re: VariableFF
    Reply With Quote #2

    Updated to Version 1.0.1
    bl4nk is offline
    bl4nk
    SourceMod Developer
    Join Date: Jul 2007
    Old 01-15-2008 , 20:38   Re: VariableFF
    Reply With Quote #3

    Updated to Version 1.0.2
    bl4nk is offline
    RAAP
    Member
    Join Date: Jan 2008
    Location: Vancouver, BC, Canada
    Old 01-16-2008 , 17:42   Re: VariableFF
    Reply With Quote #4

    Do you know if it is at all possible to make it so your own teamates do not react when you shoot them?? That would be awsome.
    RAAP is offline
    bl4nk
    SourceMod Developer
    Join Date: Jul 2007
    Old 01-17-2008 , 12:19   Re: VariableFF
    Reply With Quote #5

    It might be possible, but I'm unsure of how to do it.
    bl4nk is offline
    RAAP
    Member
    Join Date: Jan 2008
    Location: Vancouver, BC, Canada
    Old 01-22-2008 , 19:01   Re: VariableFF
    Reply With Quote #6

    Oh well thanks for your help anyways I really appreciate it
    RAAP is offline
    <DieSel>
    Junior Member
    Join Date: Nov 2007
    Old 01-22-2008 , 23:39   Re: VariableFF
    Reply With Quote #7

    Trying in Insurgency, I'll let you know how it does.
    <DieSel> is offline
    Send a message via MSN to <DieSel>
    Apex_
    Member
    Join Date: Jan 2008
    Old 01-23-2008 , 23:14   Re: VariableFF
    Reply With Quote #8

    I'm getting some nasty debug message spam from the plugin, and it's inflating my logs like crazy.

    Code:
    L 01/23/2008 - 23:13:48: [SM] Native "IsPlayerAlive" reported: Client 2 is not in game
    L 01/23/2008 - 23:13:49: [SM] Displaying call stack trace for plugin "variableff.smx":
    L 01/23/2008 - 23:13:49: [SM]   [0]  Line 31, D:\servers\sourcemod\addons\sourcemod\scripting\include\damage.inc::SaveAllHealth()
    L 01/23/2008 - 23:13:49: [SM]   [1]  Line 58, D:\servers\plugins\variableff.sp::OnGameFrame()
    I'm not sure if it's the combination of mods I have or what, but I only have the base SM stuff plus the Medipacks and Ammopacks plugins installed right now. I could very well be screwing something up but I have no idea what it could be.

    Thanks in advance for any help!

    *Edit: I also have ATAC 2.0.0 installed, if that has any bearing on the above issue*

    Last edited by Apex_; 01-23-2008 at 23:49. Reason: additional information
    Apex_ is offline
    bl4nk
    SourceMod Developer
    Join Date: Jul 2007
    Old 01-24-2008 , 00:01   Re: VariableFF
    Reply With Quote #9

    Try the version attached to my post. I made it so it only saves player's HP when they take damage, instead of saving it every game frame. That way it only updates when needed, instead of many times a second. It should work fine, but if any problems arise, please post them ASAP and I'll try to fix it. If all is well, I'll update the first post with it for others to download.
    Attached Files
    File Type: zip variableff_1.0.3.zip (7.5 KB, 393 views)
    bl4nk is offline
    Apex_
    Member
    Join Date: Jan 2008
    Old 01-24-2008 , 01:09   Re: VariableFF
    Reply With Quote #10

    Quote:
    Originally Posted by bl4nk View Post
    Try the version attached to my post. I made it so it only saves player's HP when they take damage, instead of saving it every game frame. That way it only updates when needed, instead of many times a second. It should work fine, but if any problems arise, please post them ASAP and I'll try to fix it. If all is well, I'll update the first post with it for others to download.
    Thanks for the quick reply! Your changes seem to have done the trick. I updated the files and reloaded the plugin, and it seems to have stopped spamming the log with messages. I made sure to cause some team damage to ensure it would trigger the plugin's features, and no log flooding occurred. That's quite a relief, keeping up with the log file's growth was a chore

    Cheers, and thanks again!
    Apex_ 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 02:23.


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