StructuredDataDef Asset: Difference between revisions

From COD Engine Research
mNo edit summary
No edit summary
Line 21: Line 21:
struct EnumEntry
struct EnumEntry
{
{
#ifdef IW6 // if it is Ghosts..
  ScriptString name;
  unsigned __int16 index;
#else
   const char *name;
   const char *name;
   unsigned __int16 index;
   unsigned __int16 index;
   unsigned __int16 unused;
   unsigned __int16 unused;
#endif
};
};


Line 50: Line 55:
   TypeData data;
   TypeData data;
   int index;
   int index;
#ifndef IW4 // if not Modern Warfare 2..
  int unknown;
#endif
};
};



Revision as of 04:49, 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;
};

struct StructureEntry
{
  const char *name;
  DataType type;
  TypeData data;
  int index;
#ifndef IW4 // if not Modern Warfare 2..
  int unknown;
#endif
};

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;
};