Garry's Mod

Garry's Mod

[GM++] HL2 Weapon Reskin/Replacement Compatibility
 This topic has been pinned, so it's probably important
sev  [developer] 19 Aug @ 2:25am
Request Reskin and Weapon Pack Support + Error Reporting
Currently taking requests/suggestions for compatibility support

Put a link to the weapon skin or replacement pack here, and I'll see about adding support.

The reskin or pack must have a substantial amount of use (think 10k+ current subscribers or even more views) before it will be considered. Adding one-off or "fixed" addons is beyond the scope of support.

Note that reskins don't have to necessarily be on the Workshop: it's fine if the skin comes from GameBanana or somewhere similar. Skin support is hash-based, so any model can be supported, regardless of if it came from the Workshop or not. However, replacement pack support is based on installed Workshop IDs, so the replacement pack must be on the Workshop to get support.

Just to be clear: A replacement pack is something like the popular MMod Redux pack, where it adds ironsight support, inspect animations, etc. An addon that just reskins all the guns without adding any extra functionality is not what I'd consider a replacement pack—instead, each skin can be added one by one using its model hash.

Have a problem or bug report?

Feel free to post here if you encounter unexpected issues or errors with the addon.

Please provide:
  • Conflicting addons (if any)
  • Error messages (if any)
  • Thorough description of the issue
Last edited by sev; 24 Aug @ 4:39am
< >
Showing 1-15 of 18 comments
blobmin 21 Aug @ 7:20am 
when reloading the pistol when the magazine is not empty, the reload does not come with camera animations
sev  [developer] 21 Aug @ 6:04pm 
what weapon pack do you have installed?
sev  [developer] 22 Aug @ 12:45am 
didnt hear from you so I took a look. the issue was in GM++. I've released an update to both that should make camera animation detection much better.
blobmin 22 Aug @ 3:13am 
sorry for not responding eariler but thanks for the update
I'd really like you to share how one can add support to SWEPs
Last edited by Lombaxtard; 22 Aug @ 5:22am
I think support for this one is warranted. Should technically use the same values as for the non-Juniez' models version
sev  [developer] 22 Aug @ 9:29am 
Originally posted by Lombaxtard:
I'd really like you to share how one can add support to SWEPs
like I said, you can't for now. I plan to move the current framework into a file-based system (like how the rest of the module code works, and how this addon is able to exist) so that anyone can plop a file down and have it get loaded.

technically you could add your own support for other weapons as-is, it's just that this particular compatibility module is pretty frankensteinish in how it checks for model hashes and workshop addons loaded.

Originally posted by Lombaxtard:
I think support for this one is warranted. Should technically use the same values as for the non-Juniez' models version
can do
Last edited by sev; 22 Aug @ 9:30am
Originally posted by sev:
Originally posted by Lombaxtard:
I'd really like you to share how one can add support to SWEPs
like I said, you can't for now.

It's just that I saw "SWEPs, however, can easily have compatibility added. Reach out if you're interested in this." in the description and decided to come forward
sev  [developer] 22 Aug @ 3:58pm 
Originally posted by Lombaxtard:
I think support for this one is warranted. Should technically use the same values as for the non-Juniez' models version
I've added support for this and fixed some other bugs. update will be released with next gm++ release.

edit: released
Last edited by sev; 22 Aug @ 7:19pm
sev  [developer] 22 Aug @ 4:25pm 
Originally posted by Lombaxtard:
Originally posted by sev:
like I said, you can't for now.

It's just that I saw "SWEPs, however, can easily have compatibility added. Reach out if you're interested in this." in the description and decided to come forward

the best way to find it out would be to extract GM++ and look in the lua/gmpp/basecompat directory.

in general compatibility modules (basecompats) are made up of weapon infos (wepinfos) and various helper functions. your average basecompat is gonna look like this:

local COMPAT = gmpp.compat.new_basecompat("mycoolcompat", "This Is The Title/Label") COMPAT.HELP_TEXT = "This is the help text." -- note that unless you add COMPAT.CONTROLS, the basecompat will not appear in the UI. refer to other basecompats to see how to do this. COMPAT.weapons = { weapon_coolgun = { -- NOTE: all of these values are OPTIONAL. if not provided, sane defaults will be used. only provide a value if the detected defaults do not work! this is what it means to add compatibility. -- flashlight attachment is dynamic, but if the att isnt found automatically, you can specify it in wepinfo flash_att = "name of the flashlight attachment", -- you can correct the pitch/yaw/roll of the attachment flash_pitch = 90, flash_yaw = 180, flash_rotate = 90, -- same for muzzle, which is used for camera animation muzzle_att = "name of the muzzle attachment", muzzle_pitch = 90, muzzle_yaw = 180, muzzle_rotate = 90, -- there is also new "camera" type, used for weapons that have built-in camera animation attachment, like the modern warfare guns. it will have a separate strength slider, but otherwise it works exactly the same as muzzle for now. camera_att = "name of the camera attachment", camera_pitch = 90, camera_yaw = 180, camera_rotate = 90, -- weapon type changes default idle/speed offsets if they aren't provided by the wepinfo, changes melee auto-detection, and changes default zoom amount based on the ironsight weapon zoom cvars -- this is automatically detected based on the weapon holdtype or through a basecompat function weapon_type = "pistol", -- categorizes the weapon as a melee, which allows some effects to be turned off conditionally, like near wall effect -- this is detected automatically in most cases, but you can override that by setting it in the wepinfo directly melee = true, -- categorizes the weapon as a tool, which allows some effects to be turned off conditionally, like near wall effect tool = true, -- gmpp can do its own ironsights/zooming if you set this to true zoom = true, -- how much to zoom the fov zoom_amt = 0.5, -- gmpp can apply an overlay scope. valid types currently are "lines" and "glow". glow is like a combine gun, lines is basic intersecting lines. scope module must be enabled. if 3dscope convar is enabled, a tube will be rendered around the screen to mimic a scope. scope = "lines", -- if the gun is not reloaded all at once, e.g. shotgun which reloads one shell at a time. used by reload indicator single_reload = false, -- viewmodel position offsets -- NOTE: POS/ANG MUST BE UNIQUE VECTORS/ANGLES. do not provide a vector or angle that exists anywhere else. they may get changed at some point, which will change the original vector/angle that was provided. if you want to reuse a vector/angle, multiply it by 1 to clone it. (there is no copy or clone function, thanks garry!) offsets = { -- applied when not moving or walking around idle = { pos = Vector(1, 2, 3), ang = Angle(1, 2, 3) },\ -- applied when using ironsights iron = { pos = Vector(1, 2, 3), ang = Angle(1, 2, 3) }, -- applied when sprinting speed = { pos = Vector(1, 2, 3), ang = Angle(1, 2, 3) } } }, weapon_myothercoolgun = { -- ... } } function COMPAT:on_cached(name) -- this function is called when the wepinfo is first accessed by GM++. you can modify the wepinfo by accessing COMPAT.weapons[name]. the weapon is self. -- if you do not provide this function, GM++ will ensure the wepinfo is good by calling the below function. gmpp.compat.ensure_wepinfo(self, name, COMPAT) -- called by default! end -- there are many other functions that can be used. currently, I believe all of the ones that are allowed are defined in one of the basecompat files. please extract the GMA and check the files for more info. -- load/unload functions, called when compat module is loaded/unloaded function COMPAT.load() end function COMPAT.unload() end

in the future, official documentation for this will be provided.
Last edited by sev; 24 Aug @ 4:45am
Thank you
Does it make sense to be adding implementation through this though? Or there's a chance in the future it will be replaced with something else entirely?
sev  [developer] 23 Aug @ 4:12pm 
this is the correct way to do weapon compatibility. it is aimed at addon developers however, so it might not make sense to you if you're not used to the workflow and don't want to spend time on it.

if anything, the future may contain a way to do it from within the UI, and save the settings in a data file, but that'll probably be a long time away.

if you want, you can suggest support for weapon bases in the GM++ support topic, and we can take a look. we already have generic support for TFA, SWCS, MWB, etc., and any guns that are specifically broken or need adjustment within the supported bases we can probably make happen.
Last edited by sev; 24 Aug @ 1:33am
SLIME 24 Aug @ 12:02am 
i think it would be neat if this older pack made by mtb were supported https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=2931229059
Originally posted by sev:
this is the correct way to do weapon compatibility. it is aimed at addon developers however, so it might not make sense to you if you're not used to the workflow and don't want to spend time on it.

if anything, the future may contain a way to do it from within the UI, and save the settings in a data file, but that'll probably be a long time away.

if you want, you can suggest support for weapon bases in the GM++ support topic, and we can take a look. we already have generic support for TFA, SWCS, MWB, etc., and any guns that are specifically broken or need adjustment within the supported bases we can probably make happen.

Thanks, it's alright. No more suggestions from me for now as I'm looking to transferring various replacements to the most vanilla-like SWEP base (Simple Weapons Base ironically is not that). Like, having 3-4 shotguns for example that behave the same way as the original, essentially acting as skins. I was also looking for a Valve-like DMR to use with GM++ plus HL2 weapons damage modifier. I got it, transferred it to the mentioned SWB, injected origins by bruteforcing them into the file that has them for stock weapons just as a proof of concept (since back when I asked about adding weapon support in the GM++ discussion I unfortunately got no reply) and it felt just right
Anyway, it's all very niche so I won't be bothering you with it any longer unless I have questions regarding implementation
Last edited by Lombaxtard; 24 Aug @ 1:48am
sev  [developer] 24 Aug @ 1:52am 
sure, no problem. all you really should have to do is copy the lua/gmpp/basecompat/base_hl2.lua file, rename it and the module inside to something else, and replace the weapon names and offsets with your own. it will be loaded automatically by GM++.

if you made your changes back in the day you might have found the default HL2 weapon offsets stored in the lua/gmpp/modules/weapon.lua file, so be warned that has all been moved to its own dedicated file as written above. the only thing in the weapon.lua file now is the default weapon offsets that are used if no offsets are provided (under weapon.preset_offsets, categorized by holdtype).

we don't plan on modifying how anything works in the basecompats so you should be completely safe to rely on it for the future. rather, we'll likely be adding more to it as time goes on. do note however that we can't guarantee there won't be breaking changes just yet, since a lot in GM++ changes pretty frequently. Juckey regards the project as an "open beta" so treat it as such.

if you use a weapon base that already has support for ironsights, like SWCS, they will be imported into GM++ and usable with our ironsights immediately with no work from you. (offsets, if you desire them, are another story tho)

it sounds like you have some experience with GM++ hacking already. it's not too difficult just a bit cumbersome and not publicly documented (yet). so let us know if you have any questions.
Last edited by sev; 24 Aug @ 2:01am
< >
Showing 1-15 of 18 comments
Per page: 1530 50