Attachment Asset (BO2)

From COD Engine Research
Jump to: navigation, search

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 eAttachment
{
  ATTACHMENT_NONE = 0x0,
  ATTACHMENT_ACOG = 0x1,
  ATTACHMENT_DUALCLIP = 0x2,
  ATTACHMENT_DUALOPTIC = 0x3,
  ATTACHMENT_DW = 0x4,
  ATTACHMENT_EXTBARREL = 0x5,
  ATTACHMENT_EXTCLIP = 0x6,
  ATTACHMENT_EXTRAMAGS = 0x7,
  ATTACHMENT_FASTADS = 0x8,
  ATTACHMENT_FASTRELOAD = 0x9,
  ATTACHMENT_FMJ = 0xA,
  ATTACHMENT_GL = 0xB,
  ATTACHMENT_GRIP = 0xC,
  ATTACHMENT_HOLO = 0xD,
  ATTACHMENT_IR = 0xE,
  ATTACHMENT_IRONSIGHTS = 0xF,
  ATTACHMENT_LONGBREATH = 0x10,
  ATTACHMENT_MK = 0x11,
  ATTACHMENT_MMS = 0x12,
  ATTACHMENT_RANGEFINDER = 0x13,
  ATTACHMENT_REFLEX = 0x14,
  ATTACHMENT_RF = 0x15,
  ATTACHMENT_SELECTFIRE = 0x16,
  ATTACHMENT_SILENCER = 0x17,
  ATTACHMENT_STACKFIRE = 0x18,
  ATTACHMENT_STALKER = 0x19,
  ATTACHMENT_STEADYAIM = 0x1A,
  ATTACHMENT_SWAYREDUC = 0x1B,
  ATTACHMENT_TACKNIFE = 0x1C,
  ATTACHMENT_VZOOM = 0x1D,
  ATTACHMENT_TYPE_COUNT = 0x1E,
  ATTACHMENT_INVALID = 0x1E,
};
 
enum eAttachmentPoint
{
  ATTACHMENT_POINT_NONE = 0x0,
  ATTACHMENT_POINT_TOP = 0x1,
  ATTACHMENT_POINT_FIRST = 0x1,
  ATTACHMENT_POINT_BOTTOM = 0x2,
  ATTACHMENT_POINT_TRIGGER = 0x3,
  ATTACHMENT_POINT_MUZZLE = 0x4,
  ATTACHMENT_POINT_GUNPERK = 0x5,
  ATTACHMENT_POINT_COUNT = 0x6,
  ATTACHMENT_POINT_INVALID = 0x6,
};
 
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;
  eAttachment attachmentType;
  eAttachmentPoint attachmentPoint;
  PenetrateType penetrateType;
  weapFireType_t fireType;
  int firstRaisePriority;
  float fHipIdleAmount;
  bool bAltWeaponAdsOnly;
  bool bAltWeaponDisableSwitching;
  int altScopeADSTransInTime;
  int altScopeADSTransOutTime;
  bool bSilenced;
  bool bDualMag;
  bool laserSight;
  bool bInfraRed;
  bool bUseAsMelee;
  bool bDualWield;
  bool sharedAmmo;
  float fDamageRangeScale;
  float fAdsZoomFov[3];
  float fAdsZoomInFrac;
  float fAdsZoomOutFrac;
  float fAdsTransInTimeScale;
  float fAdsTransOutTimeScale;
  float fAdsRecoilReductionRate;
  float fAdsRecoilReductionLimit;
  float fAdsViewKickCenterSpeedScale;
  float fAdsIdleAmountScale;
  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 fAdsSwayHorizScale;
  float fAdsSwayVertScale;
  float adsMoveSpeedScale;
  float fHipSpreadMinScale;
  float fHipSpreadMaxScale;
  float strafeRotR;
  float standMoveF;
  vec3_t vStandRot;
  float fFireTimeScale;
  float fReloadTimeScale;
  float fReloadEmptyTimeScale;
  float fReloadAddTimeScale;
  float fReloadQuickTimeScale;
  float fReloadQuickEmptyTimeScale;
  float fReloadQuickAddTimeScale;
  bool mmsWeapon;
  bool mmsInScope;
  float mmsFOV;
  float mmsAspect;
  float mmsMaxDist;
  float clipSizeScale;
  int iClipSize;
  unsigned int stackFire;
  float stackFireSpread;
  float stackFireAccuracyDecay;
  unsigned int perks[2];
  float customFloat[3];
  __declspec(align(4)) bool customBool0;
  __declspec(align(4)) bool customBool1;
  __declspec(align(4)) bool customBool2;
};

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.