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

[ANY?] Velocities (Custom velocity settings)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Nickelony
Junior Member
Join Date: Aug 2017
Location: Poland
Plugin ID:
5792
Plugin Version:
2.2
Plugin Category:
Gameplay
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Adds custom velocity settings such as 'sm_bonusvelocity', 'sm_velocity_multiplier' and more.
    Old 08-29-2017 , 10:31   [ANY?] Velocities (Custom velocity settings)
    Reply With Quote #1


    A simple plugin that adds custom velocity settings such as 'sm_bonusvelocity', 'sm_velocity_multiplier' and more.
    The main purpose of this plugin is to share some amazing velocity functions, which you can use in your plugins or directly on your server.

    If you're going to use this plugin on your server, please keep in mind that it only affects the horizontal velocity, unless you change it in the code.


    Source code

    SPECIAL THANKS TO:
    • Zipcore for fixing some stuff.

    CVars:
    • sm_bonusvelocity - Adds a fixed amount of bonus velocity every time you jump.
    • sm_maxjumpvelocity - Maximum amount of velocity to keep per jump.
    • sm_maxvelocity - Replacement for sv_maxvelocity, but this one can be client-sided.
    • sm_minvelocity - Minimum amount of velocity to keep per jump.
    • sm_velocity_multiplier - Multiplies your current velocity every time you jump.

    Installation:
    Just drag and drop "velocities.smx" into your "plugins" folder and restart the server.

    Requirements:
    • SourceMod 1.8 or above

    Games tested:
    • Counter-Strike: Global Offensive
    • Counter-Strike: Source
    Attached Files
    File Type: sp Get Plugin or Get Source (velocities.sp - 904 views - 5.9 KB)

    Last edited by Nickelony; 10-12-2017 at 09:56. Reason: Update 2.2
    Nickelony is offline
    headline
    SourceMod Moderator
    Join Date: Mar 2015
    Old 09-10-2017 , 03:46   Re: [ANY?] Velocities (Custom velocity settings)
    Reply With Quote #2

    I'm a little late, but here are some tweaks... These aren't exactly required to be fixed for plugin approval, but I recommend you do.
    1. redundant sdktools include
    2. unncessary global caching of cvars, just use .FloatValue when you need the value, no need to cache it or hook it's changes. (saves you a bit of code)
    3. switch 'any' tag to 'int' on 'void MinVelocity(any data)'

    Otherwise. Great release!

    Last edited by headline; 09-10-2017 at 03:47.
    headline is offline
    Grey83
    Veteran Member
    Join Date: Dec 2014
    Location: Ukraine
    Old 09-10-2017 , 07:24  
    Reply With Quote #3

    maybe it's better in this way?
    Changes v1.0.1:
    • Names of ConVars are changed for easier their search/reminder (sm_velocity_bonus, sm_velocity_min, sm_velocity_multiplier)
    • Adeed ConVars sm_velocity_version and sm_velocity_enable
    • The code of plugin is optimized

    P.S.
    Quote:
    This plugin only affects the horizontal velocity.
    It's nice
    Attached Files
    File Type: sp Get Plugin or Get Source (velocities 1.0.1.sp - 628 views - 3.2 KB)
    __________________

    Last edited by Grey83; 09-10-2017 at 07:28.
    Grey83 is offline
    shavit
    AlliedModders Donor
    Join Date: Dec 2011
    Location: Israel
    Old 09-10-2017 , 09:58   Re: [ANY?] Velocities (Custom velocity settings)
    Reply With Quote #4

    Quote:
    Originally Posted by Headline View Post
    1. unncessary global caching of cvars, just use .FloatValue when you need the value, no need to cache it or hook it's changes. (saves you a bit of code) I believe that this was taken from my bhoptimer plugin (considering OP sent a pull request to it with this plugin's functionality) and upon testing, it seemed a bit faster on a populated server as there are less calls to the natives when the variables are accessed directly via SP. (.FloatValue is just a to GetConVarFloat(), unless I'm missing something? I'd love to be proven wrong, if it results in the same performance and less code.)
    2. switch 'any' tag to 'int' on 'void MinVelocity(any data)' Why? That's the data type in RequestFrameCallback!
    ^^
    __________________
    retired
    shavit is offline
    Nickelony
    Junior Member
    Join Date: Aug 2017
    Location: Poland
    Old 09-10-2017 , 13:57   Re: [ANY?] Velocities (Custom velocity settings)
    Reply With Quote #5

    Version 2.0 is out!
    I've updated the plugin by adding some new features and changing some minor things.

    Quote:
    Originally Posted by Headline View Post
    I'm a little late, but here are some tweaks... These aren't exactly required to be fixed for plugin approval, but I recommend you do.
    1. redundant sdktools include
    2. unncessary global caching of cvars, just use .FloatValue when you need the value, no need to cache it or hook it's changes. (saves you a bit of code)
    3. switch 'any' tag to 'int' on 'void MinVelocity(any data)'

    Otherwise. Great release!
    This plugin is using SDKTools now since I've replaced SetEntPropVector() with TeleportEntity() because SetEntPropVector() is glitching with trigger_teleport sometimes.
    I'll have to agree with shavit on 2 and 3.

    Otherwise. Thanks!

    Quote:
    Originally Posted by Grey83 View Post
    maybe it's better in this way?
    Changes v1.0.1:
    • Names of ConVars are changed for easier their search/reminder (sm_velocity_bonus, sm_velocity_min, sm_velocity_multiplier)
    • Adeed ConVars sm_velocity_version and sm_velocity_enable
    • The code of plugin is optimized

    P.S. It's nice
    Sorry, but I won't use your version since it looks like a language I don't understand.

    Last edited by Nickelony; 09-10-2017 at 14:03.
    Nickelony is offline
    headline
    SourceMod Moderator
    Join Date: Mar 2015
    Old 09-10-2017 , 14:33   Re: [ANY?] Velocities (Custom velocity settings)
    Reply With Quote #6

    Quote:
    Originally Posted by Headline View Post
    1. unncessary global caching of cvars, just use .FloatValue when you need the value, no need to cache it or hook it's changes. (saves you a bit of code) I believe that this was taken from my bhoptimer plugin (considering OP sent a pull request to it with this plugin's functionality) and upon testing, it seemed a bit faster on a populated server as there are less calls to the natives when the variables are accessed directly via SP. (.FloatValue is just a to GetConVarFloat(), unless I'm missing something? I'd love to be proven wrong, if it results in the same performance and less code.)
    2. switch 'any' tag to 'int' on 'void MinVelocity(any data)' Why? That's the data type in RequestFrameCallback!
    I can't imagine that a single native call would show any noticeable performance hit. Especially grabbing a cached value from SM.
    I'd take a few more native calls rather than some global vars, change callbacks, and logic to update them. But, that's just me.

    Also, the any tag should really never be used by plugins. It's useful for includes in order to allow people to specify which type they'd like to pass, but should generally be avoided in the script itself to prevent weird tag problems.

    Last edited by headline; 09-10-2017 at 14:35.
    headline is offline
    SnowHP
    Senior Member
    Join Date: Sep 2016
    Location: Porto, Portugal
    Old 09-10-2017 , 14:51   Re: [ANY?] Velocities (Custom velocity settings)
    Reply With Quote #7

    Looking for this for months! Nice plugin will use it for sure on surf and deathrun
    __________________
    SnowHP is offline
    Nickelony
    Junior Member
    Join Date: Aug 2017
    Location: Poland
    Old 10-10-2017 , 14:45   Re: [ANY?] Velocities (Custom velocity settings)
    Reply With Quote #8

    Update 2.2.

    Changelog:
    • Renamed all the CVars so they are easier to remember.
    • Added a CVar called "velocities_enable" to enable or disable all features of the plugin.
    • Slightly optimized the code.
    Nickelony is offline
    JoinedSenses
    Senior Member
    Join Date: Sep 2013
    Old 11-05-2017 , 18:42   Re: [ANY?] Velocities (Custom velocity settings)
    Reply With Quote #9

    Any thoughts on if it's possible to set airaccel per player?
    JoinedSenses is offline
    Reply


    Thread Tools
    Display Modes

    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 19:04.


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