StructuredDataDef Asset: Difference between revisions

From COD Engine Research
No edit summary
No edit summary
Line 49: Line 49:
};
};


#pragma pack(push,4)
struct StructureEntry
struct StructureEntry
{
{
   const char *name;
#ifdef IW6 // if it is Ghosts..
   ScriptString name;
#endif
   DataType type;
   DataType type;
   TypeData data;
   TypeData data;
Line 59: Line 62:
#endif
#endif
};
};
#pragma pack(pop)


struct DefinedStructure
struct DefinedStructure

Revision as of 04:58, 13 January 2014

The structureddatadef asset stores information for data structures and enums used by the game. This asset is only used on Modern Warfare 2, Modern Warfare 3, and Ghosts.

enum DataType
{
  STRUCTURED_DATA_INT = 0,
  STRUCTURED_DATA_BYTE = 1,
  STRUCTURED_DATA_BOOL = 2,
  STRUCTURED_DATA_STRING = 3,
  STRUCTURED_DATA_ENUM = 4,
  STRUCTURED_DATA_STRUCT = 5,
  STRUCTURED_DATA_INDEXEDARR = 6,
  STRUCTURED_DATA_ENUMARR = 7,
  STRUCTURED_DATA_FLOAT = 8,
  STRUCTURED_DATA_SHORT = 9
};

struct EnumEntry
{
#ifdef IW6 // if it is Ghosts..
  ScriptString name;
  unsigned __int16 index;
#else
  const char *name;
  unsigned __int16 index;
  unsigned __int16 unused;
#endif
};

struct DefinedEnum
{
  int entryCount;
  int unknown;
  EnumEntry *entries;
};

union TypeData
{
  int integer;
  int stringSize;
  int flags;
  int enumIndex;
  int enumArrIndex;
  int indexedArrIndex;
  int structIndex;
};

#pragma pack(push,4)
struct StructureEntry
{
#ifdef IW6 // if it is Ghosts..
  ScriptString name;
#endif
  DataType type;
  TypeData data;
  int index;
#ifndef IW4 // if not Modern Warfare 2..
  int unknown;
#endif
};
#pragma pack(pop)

struct DefinedStructure
{
  int entryCount;
  StructureEntry *entries;
  int size;
  int unknown;
};

struct DefinedIndexedArray
{
  int numItems;
  DataType type;
  TypeData data;
  int size;
};

struct DefinedEnumArray
{
  int enumIndex;
  DataType type;
  TypeData data;
  int size;
};

struct StructuredData
{
  int version;
  int hash;
  int enumCount;
  DefinedEnum *enums;
  int structureCount;
  DefinedStructure *structures;
  int indexedArrCount;
  DefinedIndexedArray *indexedArrays;
  int enumArrayCount;
  DefinedEnumArray *enumArrays;
  int unknown1;
  int unknown2;
  int unknown3;
};

struct StructuredDataDef
{
  const char *name;
  int numEntries;
  StructuredData *entries;
};