Skip to content

Add "Interaction Distance" config setting#527

Open
bruck-dev wants to merge 5 commits intoNebulousCloud:masterfrom
bruck-dev:feature/InteractDistance
Open

Add "Interaction Distance" config setting#527
bruck-dev wants to merge 5 commits intoNebulousCloud:masterfrom
bruck-dev:feature/InteractDistance

Conversation

@bruck-dev
Copy link
Copy Markdown
Contributor

Standardized all 96 unit interaction checks with a config variable (defaulting to 96 still) that allows for plugins to use a standard scalar for all interaction checks.

Note that you can't go OVER this value, as ENT:Use() has a hardcoded distance at the engine level of 96 Hammer units (technically 82, but 14 units is not worth dealing with compatibility issues over). I also set a few other literals that were derived from this distance mathematically but not explicitly, such as ix_hands' secondary attack range.

Taken from a handful of other PRs with similar ideas that did not implement it evenly or modified other parameters as well.

1) Standardized all 96 unit interaction checks with a config variable (defaulting to 96 still) that allows for plugins to use a standard scalar for all interaction checks
2) Moved maxHoldDistance to SWEP:Initialize for the ix_hands weapon so it can be set somewhat more dynamically than having it as part of the base class. Won't scale with a new config setting until the player has their loadout re-initialized, but it won't require a server restart
1) Removed intermediate variables I had added for DistSqr math as they were redundant.
1) ix_hands will now automatically heldDistance parameters when the config option is changed, for all players
2) Changed ix_hands' secondary fire ranges to scale with the interact distance. Will still default to 84 when 96 is the maximum distance
3) Set minimum pickup range to 48, as anything below is essentially unusable. Set the max to 96, as ENT:Use() really only fires at 82 units at an engine level, and it doesn't actually let you pick up items
1) Fixed a couple of linter errors about line length. Should probably increase the linter settings, 128 characters is pretty restrictive
1) Shortened interactionDistance to interactRange
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.

1 participant