Garry's Mod

Garry's Mod

Half-Life 2: MMod - Weapon Replacements Redux
KennyIsKaput 23 Nov, 2023 @ 6:46pm
Shmovement Incompatiblity
Apologies for not sending the error sooner. I also tried seeing if I could fix it myself.

[Shmovment: Simple Headbob, Better Firstperson] lua/autorun/client/shmovement.lua:155: attempt to index field 'angles' (a nil value)
1. Shmovement - lua/autorun/client/shmovement.lua:(Varies between 145, 155 and 236)
2. fn - lua/autorun/client/shmovement.lua:401
3. unknown - lua/ulib/shared/hook.lua:109

This occurs any time I move with the Pistol, Revolver, SMG, AR2 and Shotgun, which were recently updated to allow for aiming down the sights. When aiming down sights, the FOV and weapon position revert when walking. Disabling Shmovement prevents these issues. Any other weapon or tool does not display this error and works perfectly fine with Shmovement. My assumption was that there's a value also called "angles" within these weapons that would need to have a different name for it to be compatible.

Using gmad.exe, I decompiled the files of your mod to try and figure out what exactly is causing the error. In "hl2mmod_functions.lua", I attempted to change any instance of the value "angle" to be "angleMMOD", hoping that it would prevent the conflict. Specifically, I changed the values at 270 and 294. This did not fix the issue. Commenting out all code from 270 to 315 fixed it but prevented ADS from being usable.

At this point I don't know what else can be done to fix this beyond uploading a non-ADS version. The version I made works fine for me but friends wouldn't be able to use it. Could I upload a non-ADS version for compatibility's sake, with my own additions made to it as well, such as the SLAM model Juniez created?
< >
Showing 1-2 of 2 comments
c4sual  [developer] 24 Nov, 2023 @ 1:48pm 
Hi, thank you for the detailed post. Unfortunately, both shmovement and the ironsight system use CalcView hook which modifies the player view, as far as I know making these 2 compatible would be very hard to do. Also, what do you mean by non-ADS version? You can just disable ironsights with mmod_ironsights 0.
Last edited by c4sual; 24 Nov, 2023 @ 1:52pm
KennyIsKaput 24 Nov, 2023 @ 2:17pm 
My mistake, I completely forgot that you are able to toggle ironsights. Hopefully this thread helps anyone else who might have issues regarding a similar problem. Thanks for your help!
< >
Showing 1-2 of 2 comments
Per page: 1530 50