Scriptable Asset: Difference between revisions

From COD Engine Research
Created page with "__NOTOC__ Category:Assets Category:Ghosts The scripttable asset was added in Ghosts and despite its name, does not contain a table of scriptfile assets. Instead it app..."
 
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 2: Line 2:
[[Category:Assets]]
[[Category:Assets]]
[[Category:Ghosts]]
[[Category:Ghosts]]
The scripttable asset was added in Ghosts and despite its name, does not contain a table of scriptfile assets. Instead it appears to be a format used to hold some scripting information for models and the collision map. Since it is so new, there is virtually nothing known about it.
[[Category:AW]]
The scriptable asset is used in Ghost and Advanced Warfare. It appears to be a format used to hold some scripting information for models and the collision map. Since it is so new, there is virtually nothing known about it.
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
struct unknownScriptTableStruct1Internal1Internal1UnionStruct6
struct ScriptableEventShakeDef
{
{
   char * unknownString;
   const char *rumbleName;
   char unknown[0x14];
  unsigned __int16 duration;
  unsigned __int16 durationFadeUp;
  unsigned __int16 durationFadeDown;
  unsigned __int16 radius;
  unsigned __int16 exponent;
  unsigned __int16 scaleEarthquake;
  char scalePitch;
  char scaleYaw;
  char scaleRoll;
  char frequencyPitch;
  char frequencyYaw;
  char frequencyRoll;
   char flags;
};
};


struct unknownScriptTableStruct1Internal1Internal1UnionStruct5
struct ScriptableEventSunlightSettingsDef
{
{
   char unknown1[0x10];
   char color[4];
   char * unknownString;
   char transStateStreamIndex;
   char unknown2[4];
   char flags;
  unsigned __int16 intensityScaleMin;
  unsigned __int16 intensityScaleMax;
  unsigned __int16 pitchMin;
  unsigned __int16 pitchMax;
  unsigned __int16 headingMin;
  unsigned __int16 headingMax;
  unsigned __int16 transitionTimeMin;
  unsigned __int16 transitionTimeMax;
};
};


struct unknownScriptTableStruct1Internal1Internal1UnionStruct4
struct ScriptableEventLightSettingsDef
{
{
   XModel * unknownModel;
   char color[4];
   char unknown[8];
  char lightIndexConstIndex;
  char transStateStreamIndex;
  char useColor;
  char useStateTransitionTime;
  unsigned __int16 intensityScaleMin;
  unsigned __int16 intensityScaleMax;
  unsigned __int16 radiusScaleMin;
  unsigned __int16 radiusScaleMax;
  const char *noteworthy;
  unsigned __int16 transitionTimeMin;
   unsigned __int16 transitionTimeMax;
};
};


struct unknownScriptTableStruct1Internal1Internal1UnionStruct3
struct ScriptableEventPhysicsDef
{
{
   char * unknownString;
  XModel *model;
   char unknown[0x10];
  char launchDirX;
   char launchDirY;
   char launchDirZ;
  unsigned __int16 explForceScale;
  unsigned __int16 bulletForceScale;
};
};


struct unknownScriptTableStruct1Internal1Internal1UnionStruct2
struct ScriptableEventHealthDef
{
{
   snd_alias_list_name unknownSound;
   unsigned __int16 amount;
   char unknown[4];
  unsigned __int16 interval;
  unsigned __int16 badPlaceRadius;
   char streamIndex;
};
};


struct unknownScriptTableStruct1Internal1Internal1UnionStruct1
struct ScriptableEventExplodeDef
{
{
   FxEffectDef * unknownFx;
   unsigned __int16 forceMin;
   ScriptString unknownString;
   unsigned __int16 forceMax;
   char unknown[6];
   unsigned __int16 radius;
  unsigned __int16 damageMin;
  unsigned __int16 damageMax;
  bool aiAvoid;
};
};


union unknownScriptTableStruct1Internal1Internal1Union
struct ScriptableEventAnimationDef
{
{
   char (*unknown1)[6];  //If parent->type == 0xA
   const char *animName;
   XModel * unknownModel;//else if == 0
  bool override;
   unknownScriptTableStruct1Internal1Internal1UnionStruct1 * unknownStruct1; //else if == 1
  bool stateful;
   unknownScriptTableStruct1Internal1Internal1UnionStruct2 * unknownStruct2; //else if == 2
  char animEntryIndex;
   unknownScriptTableStruct1Internal1Internal1UnionStruct3 * unknownStruct3; //else if == 3
  char animPlaybackStreamIndex;
   char (*unknown2)[0xC];  //else if == 4
  unsigned __int16 timeOffsetMin;
   char (*unknown3)[8];  //else if == 5
  unsigned __int16 timeOffsetMax;
   unknownScriptTableStruct1Internal1Internal1UnionStruct4 * unknownStruct4; //else if == 6
  unsigned __int16 playbackRateMin;
   unknownScriptTableStruct1Internal1Internal1UnionStruct5 * unknownStruct5; //else if == 7
  unsigned __int16 playbackRateMax;
   char (*unknown4)[0x16]; //else if == 8
  unsigned __int16 blendTime;
   unknownScriptTableStruct1Internal1Internal1UnionStruct6 * unknownStruct6; //else if == 9
};
 
struct ScriptableEventSoundDef
{
  snd_alias_list_t *alias;
  bool looping;
};
 
struct ScriptableEventFxDef
{
  FxEffectDef *handle;
  scr_string_t tagName;
  unsigned __int16 loopTime;
  char loopTimeStreamIndex;
  bool tagUseAngles;
};
 
struct ScriptableEventModelDef
{
  XModel *model;
};
 
struct ScriptableEventStateChangeDef
{
  char targetIndex;
  char delayStreamIndex;
  unsigned __int16 delayMin;
  unsigned __int16 delayMax;
};
 
union ScriptableEventDataUnion
{
  ScriptableEventStateChangeDef stateChange;  //If parent->type == 0xA
   ScriptableEventModelDef setModel;//else if == 0
   ScriptableEventFxDef playFx; //else if == 1
   ScriptableEventSoundDef playSound; //else if == 2
   ScriptableEventAnimationDef playAnim; //else if == 3
   ScriptableEventExplodeDef doExplosion;  //else if == 4
   ScriptableEventHealthDef healthDrain;  //else if == 5
   ScriptableEventPhysicsDef physicsLaunch; //else if == 6
   ScriptableEventLightSettingsDef lightSettings; //else if == 7
   ScriptableEventSunlightSettingsDef sunlightSettings; //else if == 8
   ScriptableEventShakeDef shake; //else if == 9
};
 
enum ScriptableEventType
{
  SCRIPTABLE_EVENT_MODEL = 0x0,
  SCRIPTABLE_EVENT_FX = 0x1,
  SCRIPTABLE_EVENT_SOUND = 0x2,
  SCRIPTABLE_EVENT_ANIMATION = 0x3,
  SCRIPTABLE_EVENT_EXPLODE = 0x4,
  SCRIPTABLE_EVENT_HEALTHDRAIN = 0x5,
  SCRIPTABLE_EVENT_PHYSICSLAUNCH = 0x6,
  SCRIPTABLE_EVENT_LIGHTSETTINGS = 0x7,
  SCRIPTABLE_EVENT_SUNLIGHTSETTINGS = 0x8,
  SCRIPTABLE_EVENT_SHAKE = 0x9,
  SCRIPTABLE_EVENT_STATECHANGE = 0xA,
  SCRIPTABLE_EVENT_COUNT = 0xB,
};
 
struct ScriptableEventDef
{
  ScriptableEventType type;
  ScriptableEventDataUnion data;
};


struct ScriptableStateDef
{
  scr_string_t name;
  scr_string_t tagName;
  ScriptableEventDef *onEnterEvents; // count = onEnterEventCount
  char onEnterEventCount;
  char damageFlags;
  char damageParentTransferRate;
  char damageParentReceiveRate;
  unsigned __int16 maxHealth;
};
struct ScriptablePartDef
{
  ScriptableStateDef *states; // count = stateCount
  scr_string_t name;
  char stateCount;
  char flags;
  char eventStreamTimeRemainIndex;
  char eventStreamNextChangeTimeIndex;
};
struct ScriptableNotetrackFxDef
{
  FxEffectDef *handle;
  scr_string_t tagName;
  bool useAngles;
};
};


struct unknownScriptTableStruct1Internal1Internal1
struct ScriptableNotetrackSoundDef
{
{
   int type;
   snd_alias_list_t *alias;
  unknownScriptTableStruct1Internal1Internal1Union unknownUnion;
};
};


struct unknownScriptTableStruct1Internal1
union ScriptableNotetrackDataUnion
{
{
   ScriptString unknownScriptString1;
   ScriptableNotetrackFxDef playFx;
   ScriptString unknownScriptString2;
   ScriptableNotetrackSoundDef playSound;
  unknownScriptTableStruct1Internal1Internal1 * unknownStructArray; //Count = unknownCount1;
  byte unknownCount1;
  char unknown[7];
};
};


struct unknownScriptTableStruct1
enum ScriptableNotetrackType
{
{
   unknownScriptTableStruct1Internal1 * unkownStructArray; //Count = unknownCount
   SCRIPTABLE_NT_FX = 0x0,
   ScriptString unknownScriptString;
   SCRIPTABLE_NT_SOUND = 0x1,
   unsigned short unknownCount;
   SCRIPTABLE_NT_COUNT = 0x2,
  int unknown;
};
};


struct unknownScriptTableStruct2Internal1
struct ScriptableNotetrackDef
{
{
   FxEffectDef * unknownFx;
   scr_string_t name;
   ScriptString unknownScriptString;
   ScriptableNotetrackType type;
  ScriptableNotetrackDataUnion data;
};
};


struct unknownScriptTableStruct2
/* ScriptableDef->type */
enum ScriptableType
{
{
   ScriptString unknownScriptString;
   SCRIPTABLE_TYPE_GENERAL = 0x0,
   int type;
   SCRIPTABLE_TYPE_CHARACTER = 0x1,
   union {
   SCRIPTABLE_TYPE_COUNT = 0x2,
      snd_alias_list_name unknownSound; //if type == 0
      unknownScriptTableSTruct2Internal1 unknownStruct; //else if == 1
  };
};
};


struct ScriptTable
struct Scriptable
{
{
   const char * name;
   const char *name;
   XModel * unknownModel1;
   XModel *baseModel;
   char * unknownString1;
   const char *baseCollisionBrush;
   char * unknownString2;
   const char *destroyedCollisionBrush;
   unknownScriptTableStruct1 * unknownStructArray1; //count = unknownCount1
   ScriptablePartDef *parts; //count = partCount
   unknownScriptTableStruct2 * unknownStructArray2; //count = unknownCount1
   ScriptableNotetrackDef *notetracks; //count = notetrackCount
   char unknown2[5];
  ScriptableType type;
   byte unknownCount1;
   char flags;
   char unknown1[2];
   byte partCount;
   byte unknownCount2;
   char serverInstancePartCount;
   char serverControlledPartCount;
  char notetrackCount;
  char eventStreamSize;
  char eventConstantsSize;
};
};
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 09:43, 22 December 2014

The scriptable asset is used in Ghost and Advanced Warfare. It appears to be a format used to hold some scripting information for models and the collision map. Since it is so new, there is virtually nothing known about it.

struct ScriptableEventShakeDef
{
  const char *rumbleName;
  unsigned __int16 duration;
  unsigned __int16 durationFadeUp;
  unsigned __int16 durationFadeDown;
  unsigned __int16 radius;
  unsigned __int16 exponent;
  unsigned __int16 scaleEarthquake;
  char scalePitch;
  char scaleYaw;
  char scaleRoll;
  char frequencyPitch;
  char frequencyYaw;
  char frequencyRoll;
  char flags;
};

struct ScriptableEventSunlightSettingsDef
{
  char color[4];
  char transStateStreamIndex;
  char flags;
  unsigned __int16 intensityScaleMin;
  unsigned __int16 intensityScaleMax;
  unsigned __int16 pitchMin;
  unsigned __int16 pitchMax;
  unsigned __int16 headingMin;
  unsigned __int16 headingMax;
  unsigned __int16 transitionTimeMin;
  unsigned __int16 transitionTimeMax;
};

struct ScriptableEventLightSettingsDef
{
  char color[4];
  char lightIndexConstIndex;
  char transStateStreamIndex;
  char useColor;
  char useStateTransitionTime;
  unsigned __int16 intensityScaleMin;
  unsigned __int16 intensityScaleMax;
  unsigned __int16 radiusScaleMin;
  unsigned __int16 radiusScaleMax;
  const char *noteworthy;
  unsigned __int16 transitionTimeMin;
  unsigned __int16 transitionTimeMax;
};

struct ScriptableEventPhysicsDef
{
  XModel *model;
  char launchDirX;
  char launchDirY;
  char launchDirZ;
  unsigned __int16 explForceScale;
  unsigned __int16 bulletForceScale;
};

struct ScriptableEventHealthDef
{
  unsigned __int16 amount;
  unsigned __int16 interval;
  unsigned __int16 badPlaceRadius;
  char streamIndex;
};

struct ScriptableEventExplodeDef
{
  unsigned __int16 forceMin;
  unsigned __int16 forceMax;
  unsigned __int16 radius;
  unsigned __int16 damageMin;
  unsigned __int16 damageMax;
  bool aiAvoid;
};

struct ScriptableEventAnimationDef
{
  const char *animName;
  bool override;
  bool stateful;
  char animEntryIndex;
  char animPlaybackStreamIndex;
  unsigned __int16 timeOffsetMin;
  unsigned __int16 timeOffsetMax;
  unsigned __int16 playbackRateMin;
  unsigned __int16 playbackRateMax;
  unsigned __int16 blendTime;
};

struct ScriptableEventSoundDef
{
  snd_alias_list_t *alias;
  bool looping;
};

struct ScriptableEventFxDef
{
  FxEffectDef *handle;
  scr_string_t tagName;
  unsigned __int16 loopTime;
  char loopTimeStreamIndex;
  bool tagUseAngles;
};

struct ScriptableEventModelDef
{
  XModel *model;
};

struct ScriptableEventStateChangeDef
{
  char targetIndex;
  char delayStreamIndex;
  unsigned __int16 delayMin;
  unsigned __int16 delayMax;
};

union ScriptableEventDataUnion
{
  ScriptableEventStateChangeDef stateChange;  //If parent->type == 0xA
  ScriptableEventModelDef setModel;//else if == 0
  ScriptableEventFxDef playFx; //else if == 1
  ScriptableEventSoundDef playSound; //else if == 2
  ScriptableEventAnimationDef playAnim; //else if == 3
  ScriptableEventExplodeDef doExplosion;  //else if == 4
  ScriptableEventHealthDef healthDrain;  //else if == 5
  ScriptableEventPhysicsDef physicsLaunch; //else if == 6
  ScriptableEventLightSettingsDef lightSettings; //else if == 7
  ScriptableEventSunlightSettingsDef sunlightSettings; //else if == 8
  ScriptableEventShakeDef shake; //else if == 9
};

enum ScriptableEventType
{
  SCRIPTABLE_EVENT_MODEL = 0x0,
  SCRIPTABLE_EVENT_FX = 0x1,
  SCRIPTABLE_EVENT_SOUND = 0x2,
  SCRIPTABLE_EVENT_ANIMATION = 0x3,
  SCRIPTABLE_EVENT_EXPLODE = 0x4,
  SCRIPTABLE_EVENT_HEALTHDRAIN = 0x5,
  SCRIPTABLE_EVENT_PHYSICSLAUNCH = 0x6,
  SCRIPTABLE_EVENT_LIGHTSETTINGS = 0x7,
  SCRIPTABLE_EVENT_SUNLIGHTSETTINGS = 0x8,
  SCRIPTABLE_EVENT_SHAKE = 0x9,
  SCRIPTABLE_EVENT_STATECHANGE = 0xA,
  SCRIPTABLE_EVENT_COUNT = 0xB,
};

struct ScriptableEventDef
{
  ScriptableEventType type;
  ScriptableEventDataUnion data;
};

struct ScriptableStateDef
{
  scr_string_t name;
  scr_string_t tagName;
  ScriptableEventDef *onEnterEvents; // count = onEnterEventCount
  char onEnterEventCount;
  char damageFlags;
  char damageParentTransferRate;
  char damageParentReceiveRate;
  unsigned __int16 maxHealth;
};

struct ScriptablePartDef
{
  ScriptableStateDef *states; // count = stateCount
  scr_string_t name;
  char stateCount;
  char flags;
  char eventStreamTimeRemainIndex;
  char eventStreamNextChangeTimeIndex;
};


struct ScriptableNotetrackFxDef
{
  FxEffectDef *handle;
  scr_string_t tagName;
  bool useAngles;
};

struct ScriptableNotetrackSoundDef
{
  snd_alias_list_t *alias;
};

union ScriptableNotetrackDataUnion
{
  ScriptableNotetrackFxDef playFx;
  ScriptableNotetrackSoundDef playSound;
};

enum ScriptableNotetrackType
{
  SCRIPTABLE_NT_FX = 0x0,
  SCRIPTABLE_NT_SOUND = 0x1,
  SCRIPTABLE_NT_COUNT = 0x2,
};

struct ScriptableNotetrackDef
{
  scr_string_t name;
  ScriptableNotetrackType type;
  ScriptableNotetrackDataUnion data;
};

/* ScriptableDef->type */
enum ScriptableType
{
  SCRIPTABLE_TYPE_GENERAL = 0x0,
  SCRIPTABLE_TYPE_CHARACTER = 0x1,
  SCRIPTABLE_TYPE_COUNT = 0x2,
};

struct Scriptable
{
  const char *name;
  XModel *baseModel;
  const char *baseCollisionBrush;
  const char *destroyedCollisionBrush;
  ScriptablePartDef *parts; //count = partCount
  ScriptableNotetrackDef *notetracks; //count = notetrackCount
  ScriptableType type;
  char flags;
  byte partCount;
  char serverInstancePartCount;
  char serverControlledPartCount;
  char notetrackCount;
  char eventStreamSize;
  char eventConstantsSize;
};