Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve stamina plugin and runSpeed config option #357

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

OffLegAz
Copy link
Contributor

@OffLegAz OffLegAz commented Sep 3, 2021

No description provided.

The current check is unreliable. Almost always players velocity length is higher than his walk speed. How much or less higher depends on walkSpeed config value, so it makes, for example, IsRunning function useless if walk speed is really high, or if difference between walk and run speed are pretty low.
Copy link
Collaborator

@ZeMysticalTaco ZeMysticalTaco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, I don't think stripping features, moving them around, or adding new hooks to very -- VERY expensive hooks to touch, will improve anything upon the plugin.

gamemode/config/sh_config.lua Show resolved Hide resolved
plugins/stamina/sh_plugin.lua Outdated Show resolved Hide resolved
plugins/stamina/sh_plugin.lua Show resolved Hide resolved
plugins/stamina/sh_plugin.lua Show resolved Hide resolved
plugins/stamina/sh_plugin.lua Show resolved Hide resolved
Copy link
Contributor Author

@OffLegAz OffLegAz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, I don't think stripping features, moving them around, or adding new hooks to very -- VERY expensive hooks to touch, will improve anything upon the plugin.

I will make some additional commits after you will read and answer about my replies to conversations.

local maxAttributes = ix.config.Get("maxAttributes", 100)
local offset

if (client:KeyDown(IN_SPEED) and client:GetVelocity():LengthSqr() >= (walkSpeed * walkSpeed)) then
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current check is unreliable. Almost always players velocity length is higher than his walk speed. How much or less higher depends on walkSpeed config value, so it makes, for example, IsRunning function useless if walk speed is really high, or if difference between walk and run speed are pretty low.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, Velocity:LengthSqr() is always higher than (walkSpeed * walkSpeed)

I'm not sure... why.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same applies to Velocity:Length, but I haven't figured out why, despite trying for an hour or something

gamemode/config/sh_config.lua Show resolved Hide resolved
plugins/stamina/sh_plugin.lua Outdated Show resolved Hide resolved
plugins/stamina/sh_plugin.lua Show resolved Hide resolved
plugins/stamina/sh_plugin.lua Show resolved Hide resolved
plugins/stamina/sh_plugin.lua Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants