Difference between revisions of "Object.dat"

From GTAMods Wiki
Jump to navigation Jump to search
(format)
m (Forgot to change FX info names too)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{file-stub}}
+
<!-- I don't think {{file-stub}} applies anymore -->{{lowercase}}
{{lowercase}}
+
The '''<code>object.dat</code>''' file is located in the <code>/data</code> directory of [[GTA III]], [[Vice City]], and [[San Andreas]], or the <code>/common/data</code> directory of [[GTA IV]]. It defines the physical aspects of objects defined in [[IDE]] files.
The '''<code>object.dat</code>''' file is located in the <code>.\data</code> directory of [[GTA III]], [[Vice City]], and [[San Andreas]], or the <code>.\common\data</code> directory of [[GTA IV]]. It allows objects defined in an [[IDE]] file to be dynamic and able to interact with the environment.
 
  
 
== Format ==
 
== Format ==
Documentation of the format already exists within the file itself.
+
{|class="wikitable center-col-1 center-col-2 center-col-3" style="width: 100%;"
 
 
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
 
 
!style="width: 3em;" |{{Icon|3}} {{Icon|VC}}
 
!style="width: 3em;" |{{Icon|3}} {{Icon|VC}}
 
!style="width: 3em;" |{{Icon|SA}}
 
!style="width: 3em;" |{{Icon|SA}}
!style="width: 12em;" |Identifier
+
!style="width: 12em;" |Name in file
!style="width: 6em;" |Type
+
!style="width: 6em;" |Data type
 
!Description
 
!Description
 
|-
 
|-
|colspan="2" |A ||Object name ||string ||
+
|colspan="2" |A ||Object name ||string || Object name. Maximum of 256 characters in length.
 +
|-
 +
|colspan="2" |B ||Mass ||float || 1 to 50000 inclusive. Unit is kilograms.
 
|-
 
|-
|colspan="2" |B ||Mass ||float ||
+
|colspan="2" |C ||TurnMass ||float || The description within the file says ''kg m^3 or some such dimension'', but kg/m<sup>3</sup> is actually the [[Wikipedia:Kilogram per cubic metre|unit of density]]. However, kg/m<sup>2</sup> is the unit of [[Wikipedia:Moment of inertia|rotational inertia]], which is sometimes referred to as "rotational mass" (and could be what "TurnMass" is referring to).
 
|-
 
|-
|colspan="2" |C ||TurnMass ||float ||
+
|colspan="2" |D ||Air Resistance ||float || Normalised between 1 and 0. 0 means complete air resistance, 1 means no air resistance. Most objects have a value of 0.99 for this attribute.
 
|-
 
|-
|colspan="2" |D ||Air Resistance ||float ||
+
|colspan="2" |E ||Elasticity ||float || How much the object bounces when it collides with something. Normalised. 0 is the least bouncy, 1 is the most.
 
|-
 
|-
|colspan="2" |E ||Elasticity ||float ||
+
|colspan="2" |F ||Percent Submerged ||float || 10 to 120. Most objects have a value of 50.0 for this attribute.
 
|-
 
|-
|colspan="2" |F ||Percent Submerged ||float ||
+
|colspan="2" |G ||Uproot Force ||float || The magnitude of the force vector that must be applied to the object to remove it from the ground. Possibly Newtons, but no units given.
 
|-
 
|-
|colspan="2" |G ||Uproot Limit ||float ||
+
|colspan="2" |H ||Collision Damage Multiplier ||float || Controls how much damage a collision with this object should do to vehicles. "0.1 - 5.0 ish" according to the file.
 
|-
 
|-
|colspan="2" |H ||Collision Damage Multiplier ||float ||
+
|colspan="2" |I ||Collision Damage Effect ||integer || What happens to the object when it is collided with. Values:
 +
 
 +
:<code>0</code> = Nothing
 +
 
 +
:<code>1</code> = Changes model
 +
 
 +
:<code>20</code> = Smashes
 +
 
 +
:<code>21</code> = Changes model and then smashes
 +
 
 +
:<code>200</code> = Breaks
 +
 
 +
:<code>202</code> = Breaks and does not get regenerated when the area is reloaded
 +
 
 +
If either <code>200</code> or <code>202</code> is specified, extra breakable object information must be specified.
 +
 
 
|-
 
|-
|colspan="2" |I ||Collision Damage Effect ||integer ||
+
|colspan="2" |J ||Special Collision Response Cases ||integer || Specifies if the game has a custom response for collisions with this object, and what the response should be if there is one. Values:
 +
 
 +
:<code>0</code> = Normal (no custom response)
 +
 
 +
:<code>1</code> = Lamp post
 +
 
 +
:<code>2</code> = Small box
 +
 
 +
:<code>3</code> = Big box (unused in the file)
 +
 
 +
:<code>4</code> = Fence section
 +
 
 +
:<code>5</code> = Grenade (unused in the file)
 +
 
 +
:<code>6</code> = Swinging door
 +
 
 +
:<code>7</code> = Locked door
 +
 
 +
:<code>8</code> = Hanging (like the punchbag in the gym)
 +
 
 +
:<code>9</code> = Pool ball
 +
 
 
|-
 
|-
|colspan="2" |J ||Special Collision Response Cases ||integer ||
+
|colspan="2" |K ||Camera to avoid this object ||integer || Boolean (written as 1 or 0, not true/false) that controls whether the camera should move around the object.
 
|-
 
|-
|colspan="2" |K ||Camera to avoid this object ||integer ||
+
| ||L ||{{a|c}} |Causes Explosion ||integer || If not 0, ''Name of FxSystem'' should be a valid effect name. 0 if no explosion effect should occur.
 
|-
 
|-
| ||L ||{{a|c}} |Causes Explosion ||integer ||
+
| ||M ||{{a|c}} |Type of FxSystem ||integer ||When the explosion effect should be played. Values:
 +
 
 +
:<code>0</code> = No effect
 +
 
 +
:<code>1</code> = When hit
 +
 
 +
:<code>2</code> = When destroyed
 +
 
 +
:<code>3</code> = When either hit or destroyed (whichever is first)
 +
 
 
|-
 
|-
| ||M ||{{a|c}} |FX_TYPE ||integer ||
+
| ||N,O,P ||{{a|c}} |Offset of FxSystem ||float[3] ||3D vector. Offset of the effect system from the pivot of the object. If <code>x == -999.0</code>, the game plays the effect at the point of collision.
 
|-
 
|-
| ||N,O,P ||{{a|c}} |FX_OFFSET ||float[3] ||
+
| ||Q ||{{a|c}} |Name of FxSystem ||string || The name of the effect to play. If there is no effect, <code>none</code> should be used. (The file says it should be <code>noname</code>, but <code>none</code> is used instead. <code>noname</code> is never used.)
 
|-
 
|-
| ||Q ||{{a|c}} |FX_NAME ||string ||
+
|colspan="5" |<h3>Extra breakable object information</h3>
 
|-
 
|-
| ||R ||{{a|c}} |B-SM ||float ||
+
| ||R ||{{a|c}} |Smash Multiplier ||float ||How much larger the force needed to smash an object should be than the force needed to break it. In code:
 +
<code>smashForce = smashMultiplier * breakForce</code>
 +
 
 +
Smashing always takes precedence over breaking so if <code>smashForce == breakForce</code>, the object will smash and not break.
 +
 
 +
To prevent the object smashing, set a very large value so that it is impossible for the player to achieve the required smash force.
 
|-
 
|-
| ||S ||{{a|c}} |B-VX ||float ||
+
| ||S ||{{a|c}} |Break Velocity X ||float ||Offset velocity on X axis. Offset values are added to the velocity from the impact after randomness is factored in.
 
|-
 
|-
| ||T ||{{a|c}} |B-VY ||float ||
+
| ||T ||{{a|c}} |Break Velocity Y ||float ||Offset velocity on Y axis.
 
|-
 
|-
| ||U ||{{a|c}} |B-VZ ||float ||
+
| ||U ||{{a|c}} |Break Velocity Z ||float ||Offset velocity on Z axis.
 
|-
 
|-
| ||V ||{{a|c}} |B-VR ||float ||
+
| ||V ||{{a|c}} |Break Velocity Rand ||float ||The maximum deviation from the velocity X/Y/Z values due to randomness.
 
|-
 
|-
| ||W ||{{a|c}} |B-GUN ||integer ||
+
| ||W ||{{a|c}} |Gun Break Mode ||integer || Object behaviour when shot with a gun. Values:
 +
 
 +
:<code>0</code> = Immune to gun damage
 +
 
 +
:<code>1</code> = Breakable
 +
 
 +
:<code>2</code> = Smashable
 +
 
 
|-
 
|-
| ||X ||{{a|c}} |B_SPK ||integer ||
+
| ||X ||{{a|c}} |Produce Sparks on Impact ||integer ||Whether sparks are produced on impact (1) or not (0).
 
|}
 
|}
  
 
[[Category:Map Formats]]
 
[[Category:Map Formats]]
 
{{N|4|SA|VC|3}}
 
{{N|4|SA|VC|3}}

Latest revision as of 14:13, 21 August 2020

The object.dat file is located in the /data directory of GTA III, Vice City, and San Andreas, or the /common/data directory of GTA IV. It defines the physical aspects of objects defined in IDE files.

Format

GTA III Vice City San Andreas Name in file Data type Description
A Object name string Object name. Maximum of 256 characters in length.
B Mass float 1 to 50000 inclusive. Unit is kilograms.
C TurnMass float The description within the file says kg m^3 or some such dimension, but kg/m3 is actually the unit of density. However, kg/m2 is the unit of rotational inertia, which is sometimes referred to as "rotational mass" (and could be what "TurnMass" is referring to).
D Air Resistance float Normalised between 1 and 0. 0 means complete air resistance, 1 means no air resistance. Most objects have a value of 0.99 for this attribute.
E Elasticity float How much the object bounces when it collides with something. Normalised. 0 is the least bouncy, 1 is the most.
F Percent Submerged float 10 to 120. Most objects have a value of 50.0 for this attribute.
G Uproot Force float The magnitude of the force vector that must be applied to the object to remove it from the ground. Possibly Newtons, but no units given.
H Collision Damage Multiplier float Controls how much damage a collision with this object should do to vehicles. "0.1 - 5.0 ish" according to the file.
I Collision Damage Effect integer What happens to the object when it is collided with. Values:
0 = Nothing
1 = Changes model
20 = Smashes
21 = Changes model and then smashes
200 = Breaks
202 = Breaks and does not get regenerated when the area is reloaded

If either 200 or 202 is specified, extra breakable object information must be specified.

J Special Collision Response Cases integer Specifies if the game has a custom response for collisions with this object, and what the response should be if there is one. Values:
0 = Normal (no custom response)
1 = Lamp post
2 = Small box
3 = Big box (unused in the file)
4 = Fence section
5 = Grenade (unused in the file)
6 = Swinging door
7 = Locked door
8 = Hanging (like the punchbag in the gym)
9 = Pool ball
K Camera to avoid this object integer Boolean (written as 1 or 0, not true/false) that controls whether the camera should move around the object.
L Causes Explosion integer If not 0, Name of FxSystem should be a valid effect name. 0 if no explosion effect should occur.
M Type of FxSystem integer When the explosion effect should be played. Values:
0 = No effect
1 = When hit
2 = When destroyed
3 = When either hit or destroyed (whichever is first)
N,O,P Offset of FxSystem float[3] 3D vector. Offset of the effect system from the pivot of the object. If x == -999.0, the game plays the effect at the point of collision.
Q Name of FxSystem string The name of the effect to play. If there is no effect, none should be used. (The file says it should be noname, but none is used instead. noname is never used.)

Extra breakable object information

R Smash Multiplier float How much larger the force needed to smash an object should be than the force needed to break it. In code:

smashForce = smashMultiplier * breakForce

Smashing always takes precedence over breaking so if smashForce == breakForce, the object will smash and not break.

To prevent the object smashing, set a very large value so that it is impossible for the player to achieve the required smash force.

S Break Velocity X float Offset velocity on X axis. Offset values are added to the velocity from the impact after randomness is factored in.
T Break Velocity Y float Offset velocity on Y axis.
U Break Velocity Z float Offset velocity on Z axis.
V Break Velocity Rand float The maximum deviation from the velocity X/Y/Z values due to randomness.
W Gun Break Mode integer Object behaviour when shot with a gun. Values:
0 = Immune to gun damage
1 = Breakable
2 = Smashable
X Produce Sparks on Impact integer Whether sparks are produced on impact (1) or not (0).