Garry's Mod

Garry's Mod

Clientside Hitreg
79 Comments
wget  [author] 18 May @ 5:30pm 
@Glebaasツ
idk why it would, this addon doesnt do anything per-frame, it only does something when bullets are fired
it naturally uses a bit more memory and increases net usage, but only very minimally
there aren't memory leaks (like shot info tables being retained in memory forever) and the net messages are packed as tight as they can possibly be, you can check the code on github
Glebaasツ 18 May @ 8:08am 
Can this addon affect FPS and optimization in any way?
sadie! <3 14 May @ 10:09am 
holy moly it even fixed the bullet penetration and particles are working now.
sadie! <3 14 May @ 10:00am 
Fix seemed to have worked without a hitch. Thanks for the quick fix! <3
wget  [author] 14 May @ 12:22am 
@sadie! <3
thanks for reporting, can you check if the recent update fixes your issue
sadie! <3 13 May @ 11:19pm 
[Clientside Hitreg] lua/marghitreg/sv_marghitreg.lua:1059: Tried to use a NULL entity!
1. unknown - [C]:-1
2. v - lua/marghitreg/sv_marghitreg.lua:1059
3. unknown - lua/includes/modules/hook.lua:102

It seems to be an issue only with SWCS, even with bullet penetration disabled.
wget  [author] 13 May @ 10:12pm 
@sadie! <3
can you send the errors
sadie! <3 13 May @ 6:02pm 
For whatever reason, SWCS weapons work like a dream with this in sandbox, but cause errors, don't show up particles when i shoot things, and make bullet penetration inconsistent in TTT.
22050hz amen break sample 23 Feb @ 1:48am 
this remains goated because it doesn't break bullet spread unlike leyhitreg
wget  [author] 7 Feb @ 2:52am 
IMPORTANT!!!

now that leyhitreg was just recently made free and open source and available on the workshop ( https://sp.zhabite.com/sharedfiles/filedetails/?id=3421440369 ), please do NOT use both leyhitreg and this addon at the same time

having both leyhitreg and this addon active at the same time will NOT somehow result in better hitreg if that's what you're thinking, it will actually just break a ton of things that nobody's gonna help you with, because they are not meant to be used together

you must install only either this addon or leyhitreg, so just use whichever one's most compatible with your server's set of addons
wget  [author] 6 Feb @ 3:26am 
btw code should be up on github now, which i should've done like 2 years ago
https://github.com/wgetJane/gmod-clientside-hitreg
Winn 5 Feb @ 1:55pm 
it was really weird, it happened once and then never again. thank you for your efforts though
wget  [author] 5 Feb @ 4:40am 
@Winn
i could not replicate this at all in any branch, can you be specific about the circumstances of the crash?
wget  [author] 30 Jan @ 9:39pm 
@Winn
very odd, this is a crash on the C-side of the game

what branch of gmod is the server on, main or 64-bit or dev?

also can you be more specific on how the crash happened? is it a vanilla hl2 gun shooting a strider?
Winn 30 Jan @ 6:43pm 
crashed while shooting a strider

Client
*Not in Lua call OR Lua has panicked*

Server
0. DispatchTraceAttack - [C]:-1
1. func - lua/marghitreg/sv_marghitreg.lua:1087
2. internal_call - lua/includes/modules/hook.lua:409
3. (null) - lua/includes/modules/hook.lua:428

MenuSystem
*Not in Lua call OR Lua has panicked*
wget  [author] 4 Dec, 2024 @ 5:44pm 
@Loewenstern
yes, the addon only ever disables itself in single-player mode
Loewenstern 4 Dec, 2024 @ 1:36pm 
does this work when hosting peer to peer?
wget  [author] 20 Oct, 2024 @ 4:59am 
@Dr. House M.D.
can you paste in the error you're getting
Silly Driver 19 Oct, 2024 @ 12:32pm 
I'm having issues where the add-on either partially loads and errors or simply refuses to load at all.

sv_allowcslua 1 fixes the add-on not loading at all problem, but it still randomly decides to show only three or four convars instead of all the ones listed in the description, as well as erroring when shooting things (indicating something is missing).

Add-on works fantastic for my needs, but I cannot for the life of me get it to reliably load without restarting the server several times. (tested without other add-ons enabled)
4GClaroARG 28 Sep, 2024 @ 6:19am 
Thanks
wget  [author] 27 Sep, 2024 @ 11:51pm 
@4GClaroARG it should, maybe set clhr_tolerance_ping to like 200

if you're playing in a private server with only friends then setting clhr_supertolerant 1 should be fine
4GClaroARG 27 Sep, 2024 @ 7:13am 
Does this work well for players who have 200/250 ping? Because I have some players who play from the other side of the world.
wget  [author] 25 Jun, 2024 @ 9:08am 
@SpawN (El Diablo)
this is a multiplayer-only addon, there's nothing it can possibly even do in singleplayer
[IG] Murlock 25 Jun, 2024 @ 8:47am 
BUT FR, this can prob be done better than goto statments lol! this is rly funny to me :mortis:
[IG] Murlock 25 Jun, 2024 @ 8:46am 
::loop::

print("WHY THE FUCK IS GOTO A THING IN LUA I HAD NO IDEA. IDK HOW TO FEEL ABOUT THIS")

goto loop
3840x2160 yes 24 Jun, 2024 @ 5:34pm 
These do not work In singleplayer, It likely Isn't Intended to work In SP but I'd still like to see SP support.
3840x2160 yes 9 Jun, 2024 @ 6:11pm 
I tested It and I determined that It's not any of my addons.
3840x2160 yes 6 Jun, 2024 @ 4:32pm 
I'm not too sure then, I'll have to see to It myself l8tr
wget  [author] 5 Jun, 2024 @ 11:19pm 
@SpawN (El Diablo)
just tested on the main and 64-bit versions and it works completely fine
3840x2160 yes 5 Jun, 2024 @ 5:54pm 
I don't wanna bother with what addon prevents the addon from working, even then I also tried It with all of my addons disabled and still.
wget  [author] 4 Jun, 2024 @ 10:27pm 
@SpawN (El Diablo)
most of the cvars are serverside, also are you sure that the addon is actually enabled? if it is then there might be a diff addon that's preventing this from working
3840x2160 yes 4 Jun, 2024 @ 5:03pm 
I don't see the cvars In console.
wget  [author] 8 May, 2024 @ 11:15pm 
@BOSNIAN FOREVER ZA DOMOVINU
projectile bullets will not use clientside hitreg, only hitscan bullets will
berserklover1965 8 May, 2024 @ 11:06pm 
might be a dumb question but if a weapon mod i'm using has projectile bullets will it work for that too
Global 24 Apr, 2024 @ 10:23am 
Yep, that caused prints - sorry for bothering you! Everything looks good here.
Global 24 Apr, 2024 @ 10:12am 
Oh, okay
I'll look into that tip, thanks a bunch
wget  [author] 24 Apr, 2024 @ 6:53am 
@Global
clhr_printshots should only be printing shots that would've missed without clhr, try applying a clientside bonemanip on your target to ensure that the client and server hitboxes are desynced
Global 22 Apr, 2024 @ 7:30am 
I only made an attempt when this add-on wasn't printing anything for TFA Base weapons, even with clhr_printshots set to 1 - I checked if TFA was at least calling both EntityFireBullets and the Post hook, and it appears to be doing so.
I'll keep poking at it
wget  [author] 22 Apr, 2024 @ 7:23am 
@Global
yeah i did attempt that too but got distracted by something else and when i finally got back to it all my progress was incomprehensible to me

currently, i don't really have plans to switch it over since nobody has reported any issues with it, and after some testing, various bullet-related hooks including the new one still work fine
Global 22 Apr, 2024 @ 7:17am 
Makes me wonder if the new PostEntityFireBullets hook could be used for this - iirc that allows multiple hooks to be run for each bullet?
I made an attempt to convert this over to it and failed miserably lol
Spanospy 29 Dec, 2023 @ 1:26pm 
Heyo! Any chance to put this onto GitHub?
kitrod 24 Nov, 2023 @ 3:55pm 
what exactly does ping tolerance do? is it just the maximum it is able to try to compensate for?
Scribble 24 Oct, 2023 @ 5:28pm 
Awesome mod!
wget  [author] 11 Oct, 2023 @ 7:25pm 
@greenodst
thanks, should be fixed now
greenodst 11 Oct, 2023 @ 8:04am 
Hey just wanted to say that I've been getting this error since the most recent update.

[Clientside Hitreg] lua/marghitreg/sv_marghitreg.lua:176: attempt to index field 'targets' (a nil value)
1. validate - lua/marghitreg/sv_marghitreg.lua:176
2. v - lua/marghitreg/sv_marghitreg.lua:1131
3. unknown - lua/includes/modules/hook.lua:96
Mr.Patate 27 Aug, 2023 @ 10:16am 
imma try to fix this problem, thanks for answering
wget  [author] 27 Aug, 2023 @ 9:39am 
@Mr.Patate
it is very unlikely that this addon would affect your framerate
Mr.Patate 27 Aug, 2023 @ 7:24am 
any way of fixing it ?
Mr.Patate 27 Aug, 2023 @ 7:24am 
idk why but this makes me lose a lot of fps
weedshot 10 Jul, 2023 @ 7:10pm 
replaces bone editor