Attachment Asset (AW)
The attachment asset was added on Modern Warfare 3 and has been on every Call of Duty since (Black Ops 2, Ghosts and Advanced Warfare). This asset saves alot of space as previously a different weapon asset was required for each combination of attachments on each weapon. Notice that Advanced Warfare has vastly simplified this asset as opposed to Ghosts.
union unknownAttachmentUnion1
{
//If type 0, always ERROR
char (*unknown1)[4]; //Use ERROR instead, not used. Go here if type is 4,5,6,9
char * unknownString; //Go here if type isn't one of the other two qualifiers.
char (*unknown2)[4]; //Go here if type is 7 or 8
};
struct unknownAttachmentDefStruct1
{
char type;
unknownAttachmentUnion1 data;
}
struct AttachmentDef
{
const char * name;
const char * displayName;
char unknown1[0x10];
XModel * * worldModel; //2 pointers
XModel * *gunXModel; //2 pointers
XModel * *reticleXModel; //0x20 pointers
char (*unknown2)[0x1C];
char (*unknown3)[0x48];
char *unknown4; //Size = unknownCount1 << 1
unknownAttachmentDefStruct1 *unknownStruct1;//Count = unknownCount1
int unknownCount1;
char unknown11[0x18];
};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.