Difference between revisions of "Vehicle Asset (MW3)"

From COD Engine Research
Jump to: navigation, search
m
 
Line 4: Line 4:
 
The vehicle asset is a was added on Modern Warfare 2 and has been on every Call of Duty game since except for Black Ops 1. The purpose of this asset is to declare vehicles, mostly used for killstreaks.
 
The vehicle asset is a was added on Modern Warfare 2 and has been on every Call of Duty game since except for Black Ops 1. The purpose of this asset is to declare vehicles, mostly used for killstreaks.
 
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">
struct VehiclePhysics
+
enum VehicleAxleType
 +
{
 +
  VEH_AXLE_FRONT = 0x0,
 +
  VEH_AXLE_REAR = 0x1,
 +
  VEH_AXLE_ALL = 0x2,
 +
  VEH_AXLE_COUNT = 0x3,
 +
};
 +
 
 +
struct VehiclePhysDef
 
{
 
{
 
   int physicsEnabled;
 
   int physicsEnabled;
      const char *unknown1;
+
  const char *physPresetName;
   PhysPreset *physicsPreset;
+
   PhysPreset *physPreset;
   const char *accelerationGraph;
+
   const char *accelGraphName;
   int steeringAxle;
+
   VehicleAxleType steeringAxle;
   int powerAxle;
+
   VehicleAxleType powerAxle;
   int brakingAxle;
+
   VehicleAxleType brakingAxle;
      float unknown2;
+
  float topSpeed;
 
   float reverseSpeed;
 
   float reverseSpeed;
 
   float maxVelocity;
 
   float maxVelocity;
 
   float maxPitch;
 
   float maxPitch;
 
   float maxRoll;
 
   float maxRoll;
   float maxYaw;
+
   float suspensionTravelFront;
 
   float suspensionTravelRear;
 
   float suspensionTravelRear;
 
   float suspensionStrengthFront;
 
   float suspensionStrengthFront;
Line 53: Line 61:
 
};
 
};
  
enum VehicleTypes : int
+
enum VehicleType : int
 
{
 
{
 
   VEH_WHEELS_4 = 0x0,
 
   VEH_WHEELS_4 = 0x0,
Line 62: Line 70:
 
   VEH_HELICOPTER = 0x5,
 
   VEH_HELICOPTER = 0x5,
 
   VEH_SNOWMOBILE = 0x6,
 
   VEH_SNOWMOBILE = 0x6,
   VEH_TYPE_MAX
+
   VEH_TYPE_COUNT = 0x7,
 +
};
 +
 
 +
enum VehicleTurretFireType
 +
{
 +
  VEH_TURRET_SINGLE_FIRE = 0x0,
 +
  VEH_TURRET_DUAL_FIRE = 0x1,
 +
  VEH_TURRET_ALT_FIRE = 0x2,
 +
  VEH_TURRET_FIRE_TYPE_COUNT = 0x3,
 
};
 
};
  
Line 71: Line 87:
 
   const char *useHintString;
 
   const char *useHintString;
 
   int health;
 
   int health;
      char unknown1[8];
+
  int quadBarrel;
   float texureScrollScale;
+
  int hitClientScriptables;
   float maxSpeed;
+
   float texScrollScale;
 +
   float topSpeed;
 
   float accel;
 
   float accel;
 
   float rotRate;
 
   float rotRate;
Line 99: Line 116:
 
   float collisionDamage;
 
   float collisionDamage;
 
   float collisionSpeed;
 
   float collisionSpeed;
   float killcamZDist;
+
   float killcamOffset[3];
  float killcamBackDist;
+
  float killcamUpDist;
+
 
   int playerProtected;
 
   int playerProtected;
 
   int bulletDamage;
 
   int bulletDamage;
Line 109: Line 124:
 
   int projectileSplashDamage;
 
   int projectileSplashDamage;
 
   int heavyExplosiveDamage;
 
   int heavyExplosiveDamage;
   VehiclePhysics vehiclePhysics;
+
   VehiclePhysDef vehPhysDef;
 
       char unknown2[0x120];
 
       char unknown2[0x120];
 
   const char * turretWeaponName;
 
   const char * turretWeaponName;
   WeaponVariantDef *turretWeapon;
+
   WeaponCompleteDef *turretWeapon;
 
   float turretHorizSpanLeft;
 
   float turretHorizSpanLeft;
 
   float turretHorizSpanRight;
 
   float turretHorizSpanRight;
 
   float turretVertSpanUp;
 
   float turretVertSpanUp;
 
   float turretVertSpanDown;
 
   float turretVertSpanDown;
      char unknown4[0x10];
+
  float turretHorizResistLeft;
 +
  float turretHorizResistRight;
 +
  float turretVertResistUp;
 +
  float turretVertResistDown;
 
   float turretRotRate;
 
   float turretRotRate;
      int unknown5;
+
  VehicleTurretFireType turretFireType;
 
   snd_alias_list_name turretSpinSnd;
 
   snd_alias_list_name turretSpinSnd;
 
   snd_alias_list_name turretStopSnd;
 
   snd_alias_list_name turretStopSnd;
Line 128: Line 146:
 
   float trophyReloadTime;
 
   float trophyReloadTime;
 
   ScriptString trophyTags[4];
 
   ScriptString trophyTags[4];
      FxEffectDef* unknownFx1;
+
  FxEffectDef* trophyExplodeFx;
      FxEffectDef* unknownFx2;
+
  FxEffectDef* trophyFlashFx;
 
   Material *compassFriendlyIcon;
 
   Material *compassFriendlyIcon;
 
   Material *compassEnemyIcon;
 
   Material *compassEnemyIcon;
   Material* compassFriendlyIconCB;
+
   Material *compassFriendlyAltIcon;
   Material* compassEnemyIconCB;
+
   Material *compassEnemyAltIcon;
 
   int compassIconWidth;
 
   int compassIconWidth;
 
   int compassIconHeight;
 
   int compassIconHeight;
   snd_alias_list_name lowIdleSound;
+
   snd_alias_list_name idleLowSound;
   snd_alias_list_name highIdleSound;
+
   snd_alias_list_name idleHighSound;
   snd_alias_list_name lowEngineSound;
+
   snd_alias_list_name engineLowSound;
   snd_alias_list_name highEngineSound;
+
   snd_alias_list_name engineHighSound;
      int unknown6;
+
  float engineSndSpeed;
      ScriptString unknownScriptString1;
+
  ScriptString audioOriginTag;
      snd_alias_list_name unknownSound1;
+
  snd_alias_list_name idleLowSndAlt;
      snd_alias_list_name unknownSound2;
+
  snd_alias_list_name idleHighSndAlt;
      snd_alias_list_name unknownSound3;
+
  snd_alias_list_name engineLowSndAlt;
      snd_alias_list_name unknownSound4;
+
  snd_alias_list_name engineHighSndAlt;
      int unknown7;
+
  float engineSndSpeedAlt;
      ScriptString unknownScriptString2;
+
  ScriptString audioOriginTagAlt;
      snd_alias_list_name unknownSound5;
+
  snd_alias_list_name turretSpinSndAlt;
      snd_alias_list_name unknownSound6;
+
  snd_alias_list_name turretStopSndAlt;
      snd_alias_list_name unknownSound7;
+
  snd_alias_list_name engineStartUpSnd;
      int unknown8;
+
  int engineStartUpLength;
      snd_alias_list_name unknownSound8;
+
  snd_alias_list_name engineShutdownSnd;
      snd_alias_list_name unknownSound9;
+
  snd_alias_list_name engineIdleSnd;
      snd_alias_list_name unknownSoundA;
+
  snd_alias_list_name engineSustainSnd;
      snd_alias_list_name unknownSoundB;
+
  snd_alias_list_name engineRampUpSnd;
 
   int engineRampUpLength;
 
   int engineRampUpLength;
 
   snd_alias_list_name engineRampDownSnd;
 
   snd_alias_list_name engineRampDownSnd;
Line 167: Line 185:
 
   snd_alias_list_name speedSnd;
 
   snd_alias_list_name speedSnd;
 
   float speedSndBlendSpeed;
 
   float speedSndBlendSpeed;
   char *surfaceSndPrefix;
+
   const char *surfaceSndPrefix;
 
   snd_alias_list_name surfaceSounds[0x1F];
 
   snd_alias_list_name surfaceSounds[0x1F];
 
   float surfaceSndBlendSpeed;
 
   float surfaceSndBlendSpeed;

Latest revision as of 17:23, 27 December 2014

The vehicle asset is a was added on Modern Warfare 2 and has been on every Call of Duty game since except for Black Ops 1. The purpose of this asset is to declare vehicles, mostly used for killstreaks.

enum VehicleAxleType
{
  VEH_AXLE_FRONT = 0x0,
  VEH_AXLE_REAR = 0x1,
  VEH_AXLE_ALL = 0x2,
  VEH_AXLE_COUNT = 0x3,
};
 
struct VehiclePhysDef 
{
  int physicsEnabled;
  const char *physPresetName;
  PhysPreset *physPreset;
  const char *accelGraphName;
  VehicleAxleType steeringAxle;
  VehicleAxleType powerAxle;
  VehicleAxleType brakingAxle;
  float topSpeed;
  float reverseSpeed;
  float maxVelocity;
  float maxPitch;
  float maxRoll;
  float suspensionTravelFront;
  float suspensionTravelRear;
  float suspensionStrengthFront;
  float suspensionDampingFront;
  float suspensionStrengthRear;
  float suspensionDampingRear;
  float frictionBraking;
  float frictionCoasting;
  float frictionTopSpeed;
  float frictionSide;
  float frictionSideRear;
  float velocityDependentSlip;
  float rollStability;
  float rollResistance;
  float pitchResistance;
  float yawResistance;
  float uprightStrengthPitch;
  float uprightStrengthRoll;
  float targetAirPitch;
  float airYawTorque;
  float airPitchTorque;
  float minimumMomentumForCollision;
  float collisionLaunchForceScale;
  float wreckedMassScale;
  float wreckedBodyFriction;
  float minimumJoltForNotify;
  float slipThreshholdFront;
  float slipThreshholdRear;
  float slipFricScaleFront;
  float slipFricScaleRear;
  float slipFricRateFront;
  float slipFricRateRear;
  float slipYawTorque;
};
 
enum VehicleType : int
{
  VEH_WHEELS_4 = 0x0,
  VEH_TANK = 0x1,
  VEH_PLANE = 0x2,
  VEH_BOAT = 0x3,
  VEH_ARTILLERY = 0x4,
  VEH_HELICOPTER = 0x5,
  VEH_SNOWMOBILE = 0x6,
  VEH_TYPE_COUNT = 0x7,
};
 
enum VehicleTurretFireType
{
  VEH_TURRET_SINGLE_FIRE = 0x0,
  VEH_TURRET_DUAL_FIRE = 0x1,
  VEH_TURRET_ALT_FIRE = 0x2,
  VEH_TURRET_FIRE_TYPE_COUNT = 0x3,
};
 
struct VehicleDef
{
  const char *name;
  int type;
  const char *useHintString;
  int health;
  int quadBarrel;
  int hitClientScriptables;
  float texScrollScale;
  float topSpeed;
  float accel;
  float rotRate;
  float rotAccel;
  float maxBodyPitch;
  float maxBodyRoll;
  float fakeBodyAccelPitch;
  float fakeBodyAccelRoll;
  float fakeBodyVelPitch;
  float fakeBodyVelRoll;
  float fakeBodySideVelPitch;
  float fakeBodySidePitchStrength;
  float fakeBodyRollStrength;
  float fakeBodyPitchDampening;
  float fakeBodyRollDampening;
  float fakeBodyBoatRockingAmplitude;
  float fakeBodyBoatRockingPeriod;
  float fakeBodyBoatRockingRotationPeriod;
  float fakeBodyBoatRockingFadeoutSpeed;
  float boatBouncingMinForce;
  float boatBouncingMaxForce;
  float boatBouncingRate;
  float boatBouncingFadeinSpeed;
  float boatBouncingFadeoutSteeringAngle;
  float collisionDamage;
  float collisionSpeed;
  float killcamOffset[3];
  int playerProtected;
  int bulletDamage;
  int armorPiercingDamage;
  int grenadeDamage;
  int projectileDamage;
  int projectileSplashDamage;
  int heavyExplosiveDamage;
  VehiclePhysDef vehPhysDef;
       char unknown2[0x120];
  const char * turretWeaponName;
  WeaponCompleteDef *turretWeapon;
  float turretHorizSpanLeft;
  float turretHorizSpanRight;
  float turretVertSpanUp;
  float turretVertSpanDown;
  float turretHorizResistLeft;
  float turretHorizResistRight;
  float turretVertResistUp;
  float turretVertResistDown;
  float turretRotRate;
  VehicleTurretFireType turretFireType;
  snd_alias_list_name turretSpinSnd;
  snd_alias_list_name turretStopSnd;
  int trophyEnabled;
  float trophyRadius;
  float trophyInactiveRadius;
  int trophyAmmoCount;
  float trophyReloadTime;
  ScriptString trophyTags[4];
  FxEffectDef* trophyExplodeFx;
  FxEffectDef* trophyFlashFx;
  Material *compassFriendlyIcon;
  Material *compassEnemyIcon;
  Material *compassFriendlyAltIcon;
  Material *compassEnemyAltIcon;
  int compassIconWidth;
  int compassIconHeight;
  snd_alias_list_name idleLowSound;
  snd_alias_list_name idleHighSound;
  snd_alias_list_name engineLowSound;
  snd_alias_list_name engineHighSound;
  float engineSndSpeed;
  ScriptString audioOriginTag;
  snd_alias_list_name idleLowSndAlt;
  snd_alias_list_name idleHighSndAlt;
  snd_alias_list_name engineLowSndAlt;
  snd_alias_list_name engineHighSndAlt;
  float engineSndSpeedAlt;
  ScriptString audioOriginTagAlt;
  snd_alias_list_name turretSpinSndAlt;
  snd_alias_list_name turretStopSndAlt;
  snd_alias_list_name engineStartUpSnd;
  int engineStartUpLength;
  snd_alias_list_name engineShutdownSnd;
  snd_alias_list_name engineIdleSnd;
  snd_alias_list_name engineSustainSnd;
  snd_alias_list_name engineRampUpSnd;
  int engineRampUpLength;
  snd_alias_list_name engineRampDownSnd;
  int engineRampDownLength;
  snd_alias_list_name suspensionSoftSnd;
  float suspensionSoftCompression;
  snd_alias_list_name suspensionHardSnd;
  float suspensionHardConpression;
  snd_alias_list_name collisionSnd;
  float collisionBlendSpeed;
  snd_alias_list_name speedSnd;
  float speedSndBlendSpeed;
  const char *surfaceSndPrefix;
  snd_alias_list_name surfaceSounds[0x1F];
  float surfaceSndBlendSpeed;
  float slideVolume;
  float slideBlendSpeed;
  float inAirPitch;
};

Source Format

The vehicle source files are raw text files with no extension, located at "raw/vehicles/". They use the same format as many other assets, with each setting name and value separated by a back-slash. The first setting identifies the file, and for vehicles the identifier string is "VEHICLEFILE".