Difference between revisions of "TOBJ"

From GTAMods Wiki
Jump to navigation Jump to search
m (See also)
m (corrected NightFlags to ActiveHours and added statistics for GTAIV.)
 
(16 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
{{IdeSection
 
{{IdeSection
| game        = [[GTA III]], [[GTA VC]], [[GTA SA]], [[GTA IV]]
+
|game        = {{Icon|t}} {{Icon|LCS}} {{Icon|4}}
| description = Used to define timed map objects
+
|description = Defines timed map objects
 
}}
 
}}
'''TOBJ''' is a section in the [[item definition]] file. It is used to define standart map objects with an additional ingame time range defining when the object gets rendered. It's format is similar to [[OBJS|standart map objects]]. [[GTA IV]] does also support time controlled objects linked to animations. For more information about this see [[TANM]].
+
'''<code>tobj</code>''' is a section in the [[item definition]] file in [[GTA III]], [[Vice City]], [[San Andreas]], [[Liberty City Stories]], and [[GTA IV]]. It is used to define standard map objects similar to the <code>[[OBJS|objs]]</code> section with an additional in-game time range defining when the object gets rendered. [[GTA IV]] also support time controlled objects linked to animations through the <code>[[TANM|tanm]]</code> section. Most, if not all, time objects use the [[Item Definition#IDE Flags|object flag]] 2 to prevent them from fading into and out of view at those times.
 
 
  
 
== Format ==
 
== Format ==
 +
=== GTA III &ndash; Liberty City Stories ===
 +
{{Pre|
 +
tobj
 +
# [[#Type 1|type 1]] (III/VC/SA/LCS)
 +
Id, ModelName, TxdName, MeshCount, DrawDistance, Flags, TimeOn, TimeOff
 +
# [[#Type 2|type 2]] (III/VC/SA/LCS)
 +
Id, ModelName, TxdName, MeshCount, DrawDistance1, DrawDistance2, Flags, TimeOn, TimeOff
 +
# [[#Type 3|type 3]] (III/VC/SA/LCS)
 +
Id, ModelName, TxdName, MeshCount, DrawDistance1, DrawDistance2, DrawDistance3, Flags, TimeOn, TimeOff
 +
# [[#Type 4|type 4]] (SA)
 +
Id, ModelName, TxdName, DrawDistance, Flags, TimeOn, TimeOff
 +
end
 +
}}
  
=== GTA III, Vice City and San Andreas ===
+
====Type 1====
{{Incomplete}}
+
This is used for non-breakable objects.
 
+
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
ID, ModelName, TextureName, ObjectCount, DrawDistance, [DrawDistance2, ...], Flags, TimeOn, TimeOff
+
!style="width: 3em;" |{{Icon|3}} {{Icon|VC}}<br>{{Icon|SA}} {{Icon|LCS}}
 
+
!style="width: 12em;" |Identifier
{|{{Prettytable}} width="100%"
+
!style="width: 6em;" |Type
!width="250px"|Identifier
 
 
!Description
 
!Description
 
|-
 
|-
|<center>ID</center>||Unique object ID.
+
|A ||Id ||integer ||Unique object identifier.
 
|-
 
|-
|<center>ModelName</center>||Name of the <code>.dff</code> [[model file]] without extension.
+
|B ||ModelName ||string ||Name of the [[model file]] without extension.
 
|-
 
|-
|<center>TextureName</center>||Name of the <code>.txd</code> [[texture dictionary]] without extension.
+
|C ||TxdName ||string ||Name of the [[texture dictionary]] without extension.
 
|-
 
|-
|<center>ObjectCount</center>||Number of [[RenderWare_binary_stream_file|clumps]]. 1 by default and optional for ''San Andreas''.
+
|D ||MeshCount ||integer ||Number of meshes. 1 for this type.
 
|-
 
|-
|<center>DrawDistance</center>||[[Draw distance]] in [[unit]]s (one for each clump).
+
|E ||DrawDistance ||float ||[[Draw distance]] in [[unit]]s.
 
|-
 
|-
|<center>Flags</center>||Object flags (see [[TOBJ#Object_Flags|below]]).
+
|F ||Flags ||integer ||[[Item Definition#IDE Flags|Object flags]]
 
|-
 
|-
|<center>TimeOn, TimeOff</center>||Activation and deactivation time in hours.
+
|G ||TimeOn ||integer ||Hour to appear
 +
|-
 +
|H ||TimeOff ||integer ||Hour to disappear
 
|}
 
|}
  
=== GTA IV ===
+
====Type 2====
 
+
This is used for breakable objects.
ModelName, TextureName, DrawDistance, Flags, Unknown, MinX, MinY, MinZ, MaxX, MaxY, MaxZ, SphereX, SphereY, SphereZ, Radius, LOD Model, NightFlag
+
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
 
+
!style="width: 3em;" |{{Icon|3}} {{Icon|VC}}<br>{{Icon|SA}} {{Icon|LCS}}
{|{{Prettytable}} width="100%"
+
!style="width: 12em;" |Identifier
!width="250px"|Identifier
+
!style="width: 6em;" |Type
 
!Description
 
!Description
 
|-
 
|-
|<center>ModelName</center>||Name of the <code>.wdr</code> ''model file'' without extension.
+
|A ||Id ||integer ||Unique object identifier.
 +
|-
 +
|B ||ModelName ||string ||Name of the [[model file]] without extension.
 +
|-
 +
|C ||TxdName ||string ||Name of the [[texture dictionary]] without extension.
 
|-
 
|-
|<center>TextureName</center>||name of the <code>.wtd</code> ''texture dictionary'' without extension.
+
|D ||MeshCount ||integer ||Number of meshes. 2 for this type.
 
|-
 
|-
|<center>DrawDistance</center>||''Draw distance'' in ''units''.
+
|E,F ||DrawDistance1, DrawDistance2 ||float[2] ||[[Draw distance]] in [[unit]]s (one for each mesh, only the first is actually used).
 +
|-
 +
|G ||Flags ||integer ||[[Item Definition#IDE Flags|Object flags]]
 +
|-
 +
|H ||TimeOn ||integer ||Hour to appear
 +
|-
 +
|I ||TimeOff ||integer ||Hour to disappear
 +
|}
 +
 
 +
====Type 3====
 +
This is used for complex breakable objects.
 +
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
 +
!style="width: 3em;" |{{Icon|3}} {{Icon|VC}}<br>{{Icon|SA}} {{Icon|LCS}}
 +
!style="width: 12em;" |Identifier
 +
!style="width: 6em;" |Type
 +
!Description
 
|-
 
|-
|<center>Flag1</center>||Object flag (see [[OBJS#Object Flags|below]]).
+
|A ||Id ||integer ||Unique object identifier.
 
|-
 
|-
|<center>Unknown</center>||Unknown integer (0 by default).
+
|B ||ModelName ||string ||Name of the [[model file]] without extension.
 
|-
 
|-
|<center>MinX, MinY, MinZ</center>||Lower left corner of the bounding box for the object.
+
|C ||TxdName ||string ||Name of the [[texture dictionary]] without extension.
 
|-
 
|-
|<center>MaxX, MaxY, MaxZ</center>||Upper right corner of the bounding box for the object.
+
|D ||MeshCount ||integer ||Number of meshes. 3 for this type.
 
|-
 
|-
|<center>SphereX, SphereY, SphereZ</center>||Center of the bounding sphere for the object.
+
|E,F,G ||DrawDistance1, DrawDistance2, DrawDistance3 ||float[3] ||[[Draw distance]] in [[unit]]s (one for each mesh, only the first is actually used).
 
|-
 
|-
|<center>Radius</center>||Radius of the bounding sphere into all dimensions.
+
|H ||Flags ||integer ||[[Item Definition#IDE Flags|Object flags]]
 
|-
 
|-
|<center>LOD Model</center>||Name of the <code>.[[wdd]]</code> file that contains the ''lod model'' for the defined modelname.
+
|I ||TimeOn ||integer ||Hour to appear
 
|-
 
|-
|<center>NightFlag</center>||If enabled (1) the object only shows at nighttime, otherwise the object gets only rendered at daytime. Day- and nighttimes are [[hardcoded]].
+
|J ||TimeOff ||integer ||Hour to disappear
 
|}
 
|}
  
For more information read the definition of [[OBJS#GTA_IV|Standart map files]].
+
====Type 4====
 
+
This is used for non-breakable objects and behaves equivalently to [[#Type 1|Type 1]].
== Object Flags ==
+
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
 
+
!style="width: 3em;" |{{Icon|SA}}
Flags are used to specify the behaviour of objects. They are signed 32-bit integer values where each bit descripes a [[wikipedia:Boolean_algebra_(logic)|boolean]] value of an special aspect.
+
!style="width: 12em;" |Identifier
 
+
!style="width: 6em;" |Type
{|{{Prettytable}} width="100%" class="collapsible"
 
!width="120px"|Flag
 
!width="100px"|Supported games
 
!width="25%"|Binary
 
 
!Description
 
!Description
 
|-
 
|-
|<center>-1</center>||<center>&ndash;</center>||<center><code>1111 1111 1111 1111 1111 1111</code></center>||Enables all flags. {{ref|1}} Never used by default.
+
|A ||Id ||integer ||Unique object identifier.
 
|-
 
|-
|<center>1</center>||<center>{{Icon|3}} {{Icon|VC}} {{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 0000 0000 0000 0001</code></center>||Wet effect (objects appear darker).
+
|B ||ModelName ||string ||Name of the [[model file]] without extension.
 
|-
 
|-
|<center>2</center>||<center>{{Icon|3}} {{Icon|VC}} {{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 0000 0000 0000 0010</code></center>||Indicates that the object gets rendered at night for objects defined in ''TOBJ''.
+
|C ||TxdName ||string ||Name of the [[texture dictionary]] without extension.
 
|-
 
|-
|<center>4</center>||<center>{{Icon|3}} {{Icon|VC}} {{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 0000 0000 0000 0100</code></center>||Alpha transparency 1
+
|D ||DrawDistance ||float ||[[Draw distance]] in [[unit]]s.
 
|-
 
|-
|<center>8</center>||<center>{{Icon|3}} {{Icon|VC}} {{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 0000 0000 0000 1000</code></center>||Alpha transparency 2
+
|E ||Flags ||integer ||[[Item Definition#IDE Flags|Object flags]]
 
|-
 
|-
|<center>16</center>||<center>{{Icon|3}} {{Icon|VC}} {{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 0000 0000 0001 0000</code></center>||Opposite to flag '''2'''
+
|F ||TimeOn ||integer ||Hour to appear
 
|-
 
|-
|<center>32</center>||<center>{{Icon|3}} {{Icon|VC}} {{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 0000 0000 0010 0000</code></center>||Indicates an object to be used inside an interior.
+
|G ||TimeOff ||integer ||Hour to disappear
|-
+
|}
|<center>64</center>||<center>{{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 0000 0000 0100 0000</code></center>||Disables the [[COLL#Shadow_Mesh|shadow mesh]] to project a shadow.
+
 
|-
+
=== GTA IV ===
|<center>128</center>||<center>{{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 0000 0000 1000 0000</code></center>||Object surface will not be [[Wikipedia:Hidden_surface_determination|culled]].
+
{{Pre|
|-
+
tobj
|<center>256</center>||<center>{{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 0000 0001 0000 0000</code></center>||Disables draw distance (Only used for [[LOD]] objects with an ''LOD'' value greater than 299).
+
ModelName, TxdName, DrawDistance, Flags, Unknown, MinX, MinY, MinZ, MaxX, MaxY, MaxZ, SphereX, SphereY, SphereZ, Radius, LODModel, NightFlag
 +
end
 +
}}
 +
 
 +
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
 +
!style="width: 3em;" |{{Icon|4}}
 +
!style="width: 12em;" |Identifier
 +
!style="width: 6em;" |Type
 +
!Description
 
|-
 
|-
|<center>512</center>||<center>{{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 0000 0010 0000 0000</code></center>||Object is breakable (like glass &ndash; additional parameters defined inside the [[object.dat]] file, otherwise there is no effect).
+
|A ||ModelName ||string ||Name of the <code>.wdr</code> ''model file'' without extension.
 
|-
 
|-
|<center>1024</center>||<center>{{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 0000 0100 0000 0000</code></center>||Similar to flag '''512''': object first cracks on a strong collision, then it breaks (does also require ''object.dat'' registration).
+
|B ||TxdName ||string ||name of the <code>.wtd</code> ''texture dictionary'' without extension.
 
|-
 
|-
|<center>2048</center>||<center>{{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 0000 1000 0000 0000</code></center>||Indicates an object as an garage door (for more information see [[GRGE#Types_of_doors|GRGE]] &ndash; requires ''object.dat'' registration).
+
|C ||DrawDistance ||float ||Draw distance in units.
 
|-
 
|-
|<center>4096</center>||<center>{{Icon|SA}}</center>||<center><code>0000 0000 0001 0000 0000 0000</code></center>||Indicates an [[RenderWare_binary_stream_file|multiclump]] object (Object switches from clump ''2'' to clump ''1'' after collision &ndash; requires ''object.dat'' registration).
+
|D ||Flags ||integer ||[[Item Definition#IDE Flags|Object flag]]
 
|-
 
|-
|<center>32768</center>||<center>{{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 1000 0000 0000 0000</code></center>||Uses object brightness from the current weather definition (See [[timecyc.dat]] &ndash; ''PoleShd'').
+
|E ||''unknown'' ||float ||Unknown integer (0 by default).
 
|-
 
|-
|<center>65536</center>||<center>{{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0001 0000 0000 0000 0000</code></center>||Object explodes after getting hit (requires ''object.dat'' registration).
+
|F,G,H ||MinX, MinY, MinZ ||float[3] ||Lower left corner of the bounding box for the object.
 
|-
 
|-
|<center>131072</center>||<center>{{Icon|SA}}</center>||<center><code>0000 0010 0000 0000 0000 0000</code></center>||Unknown &ndash; apparently some flag for the [[SCM|Script]].
+
|I,J,K ||MaxX, MaxY, MaxZ ||float[3] ||Upper right corner of the bounding box for the object.
 
|-
 
|-
|<center>262144</center>||<center>{{Icon|SA}}</center>||<center><code>0000 0100 0000 0000 0000 0000</code></center>||Unknown &ndash; only used 1 time in [[GTA SA|San Andreas]].
+
|L,M,N ||SphereX, SphereY, SphereZ ||float[3] ||Center of the bounding sphere for the object.
 
|-
 
|-
|<center>1048576</center>||<center>{{Icon|SA}}</center>||<center><code>0000 1000 0000 0000 0000 0000</code></center>||Object will switch from clump ''2'' to clump ''1'' after getting sprayed by the player (graffity flag).
+
|O ||Radius ||float ||Radius of the bounding sphere into all dimensions.
 
|-
 
|-
|<center>2097152</center>||<center>{{Icon|SA}}</center>||<center><code>0001 0000 0000 0000 0000 0000</code></center>||Disables backface culling &ndash; as an result the texture will be drawed on both sides of the model (Always enabled for GTA III and [[GTA VC|Vice City]])
+
|P ||LODModel||string ||Name of the <code>[[WDD|.wdd]]</code> file that contains the ''lod model'' for the defined modelname.
 
|-
 
|-
|<center>4194304</center>||<center>{{Icon|SA}}</center>||<center><code>0010 0000 0000 0000 0000 0000</code></center>||Unknown &ndash; apparently related into physics.
+
|Q ||ActiveHours||integer ||Hours of the day where the model is active as a bit field. with the first bit being midnight and the 24th 11PM.
 
|}
 
|}
  
== See also ==
+
== Statistics ==
* [[Item definition]]
+
Total number of <code>tobj</code> entries in:
* [[OBJS]]
+
:GTA III: 24 (max 30)
* [[TANM]]
+
:Vice City: 342 (max 385)
 +
:San Andreas: 160
 +
:GTA IV: 1558
  
[[Category:GTA 3]][[Category:GTA VC]]
+
{{N|4|LCS|SA|VC|3}}
{{N|4|SA}}
+
[[Category:GTA LCS]]

Latest revision as of 19:35, 29 September 2024

TOBJ (IDE section)
Supported games:GTA III Vice City San Andreas Liberty City Stories GTA IV
Brief description:Defines timed map objects
IDE Sections:
2DFX AMAT ANIM CARS HIER HAND MLO OBJS
PATH PEDS TANM TOBJ TREE TXDP WEAP

tobj is a section in the item definition file in GTA III, Vice City, San Andreas, Liberty City Stories, and GTA IV. It is used to define standard map objects similar to the objs section with an additional in-game time range defining when the object gets rendered. GTA IV also support time controlled objects linked to animations through the tanm section. Most, if not all, time objects use the object flag 2 to prevent them from fading into and out of view at those times.

Format

GTA III – Liberty City Stories

tobj
# type 1 (III/VC/SA/LCS)
Id, ModelName, TxdName, MeshCount, DrawDistance, Flags, TimeOn, TimeOff
# type 2 (III/VC/SA/LCS)
Id, ModelName, TxdName, MeshCount, DrawDistance1, DrawDistance2, Flags, TimeOn, TimeOff
# type 3 (III/VC/SA/LCS)
Id, ModelName, TxdName, MeshCount, DrawDistance1, DrawDistance2, DrawDistance3, Flags, TimeOn, TimeOff
# type 4 (SA)
Id, ModelName, TxdName, DrawDistance, Flags, TimeOn, TimeOff
end

Type 1

This is used for non-breakable objects.

GTA III Vice City
San Andreas Liberty City Stories
Identifier Type Description
A Id integer Unique object identifier.
B ModelName string Name of the model file without extension.
C TxdName string Name of the texture dictionary without extension.
D MeshCount integer Number of meshes. 1 for this type.
E DrawDistance float Draw distance in units.
F Flags integer Object flags
G TimeOn integer Hour to appear
H TimeOff integer Hour to disappear

Type 2

This is used for breakable objects.

GTA III Vice City
San Andreas Liberty City Stories
Identifier Type Description
A Id integer Unique object identifier.
B ModelName string Name of the model file without extension.
C TxdName string Name of the texture dictionary without extension.
D MeshCount integer Number of meshes. 2 for this type.
E,F DrawDistance1, DrawDistance2 float[2] Draw distance in units (one for each mesh, only the first is actually used).
G Flags integer Object flags
H TimeOn integer Hour to appear
I TimeOff integer Hour to disappear

Type 3

This is used for complex breakable objects.

GTA III Vice City
San Andreas Liberty City Stories
Identifier Type Description
A Id integer Unique object identifier.
B ModelName string Name of the model file without extension.
C TxdName string Name of the texture dictionary without extension.
D MeshCount integer Number of meshes. 3 for this type.
E,F,G DrawDistance1, DrawDistance2, DrawDistance3 float[3] Draw distance in units (one for each mesh, only the first is actually used).
H Flags integer Object flags
I TimeOn integer Hour to appear
J TimeOff integer Hour to disappear

Type 4

This is used for non-breakable objects and behaves equivalently to Type 1.

San Andreas Identifier Type Description
A Id integer Unique object identifier.
B ModelName string Name of the model file without extension.
C TxdName string Name of the texture dictionary without extension.
D DrawDistance float Draw distance in units.
E Flags integer Object flags
F TimeOn integer Hour to appear
G TimeOff integer Hour to disappear

GTA IV

tobj
ModelName, TxdName, DrawDistance, Flags, Unknown, MinX, MinY, MinZ, MaxX, MaxY, MaxZ, SphereX, SphereY, SphereZ, Radius, LODModel, NightFlag
end
GTA IV Identifier Type Description
A ModelName string Name of the .wdr model file without extension.
B TxdName string name of the .wtd texture dictionary without extension.
C DrawDistance float Draw distance in units.
D Flags integer Object flag
E unknown float Unknown integer (0 by default).
F,G,H MinX, MinY, MinZ float[3] Lower left corner of the bounding box for the object.
I,J,K MaxX, MaxY, MaxZ float[3] Upper right corner of the bounding box for the object.
L,M,N SphereX, SphereY, SphereZ float[3] Center of the bounding sphere for the object.
O Radius float Radius of the bounding sphere into all dimensions.
P LODModel string Name of the .wdd file that contains the lod model for the defined modelname.
Q ActiveHours integer Hours of the day where the model is active as a bit field. with the first bit being midnight and the 24th 11PM.

Statistics

Total number of tobj entries in:

GTA III: 24 (max 30)
Vice City: 342 (max 385)
San Andreas: 160
GTA IV: 1558