Garry's Mod

Garry's Mod

Not enough ratings
[TFA] Random Attachments
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
8.547 KB
15 Feb, 2021 @ 8:55am
15 Feb, 2021 @ 4:19pm
4 Change Notes ( view )

Subscribe to download
[TFA] Random Attachments

In 3 collections by DevilsThumb
LDTNE - TTT Server - Weapons TFA
8 items
Testing 1
20 items
LDTNE - minimal TTT - Nice to have
53 items
Description
Overview
This modification is an extension to TFA Base [ Reduxed ]. Random attachments are selected at weapon spawn for all TFA weapons that have attachment support.



Attention!
This is a very early version that may still be very buggy.
The mod has been tested with the TFA Weapon Packs: [TFA][AT] Battlefield 3 Weapon Pack and [TFA][AT]MWR Weapon Packs so far.

The modification was only tested in the game mode TTT2, but in principle it should also be possible to use it in other game modes.
If certain categories of attachments are not taken into account, please indicate the corresponding weapon pack in the comments and I will add support for it.


Description
There are different categories of attachments that can be available to the weapons: Scopes, Muzzle Modifications, Grips, Magazines, Ammunition, ...
With a certain probability, one of the available attachments of a category is selected. The probability per category can be adjusted in the convars.

The modification is originally intended for use in TTT2 to provide different variations of weapons on the map. It is recommended to deny the player the ability to customise the attachments afterwards. For this purpose the TFA Base Convar can be set to 0.
sv_tfa_attachments_enabled 0 // [0,1] (def.: 1) Disables attachment selection for clients.


Configuration
The basic convars of the modification:
sv_tfa_ra_enabled 1 // [0,1] (def.: 1) Enables random attachments at weapon spawn sv_tfa_ra_debug 0 // [0,1] (def.: 0) Enables printout of all weapons with selected attachments in the console (this may cause your client to crash at the start of a new round).

The Convars to adjust the probability for each category:
sv_tfa_ra_scope_prob 0.8 // [0-1] (def.: 0.8) Probability that the rifle has a scope. sv_tfa_ra_grip_prob 0.3 // [0-1] (def.: 0.3) Probability that the rifle has a grip. sv_tfa_ra_barrel_prob 0.3 // [0-1] (def.: 0.3) Probability that the rifle has a muzzle attachment. sv_tfa_ra_light_prob 0.3 // [0-1] (def.: 0.3) Probability that the rifle has a light attachment. sv_tfa_ra_magazine_prob 0.0 // [0-1] (def.: 0.0) Probability that the rifle has a magazine modification. sv_tfa_ra_ammo_prob 0.0 // [0-1] (def.: 0.0) Probability that the rifle has a ammunation modification.


Works well with
In combination with the TTT/TTT2 gamemode and this script, the modification TTT entity replacer by Jason is also recommended. This allows you to replace any weapon at the beginning of a round. This is very helpful to replace the unwanted TTT default weapons with a set of predefined TFA arms. Multiple assignments for one weapon are possible with different weightings.
4 Comments
Lombaxtard 26 Sep, 2021 @ 1:38pm 
AK-103, AK-400, AKM Tactical, AN-94, Remington M24 SWS and more have this problem for sure.
I have MWR Shared Pack (not sure if it adds any attachments though), Blitz Sight Pack and Yanky's Sight Extension Pack.
Lombaxtard 23 Sep, 2021 @ 9:34am 
Well, quite a lot, actually. Here's a part of the list: [TFA] [AT]:
BR-99
Dragunov SVU
Fiveseven
GSH-18
IMI Uzi
Kar98K
MK-12
P320
SR-25
SV-98
Type-81
AK-103
AK-400
AKM Tactical
AN-94 Abakan
AR-15
AR-57
AUG A3
Benelli Nova Tactical
CZ 805 Bren

From what I could tell it's more frequent when spawning sniper rifles, probably something with long-range scopes... Can't really tell, I have these in the loot list for environmental loot spawning system. But don't worry, that issue is still there when manually spawning weapons, it's just that I hadn't much time testing it to specifically find the ones causing this issue. I'll try to do that in the meantime and will tell you again which weapons have this issue. Thanks for your support!
DevilsThumb  [author] 23 Sep, 2021 @ 6:31am 
Thanks a lot for mentioning that, I didn't notice that so far.
Could you specify what weapon packs and sight packs you are using so I can look into this.
Lombaxtard 19 Sep, 2021 @ 3:39pm 
Sometimes on weapon spawn there's a loud "access denied" type of sound played, as if some attachment had failed to install