• Weapon Attachment Extension
    25 replies, posted
[QUOTE] Another request, this time it's weapon attachments. Now by attachments I don't mean stuff sticking onto your weapon. This shows your weapons on various places of your body, and it's fully configurable. I'm releasing this much earlier than I intended to, but it works flawlessly as far as I know. during a stress test I had like 500 weapons attached to me and I didn't notice any frame rate drop at all. But that was only tested with 3 players. Now, before I post the source code, I want to clarify that while the script has no problems.. it seems that source engine does. While using player models, not npc models. With a select few of them, it seems bones aren't placed properly. For example, on the combine soldier, his spine bone is in his left thigh for some reason. So while this is fixable by me adding a AdjustPosAng hook and passing the model as an argument, I think i'll just leave it as is, unless someone requests me to do so. However it is still very useable on sandbox and it should work with every gamemode. If there is any conflictions, please let me know. I will fix them. But, like I said that is really the only issue. For example in NutScript and any other gamemode that uses NPC animations, it works 100% perfectly with all models. [/QUOTE] If you still don't understand what this does, here is a screenshot: [URL=http://filesmelt.com/][IMG_THUMB]http://filesmelt.com/dl/gm_flatgrass000243.jpg[/IMG_THUMB][/URL] [QUOTE] And without delaying you anymore, here you go :). [URL] http://filesmelt.com/dl/Weapon_attachment_extension_V2.rar[/URL] Apparently the above link was removed, and as I recently did a wipe this version may have a typo in it( it's common for me to accidentally add my PTT keys into a lua file on accident, although unlikely in this case.) [URL]https://www.dropbox.com/s/yvb6t1hcy7hmot9/sv_weaponattachments.rar[/URL] [/QUOTE] [quote] [b]Adding new hold types, and positioning/angling for custom models and adding blacklisted weapons is very very easy.[/b] There is 3 functions you have at your disposal WAE.RegisterHoldType( strHoldtype, strBone, vecOffset, angOffset ) WAE.RegisterModel( strModel, strBone, vecOffset, angOffset ) WAE.AddBlacklistedWeapon( strClass ) [/quote] Oh which reminds me, you may want to utilize my addon called Weapon Restriction Extension, otherwise you may suffer from astronaut syndrome [URL=http://filesmelt.com/][IMG_THUMB]http://filesmelt.com/dl/gm_flatgrass000352.jpg[/IMG_THUMB][/URL]
This looks great. This will be great for rp.
Good job Lau, its nice to see your still doing stuff for gmod.
Looking awesome! Worth using in Roleplay and otherwise, Tactical Shooter gamemodes like Green Shift 2 and other sort of gamemodes similar. Thanks for releasing the script, can't wait to use this ;)
lmfao i didn't notice the pair of floating feet in my screenshot. someone must have joined when i was mp testing and i didn't even notice lol
Are you able to make it more compatible with m9k guns? atm all the pistols stick out of your ass and a about 2 or 3 rifles do aswell. I had a go at fiddling with it but didn't seem to do much :/
[QUOTE=datguyrick;42817373]Are you able to make it more compatible with m9k guns? atm all the pistols stick out of your ass and a about 2 or 3 rifles do aswell. I had a go at fiddling with it but didn't seem to do much :/[/QUOTE] m9k sucks. its just a merge of gdcw and mad cow with all the good bits removed from both
[QUOTE=datguyrick;42817373]Are you able to make it more compatible with m9k guns? atm all the pistols stick out of your ass and a about 2 or 3 rifles do aswell. I had a go at fiddling with it but didn't seem to do much :/[/QUOTE] what hold type do those weapons use? also if you get the model of the weapon, use the WAE.RegisterModel function, you can choose what bone you want them to go to, and the angle/position. You'd only really have to do that with one rifle, and one pistol. then just copy the rest over besides the model paths. In a little while( may be like tomorrow ), i'll download m9k and update the script so you guys don't have to do that, because I know m9k is pretty widely used.
By the way, could you do this with Customizable Weaponry and Firearms Source 2.0 SWEPs please? Only if it's possible to do this because they use attachments that appear on weapons and stuff, might be a bit difficult or impossible to do but idk because I'm not a lua coder XD
this works with all weapons, considering it is based on holdtypes. some models are kind of odd, though. so you have to use the configuration fnctions.
[QUOTE=LauScript;42820303]what hold type do those weapons use? also if you get the model of the weapon, use the WAE.RegisterModel function, you can choose what bone you want them to go to, and the angle/position. You'd only really have to do that with one rifle, and one pistol. then just copy the rest over besides the model paths. In a little while( may be like tomorrow ), i'll download m9k and update the script so you guys don't have to do that, because I know m9k is pretty widely used.[/QUOTE] They use the normal hold types but i have tried changing when they sit thigh, leg and what not but yer doesn't want to budge anyway thanks in advance when you update :)
did you try to add a custom model position? not just changing the bone for a hold type( which will break other weapons )
Aight it took me a few hours but i got there, Fixed the m9k pistols and 3 rifles that weren't sitting right [code] WAE:RegisterModel( "models/weapons/w_dmg_vally.mdl", "ValveBiped.Bip01_Spine", Vector(-2.5, 4, 5), Angle(-150, -180, -80)); WAE:RegisterModel( "models/weapons/w_snip_m14sp.mdl", "ValveBiped.Bip01_Spine", Vector(-2.5, 4, 5), Angle(-150, -180, -80)); WAE:RegisterModel( "models/weapons/w_tct_famas.mdl", "ValveBiped.Bip01_Spine", Vector(-2.5, 4, 5), Angle(-150, -180, -80)); WAE:RegisterModel( "models/weapons/w_colt_python.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-6.5, -2, -1), Angle(-100, -180, -50)); WAE:RegisterModel( "models/weapons/w_m29_satan.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-6.5, -2, -1), Angle(-100, -180, -80)); WAE:RegisterModel( "models/weapons/w_model_3_rus.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-6.5, -2, -1), Angle(-100, -180, -80)); WAE:RegisterModel( "models/weapons/w_remington_1858.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-6.5, -2, -1), Angle(-100, -180, -80)); WAE:RegisterModel( "models/weapons/w_sw_model_500.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-6.5, -2, -1), Angle(-100, -180, -80)); WAE:RegisterModel( "models/weapons/w_sw_model_627.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-6.5, -2, -1), Angle(-100, -180, -80)); WAE:RegisterModel( "models/weapons/w_taurus_raging_bull.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-6.5, -2, -1), Angle(-100, -180, -80)); WAE:RegisterModel( "models/weapons/w_raging_bull_scoped.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-3, 1, -2), Angle(-100, -180, 180)); WAE:RegisterModel( "models/weapons/w_dmg_glock.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-3, 1, 5), Angle(-100, -180, 98)); WAE:RegisterModel( "models/weapons/w_pist_fokkususp.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-3, 1, 5), Angle(-100, -180, -95)); WAE:RegisterModel( "models/weapons/w_tcom_deagle.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-3, 1, 5), Angle(-100, -180, 98)); WAE:RegisterModel( "models/weapons/s_dmgf_co1911.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-3, 1, 5), Angle(-100, -180, 98)); WAE:RegisterModel( "models/weapons/w_hk45c.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-4.19, -2, 0.50), Angle(-100, -180, -95)); WAE:RegisterModel( "models/weapons/w_sig_229r.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-4.19, -2, 0.50), Angle(-100, -180, -95)); WAE:RegisterModel( "models/weapons/w_beretta_m92.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-4.19, -2, 0.50), Angle(-100, -180, -95)); WAE:RegisterModel( "models/weapons/w_luger_p08.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-4.19, -2, 0.50), Angle(-100, -180, -95)); [/code] Thanks for the script btw
[QUOTE=datguyrick;42837560]Aight it took me a few hours but i got there, Fixed the m9k pistols and 3 rifles that weren't sitting right [code] WAE:RegisterModel( "models/weapons/w_dmg_vally.mdl", "ValveBiped.Bip01_Spine", Vector(-2.5, 4, 5), Angle(-150, -180, -80)); WAE:RegisterModel( "models/weapons/w_snip_m14sp.mdl", "ValveBiped.Bip01_Spine", Vector(-2.5, 4, 5), Angle(-150, -180, -80)); WAE:RegisterModel( "models/weapons/w_tct_famas.mdl", "ValveBiped.Bip01_Spine", Vector(-2.5, 4, 5), Angle(-150, -180, -80)); WAE:RegisterModel( "models/weapons/w_colt_python.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-6.5, -2, -1), Angle(-100, -180, -50)); WAE:RegisterModel( "models/weapons/w_m29_satan.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-6.5, -2, -1), Angle(-100, -180, -80)); WAE:RegisterModel( "models/weapons/w_model_3_rus.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-6.5, -2, -1), Angle(-100, -180, -80)); WAE:RegisterModel( "models/weapons/w_remington_1858.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-6.5, -2, -1), Angle(-100, -180, -80)); WAE:RegisterModel( "models/weapons/w_sw_model_500.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-6.5, -2, -1), Angle(-100, -180, -80)); WAE:RegisterModel( "models/weapons/w_sw_model_627.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-6.5, -2, -1), Angle(-100, -180, -80)); WAE:RegisterModel( "models/weapons/w_taurus_raging_bull.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-6.5, -2, -1), Angle(-100, -180, -80)); WAE:RegisterModel( "models/weapons/w_raging_bull_scoped.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-3, 1, -2), Angle(-100, -180, 180)); WAE:RegisterModel( "models/weapons/w_dmg_glock.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-3, 1, 5), Angle(-100, -180, 98)); WAE:RegisterModel( "models/weapons/w_pist_fokkususp.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-3, 1, 5), Angle(-100, -180, -95)); WAE:RegisterModel( "models/weapons/w_tcom_deagle.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-3, 1, 5), Angle(-100, -180, 98)); WAE:RegisterModel( "models/weapons/s_dmgf_co1911.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-3, 1, 5), Angle(-100, -180, 98)); WAE:RegisterModel( "models/weapons/w_hk45c.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-4.19, -2, 0.50), Angle(-100, -180, -95)); WAE:RegisterModel( "models/weapons/w_sig_229r.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-4.19, -2, 0.50), Angle(-100, -180, -95)); WAE:RegisterModel( "models/weapons/w_beretta_m92.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-4.19, -2, 0.50), Angle(-100, -180, -95)); WAE:RegisterModel( "models/weapons/w_luger_p08.mdl", "ValveBiped.Bip01_R_Thigh", Vector(-4.19, -2, 0.50), Angle(-100, -180, -95)); [/code] Thanks for the script btw[/QUOTE] hey thanks a lot! I really appreciate that because as you now know, adjusting those positions and stuff is the most boring thing in the fuckin world. I'll update the release and put you in the credits. OP Updated with new version.
[QUOTE=LauScript;42841530]hey thanks a lot! I really appreciate that because as you now know, adjusting those positions and stuff is the most boring thing in the fuckin world. I'll update the release and put you in the credits. OP Updated with new version.[/QUOTE] No problems man and yer it is hella boring i had a sleep when i was done hahaha Also i missed 3 guns [code] WAE:RegisterModel( "models/weapons/w_dmg_m16ag.mdl", "ValveBiped.Bip01_Spine", Vector(-2.5, 4, 5), Angle(-150, -180, -80)); WAE:RegisterModel( "models/weapons/w_dmg_vikhr.mdl", "ValveBiped.Bip01_Spine", Vector(-2.5, 4, 5), Angle(-150, -180, -80)); WAE:RegisterModel( "models/weapons/w_intratec_tec9.mdl", "ValveBiped.Bip01_Spine", Vector(-2.5, 4, 5), Angle(-150, -180, -80)); [/code]
Thanks for the script, both of you! Mind if I use it in my gamemode with credit?
[QUOTE=-Natekit-;42846899]Thanks for the script, both of you! Mind if I use it in my gamemode with credit?[/QUOTE] Please, do :)
Since I have a running thing going with your threads and a semi-colon allergy, [URL="http://filesmelt.com/dl/Weapon_attachment_extension_V2_nsc2.rar"]here[/URL] is a no semi colon version.
[QUOTE=KillerLUA;42864661]Since I have a running thing going with your threads and a semi-colon allergy, [URL="http://filesmelt.com/dl/Weapon_attachment_extension_V2_nsc2.rar"]here[/URL] is a no semi colon version.[/QUOTE] omg
Well, I added the DarkRP weapons (partial CSS weapons) to this. This will work on all DarkRP weapons, as well as anything (including vanilla) that uses the CSS models for the pump shotty, AK-47, M4A1, Mac10, Glock, P228, Five-Seven or MP5. Here's the DIY guide to add them yourself. It's very easy. Firstly, modify [B]lua/autorun/server/sv_weaponattachments.lua[/B], by going to the line [CODE]WAE.blacklist = { "weapon_physcannon", "weapon_physgun", "gmod_tool", "gmod_camera" };[/CODE] and replacing it with [CODE]WAE.blacklist = { "weapon_physcannon", "weapon_physgun", "gmod_tool", "gmod_camera", "weapon_keypadchecker", "door_ram", "weaponchecker", "keys", "pocket", "arrest_stick", "unarrest_stick" };[/CODE] This excludes the weapons that really aren't weapons, and the door ram that gets in the way too much. Secondly, scroll down and add this just above the M9K lines [CODE]--DarkRP Weapons WAE:RegisterModel( "models/weapons/w_pist_deagle.mdl", "ValveBiped.Bip01_Pelvis", Vector(-4.19, 0, -8.54), Angle(-180, 180, 90)); WAE:RegisterModel( "models/weapons/w_pist_fiveseven.mdl", "ValveBiped.Bip01_Pelvis", Vector(-4.19, 0, -8.54), Angle(-180, 180, 90)); WAE:RegisterModel( "models/weapons/w_pist_glock18.mdl", "ValveBiped.Bip01_Pelvis", Vector(-4.19, 0, -8.54), Angle(-180, 180, 90)); WAE:RegisterModel( "models/weapons/w_pist_p228.mdl", "ValveBiped.Bip01_Pelvis", Vector(-4.19, 0, -8.54), Angle(-180, 180, 90)); WAE:RegisterModel( "models/weapons/w_smg_mp5.mdl", "ValveBiped.Bip01_Pelvis", Vector(-4.19, 0, -8.54), Angle(-180, 180, 90)); WAE:RegisterModel( "models/weapons/w_smg_mac10.mdl", "ValveBiped.Bip01_Pelvis", Vector(-4.19, 0, -8.54), Angle(-180, 180, 90)); WAE:RegisterModel( "models/weapons/w_rif_ak47.mdl", "ValveBiped.Bip01_Spine", Vector(-3.96, 4.95, 5), Angle(0,0,0)); WAE:RegisterModel( "models/weapons/w_rif_m4a1.mdl", "ValveBiped.Bip01_Spine", Vector(-3.96, 4.95, 6), Angle(0,0,0)); WAE:RegisterModel( "models/weapons/w_shot_m3super90.mdl", "ValveBiped.Bip01_Spine", Vector(-3.96, 4.95, 6), Angle(0,0,0));[/CODE] Enjoy! This works great for RP servers for obvious reasons. :)
[QUOTE=Hashspy;42999885]Well, I added the DarkRP weapons (partial CSS weapons) to this. This will work on all DarkRP weapons, as well as anything (including vanilla) that uses the CSS models for the pump shotty, AK-47, M4A1, Mac10, Glock, P228, Five-Seven or MP5. Here's the DIY guide to add them yourself. It's very easy. Firstly, modify [B]lua/autorun/server/sv_weaponattachments.lua[/B], by going to the line [CODE]WAE.blacklist = { "weapon_physcannon", "weapon_physgun", "gmod_tool", "gmod_camera" };[/CODE] and replacing it with [CODE]WAE.blacklist = { "weapon_physcannon", "weapon_physgun", "gmod_tool", "gmod_camera", "weapon_keypadchecker", "door_ram", "weaponchecker", "keys", "pocket", "arrest_stick", "unarrest_stick" };[/CODE] This excludes the weapons that really aren't weapons, and the door ram that gets in the way too much. Secondly, scroll down and add this just above the M9K lines [CODE]--DarkRP Weapons WAE:RegisterModel( "models/weapons/w_pist_deagle.mdl", "ValveBiped.Bip01_Pelvis", Vector(-4.19, 0, -8.54), Angle(-180, 180, 90)); WAE:RegisterModel( "models/weapons/w_pist_fiveseven.mdl", "ValveBiped.Bip01_Pelvis", Vector(-4.19, 0, -8.54), Angle(-180, 180, 90)); WAE:RegisterModel( "models/weapons/w_pist_glock18.mdl", "ValveBiped.Bip01_Pelvis", Vector(-4.19, 0, -8.54), Angle(-180, 180, 90)); WAE:RegisterModel( "models/weapons/w_pist_p228.mdl", "ValveBiped.Bip01_Pelvis", Vector(-4.19, 0, -8.54), Angle(-180, 180, 90)); WAE:RegisterModel( "models/weapons/w_smg_mp5.mdl", "ValveBiped.Bip01_Pelvis", Vector(-4.19, 0, -8.54), Angle(-180, 180, 90)); WAE:RegisterModel( "models/weapons/w_smg_mac10.mdl", "ValveBiped.Bip01_Pelvis", Vector(-4.19, 0, -8.54), Angle(-180, 180, 90)); WAE:RegisterModel( "models/weapons/w_rif_ak47.mdl", "ValveBiped.Bip01_Spine", Vector(-3.96, 4.95, 5), Angle(0,0,0)); WAE:RegisterModel( "models/weapons/w_rif_m4a1.mdl", "ValveBiped.Bip01_Spine", Vector(-3.96, 4.95, 6), Angle(0,0,0)); WAE:RegisterModel( "models/weapons/w_shot_m3super90.mdl", "ValveBiped.Bip01_Spine", Vector(-3.96, 4.95, 6), Angle(0,0,0));[/CODE] Enjoy! This works great for RP servers for obvious reasons. :)[/QUOTE] Good looks
This look great, can anyone confirm if it works for ttt?
link broken :C anyone have this file?
Link broken :(
Any One can send the addon or fix the link ? If you cant i can upload it on mediafire if you want me too ...
Hi. If you want to use this script, it will have to be ported from the version I made for NutScript which can be accessed from NutScripts Git. [url]https://github.com/Chessnut/NutScript/tree/a5746b39fb2dd45f696ff630c961d700f658dd2f/plugins/attachments[/url] Maybe on a rainy day i'll do the port myself and re-release both extension addons, but seeing as I don't really play Garry's Mod at all anymore, it isn't a gaurantee.
Sorry, you need to Log In to post a reply to this thread.