Attachment Asset (BO2)
The attachment asset was added on Modern Warfare 3 and has been on every Call of Duty since (Black Ops 2 and Ghosts). This asset saves alot of space as previously a different weapon asset was required for each combination of attachments on each weapon.
enum AttachmentTypes_e
{
none_ATTACH,
acog,
dualclip,
dualoptic,
dw,
extbarrel,
extclip,
extramags,
fastads,
fastreload,
fmj,
gl,
grip,
holo,
ir,
is,
longbreath,
mk,
mms,
rangefinder,
reflex,
rf,
sf,
silencer,
stackfire,
stalker,
steadyaim,
swayreduc,
tacknife,
vzoom,
ATTACHMENTTYPES_MAX
};
enum PenetrateType : int
{
PENETRATE_TYPE_NONE = 0,
PENETRATE_TYPE_SMALL = 1,
PENETRATE_TYPE_MEDIUM = 2,
PENETRATE_TYPE_LARGE = 3,
PENETRATE_TYPE_MAX
};
enum weapFireType_t : int
{
WEAPON_FIRETYPE_FULLAUTO = 0,
WEAPON_FIRETYPE_SINGLESHOT = 1,
WEAPON_FIRETYPE_2ROUNDBURST = 2,
WEAPON_FIRETYPE_3ROUNDBURST = 3,
WEAPON_FIRETYPE_4ROUNDBURST = 4,
WEAPON_FIRETYPE_5ROUNDBURST = 5,
WEAPON_FIRETYPE_STACKEDFIRE = 6,
WEAPON_FIRETYPE_MINIGUN = 7,
WEAPON_FIRETYPE_CHARGESHOT = 8,
WEAPON_FIRETYPE_JETGUN = 9,
WEAPON_FIRETYPE_MAX
};
struct WeaponAttachment
{
const char * name;
const char * szDisplayName;
AttachmentTypes_e attachmentType;
int unknown1;
PenetrateType penetrateType;
weapFireType_t fireType;
int firstRaisePriority;
float hipIdleAmount;
bool altWeaponAdsOnly;
bool altWeaponDisableSwitching;
int altScopeADSTransInTime;
int altScopeADSTransOutTime;
bool silenced;
bool dualMag;
bool laserSight;
bool infrared;
bool useAsMelee;
bool dualWield;
bool sharedAmmo;
float damageRangeScale;
float adsZoomFov[3];
float adsZoomInFrac;
float adsZoomOutFrac;
float adsTransInTimeScale;
float adsTransOutTimeScale;
float adsRecoilReductionRate;
float adsRecoilReductionLimit;
float adsViewKickCenterSpeedScale;
float adsIdleAmountScale;
bool swayOverride;
float swayMaxAngle;
float swayLerpSpeed;
float swayPitchScale;
float swayYawScale;
float swayHorizScale;
float swayVertScale;
bool adsSwayOverride;
float adsSwayMaxAngle;
float adsSwayLerpSpeed;
float adsSwayPitchScale;
float adsSwayYawScale;
float adsSwayHorizScale;
float adsSwayVertScale;
float adsMoveSpeedScale;
float hipSpreadMinScale;
float hipSpreadMaxScale;
float strafeRotR;
float standMoveF;
float standRot[3];
float fireTimeScale;
float reloadTimeScale;
float reloadEmptyTimeScale;
float reloadAddTimeScale;
float reloadQuickTimeScale;
float reloadQuickEmptyTimeScale;
float reloadQuickAddTimeScale;
bool mmsWeapon;
bool mmsInScope;
float mmsFOV;
float mmsAspect;
float mmsMaxDist;
float clipSizeScale;
int clipSize;
float stackFire;
float stackFireSpread;
float stackFireAccuracyDecay;
int perks[2];
float customFloat[3];
int customBool[3];
};Source Format
There is currently no known source format for the attachment asset. The currently accepted one is extensionless raw text files located at "raw/attachment/" that contain the setting names and new values seperated by backslashes. The first entry identifies the file and for attachments, "ATTACHMENTFILE" is used.