No More Room in Hell

No More Room in Hell

52 ratings
Weapon Attachment Mod Base
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
122.971 MB
May 10, 2024 @ 11:26am
May 8 @ 2:32am
16 Change Notes ( view )

Subscribe to download
Weapon Attachment Mod Base

Description
Attachments are items one could pick up, and to be mounted on guns to grant stats change.
To mount an attachment on a gun, pick up the attachment. Click the icon of the attachments on radial inventory while equipping the gun you want to mount the thing on. You will see the attachment's label changed to reflect the gun's name it's mounted on (Eg. "Muzzle Brake [fa_m16a4"], and if you have enabled model override cvar you will see corresponding viewmodel changed as well.

This is the base mod for any map/mutator that features weapon attachments.

Attachment Types
Choke: Boosts weapon damage while costing stamina, also makes every shot stagger;
Muzzle brake: Boosts rate of fire while reducing weapon damage;
Grip: Boosts reload speed;
Drum mag: When attached to a gun, the gun directly consumes ammo from inventory while shooting, removing the need to reload till all ammo is depleted. (Requires at least 1 bullet loaded to shoot);
Scope: Adds a scope to see further when ADS, because why not. (Model override needs to be enabled.)

Attachment Compatibility
- Scope cannot be mounted on Jae700, M16 with scope and Sako with scope.
- Muzzle brake can't be mounted if choke has been mounted on.

Mod Compatibility
For your best experience, disable all weapon-model mods (Hand mod, weapon texture mod should be fine) & enable sv_attachment_enable_viewmodel_override. This mod only supports vanilla weapon models.

Although custom weapon models would not break the system, they will result in viewmodel & worldmodel being abruptly reverted to vanilla look upon attaching a mod. If you would like to keep the functionality of attachment but prefer to keep using your custom models, disable sv_attachment_enable_viewmodel_override.

How to spawn weapon attachments in map/mutator
For mappers, add item_custom to your level, in the entity fields specify below. For mutator creators, spawn a item_custom with the following entity key fields:

model -> [model path of the attachment] (Model dictates which attachment this item becomes, choose from list below)
vscript -> "nmo_irradiated/weapon_attachment/attachment.nut" (Do not change)
icon -> [material path of the icon image that appears in inventory] (Choose from list below, or from your custom-made materials)
weight -> [How much space this attachment takes in inventory]

List of available models:
- Choke: models/nmo_irradiated/attachments/shotgun_choke.mdl
- Muzzle brake: models/nmo_irradiated/attachments/muzzlebrake.mdl
- Grip: models/nmo_irradiated/attachments/grip.mdl
- Drum mag: models/nmo_irradiated/attachments/drum_mag.mdl
- Scope: models/nmo_irradiated/attachments/scope_4x.mdl

List of available inventory icons:
- Choke: materials/nmo_irradiated/inv_icon_choke.vmt
- Muzzle brake: materials/nmo_irradiated/inv_icon_muzzlebrake.vmt
- Grip: materials/nmo_irradiated/inv_icon_grip.vmt
- Drum mag: materials/nmo_irradiated/inv_icon_drummag.vmt
- Scope: materials/nmo_irradiated/inv_icon_scope.vmt

Note to map & mutator creators
There need to be one filter_script present in map and assigned to entities that are meant to receive damage mod treatment. For instance, zombies need this filter assigned to them as damagefilter in order for zombies to receive damage boost.

For map creators, place one filter_script in your level and set the vscript field to: "nmo_irradiated/filterscript/attachmentDamageMod.nut". To use the filter_script on zombies, assign its targetname to the damagefilter field of the zombies. The same applies to other entities to opt-in the damage boost, such as breakables, physics objects.

For mutator creators, make sure to include this line "DoIncludeScript("nmo_irradiated/weapon_attachment/attachment_generate_damagefilter.nut", this);" in the mutator initialization script. This will generate a filter_script described above.

Example Usage
Mutator: https://steamcommunity.com/sharedfiles/filedetails/?id=3263056118
Map: There is no example map available publicly yet.

Cvars
sv_attachment_enable_viewmodel_override - Whether to enable viewmodel & worldmodel override; 1 to enable, -1 to disable.
sv_attachment_coexists_with_weapon - When set to 1, dropping weapon from inventory also drops all attachments mounted to it, treating them as one entity; Otherwise, dropping weapon would automatically detach all attachments.
sv_attachment_damage_multiplier_choke - Damage multiplier for choke mod.
sv_attachment_damage_multiplier_muzzlebrake - Damage multiplier for muzzlebrake mod.
sv_attachment_reload_speed_multiplier_grip - Reload speed multiplier for grip mod.

Credits
- Attachment models & textures:
https://steamcommunity.com/sharedfiles/filedetails/?id=2751323984
https://steamcommunity.com/sharedfiles/filedetails/?id=2528829149
20 Comments
Zacko May 28 @ 10:06am 
I never got scope
Merzarime  [author] Sep 1, 2024 @ 8:33am 
@Sir Lord Wololo , multi-drummag issue should be fixed.
Merzarime  [author] Sep 1, 2024 @ 5:54am 
@Scrungus, Took a while, the reload freeze bug should be resolved now. The reason it only occurred in MP was due to the mod only accounts for single player entity in the game, which is an implementation oversight. Fixed now.
Internal Sun Aug 31, 2024 @ 8:37am 
maybe an attachment that's just a lighter duct taped to the gun would work better even though its dumb sounding
Merzarime  [author] Aug 31, 2024 @ 3:23am 
@TheClapper420 No, I attempted implementing flashlight as a mod but it's buggy.
Internal Sun Aug 31, 2024 @ 3:18am 
Is there a flashlight mod?
Sir Lord Wololo Jul 24, 2024 @ 3:04am 
"Is this replicable"
- It's like this in every game where I get 2 drum mags (either lucky drop or console spawned), so I don't need to replicate it specifically.

"did it happen only in MP?"
- It happens to me in solo play.

I'm wondering if there's a mod conflict. Is this possible with any of the files? Either in "Weapon Attachments" or "Weapon Attachment Mod Base"?
Merzarime  [author] Jul 8, 2024 @ 4:37am 
@Sir Lord Wololo, It is supposed to work on multiple weapons if you have drummag on each. Is this replicable or did it happen only in MP?
Scrungus Jul 7, 2024 @ 10:26am 
@Sir Lord Wololo, yeah that happens to me too, but with the grips
Sir Lord Wololo Jul 7, 2024 @ 8:08am 
I found an interesting quirk that I can't tell whether it's a bug or it's intentional.
When you have two Drum mags attached to two separate firearms, only one of them benefits from the Drum mag. Is anyone else experiencing this?