Attachment Asset (BO2): Difference between revisions

From COD Engine Research
Created page with "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 ..."
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
__NOTOC__
[[Category:Assets]]
[[Category: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.
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.
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
enum AttachmentTypes_e
enum eAttachment
{
{
   none_ATTACH,
   ATTACHMENT_NONE = 0x0,
   acog,
   ATTACHMENT_ACOG = 0x1,
   dualclip,
   ATTACHMENT_DUALCLIP = 0x2,
   dualoptic,
   ATTACHMENT_DUALOPTIC = 0x3,
   dw,
   ATTACHMENT_DW = 0x4,
   extbarrel,
   ATTACHMENT_EXTBARREL = 0x5,
   extclip,
   ATTACHMENT_EXTCLIP = 0x6,
   extramags,
   ATTACHMENT_EXTRAMAGS = 0x7,
   fastads,
   ATTACHMENT_FASTADS = 0x8,
   fastreload,
   ATTACHMENT_FASTRELOAD = 0x9,
   fmj,
   ATTACHMENT_FMJ = 0xA,
   gl,
   ATTACHMENT_GL = 0xB,
   grip,
   ATTACHMENT_GRIP = 0xC,
   holo,
   ATTACHMENT_HOLO = 0xD,
   ir,
   ATTACHMENT_IR = 0xE,
   is,
   ATTACHMENT_IRONSIGHTS = 0xF,
   longbreath,
   ATTACHMENT_LONGBREATH = 0x10,
   mk,
   ATTACHMENT_MK = 0x11,
   mms,
   ATTACHMENT_MMS = 0x12,
   rangefinder,
   ATTACHMENT_RANGEFINDER = 0x13,
   reflex,
   ATTACHMENT_REFLEX = 0x14,
   rf,
   ATTACHMENT_RF = 0x15,
   sf,
   ATTACHMENT_SELECTFIRE = 0x16,
   silencer,
   ATTACHMENT_SILENCER = 0x17,
   stackfire,
   ATTACHMENT_STACKFIRE = 0x18,
   stalker,
   ATTACHMENT_STALKER = 0x19,
   steadyaim,
   ATTACHMENT_STEADYAIM = 0x1A,
   swayreduc,
   ATTACHMENT_SWAYREDUC = 0x1B,
   tacknife,
   ATTACHMENT_TACKNIFE = 0x1C,
   vzoom,
   ATTACHMENT_VZOOM = 0x1D,
   ATTACHMENTTYPES_MAX
   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,
};
};


Line 64: Line 81:
   const char * name;
   const char * name;
   const char * szDisplayName;
   const char * szDisplayName;
   AttachmentTypes_e attachmentType;
   eAttachment attachmentType;
      int unknown1;
  eAttachmentPoint attachmentPoint;
   PenetrateType penetrateType;
   PenetrateType penetrateType;
   weapFireType_t fireType;
   weapFireType_t fireType;
   int firstRaisePriority;
   int firstRaisePriority;
   float hipIdleAmount;
   float fHipIdleAmount;
   bool altWeaponAdsOnly;
   bool bAltWeaponAdsOnly;
   bool altWeaponDisableSwitching;
   bool bAltWeaponDisableSwitching;
   int altScopeADSTransInTime;
   int altScopeADSTransInTime;
   int altScopeADSTransOutTime;
   int altScopeADSTransOutTime;
   bool silenced;
   bool bSilenced;
   bool dualMag;
   bool bDualMag;
   bool laserSight;
   bool laserSight;
   bool infrared;
   bool bInfraRed;
   bool useAsMelee;
   bool bUseAsMelee;
   bool dualWield;
   bool bDualWield;
   bool sharedAmmo;
   bool sharedAmmo;
   float damageRangeScale;
   float fDamageRangeScale;
   float adsZoomFov[3];
   float fAdsZoomFov[3];
   float adsZoomInFrac;
   float fAdsZoomInFrac;
   float adsZoomOutFrac;
   float fAdsZoomOutFrac;
   float adsTransInTimeScale;
   float fAdsTransInTimeScale;
   float adsTransOutTimeScale;
   float fAdsTransOutTimeScale;
   float adsRecoilReductionRate;
   float fAdsRecoilReductionRate;
   float adsRecoilReductionLimit;
   float fAdsRecoilReductionLimit;
   float adsViewKickCenterSpeedScale;
   float fAdsViewKickCenterSpeedScale;
   float adsIdleAmountScale;
   float fAdsIdleAmountScale;
   bool swayOverride;
   bool swayOverride;
   float swayMaxAngle;
   float swayMaxAngle;
Line 103: Line 120:
   float adsSwayPitchScale;
   float adsSwayPitchScale;
   float adsSwayYawScale;
   float adsSwayYawScale;
   float adsSwayHorizScale;
   float fAdsSwayHorizScale;
   float adsSwayVertScale;
   float fAdsSwayVertScale;
   float adsMoveSpeedScale;
   float adsMoveSpeedScale;
   float hipSpreadMinScale;
   float fHipSpreadMinScale;
   float hipSpreadMaxScale;
   float fHipSpreadMaxScale;
   float strafeRotR;
   float strafeRotR;
   float standMoveF;
   float standMoveF;
   float standRot[3];
   vec3_t vStandRot;
   float fireTimeScale;
   float fFireTimeScale;
   float reloadTimeScale;
   float fReloadTimeScale;
   float reloadEmptyTimeScale;
   float fReloadEmptyTimeScale;
   float reloadAddTimeScale;
   float fReloadAddTimeScale;
   float reloadQuickTimeScale;
   float fReloadQuickTimeScale;
   float reloadQuickEmptyTimeScale;
   float fReloadQuickEmptyTimeScale;
   float reloadQuickAddTimeScale;
   float fReloadQuickAddTimeScale;
   bool mmsWeapon;
   bool mmsWeapon;
   bool mmsInScope;
   bool mmsInScope;
Line 124: Line 141:
   float mmsMaxDist;
   float mmsMaxDist;
   float clipSizeScale;
   float clipSizeScale;
   int clipSize;
   int iClipSize;
   float stackFire;
   unsigned int stackFire;
   float stackFireSpread;
   float stackFireSpread;
   float stackFireAccuracyDecay;
   float stackFireAccuracyDecay;
   int perks[2];
   unsigned int perks[2];
   float customFloat[3];
   float customFloat[3];
   int customBool[3];
   __declspec(align(4)) bool customBool0;
  __declspec(align(4)) bool customBool1;
  __declspec(align(4)) bool customBool2;
};
};
</syntaxhighlight>
</syntaxhighlight>
== Source Format ==
== 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.
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.

Latest revision as of 23:58, 20 December 2014

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.