OBJS: Difference between revisions

No edit summary
(contributions from myself, Aschratt, and LINK2012)
Line 1: Line 1:
{{Research}}
{{Research}}
{{IdeSection
{{IdeSection
| game        = [[Grand Theft Auto III|GTA III]], [[Grand Theft Auto: Vice City|GTA VC]], [[Grand Theft Auto: San Andreas|GTA SA]], [[Grand Theft Auto IV|GTA IV]]
|game        = {{Icon-square|t}} {{Icon-square|4}}
| description = Used to define standard static map objects
|description = Defines simple objects
}}
}}
'''OBJS''' is a section in the [[IDE|item definition]] file. It is used to define standard static map objects.
'''<code>objs</code>''' is a section in the item definition file in [[Grand Theft Auto III]], [[Grand Theft Auto: Vice City]], [[Grand Theft Auto: San Andreas]], and [[Grand Theft Auto IV]]. It is used to define simple objects. There are also sections to extend default object definitions:


==GTA III - San Andreas==
* <code>[[TOBJ|tobj]]</code> for defining an additional ingame time range the object gets rendered in.
===Format===
* <code>[[ANIM|anim]]</code> which links an animation to an object.
ID, ModelName, TextureName, ObjectCount, DrawDist, [DrawDist2, ...], Flags
* <code>[[TANM|tanm]]</code> which does both of the previously mentioned sections.


{|class="prettytable" width="100%"
== Format ==
!width="250px"|Identifier
=== GTA III, GTA Vice City, and GTA San Andreas ===
{{Pre|
objs
# [[#Type 1|type 1]] (III/VC/SA)
Id, ModelName, TxdName, MeshCount, DrawDistance, Flags
# [[#Type 2|type 2]] (III/VC/SA)
Id, ModelName, TxdName, MeshCount, DrawDistance1, DrawDistance2, Flags
# [[#Type 3|type 3]] (III/VC/SA)
Id, ModelName, TxdName, MeshCount, DrawDistance1, DrawDistance2, DrawDistance3, Flags
# [[#Type 4|type 4]] (SA)
Id, ModelName, TxdName, DrawDistance, Flags
end
}}
 
====Type 1====
This is used for non-breakable objects.
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
!style="width: 4em;" |{{Icon-square|t}}
!style="width: 12em;" |Identifier
!style="width: 6em;" |Type
!Description
!Description
|-
|-
|<center>ID</center>||unique object ID (integer)
|A ||Id ||integer ||Unique object identifier.
|-
|-
|<center>ModelName</center>||name of the .dff [[DFF|model file]], without extension (string)
|B ||ModelName ||string ||Name of the <code>.dff</code> model file without extension.
|-
|-
|<center>TextureName</center>||name of the .txd [[TXD|texture dictionary]], without extension (string)
|C ||TxdName ||string ||Name of the <code>.txd</code> texture dictionary without extension.
|-
|-
|<center>ObjectCount</center>||amount of sub objects, e.g. damaged parts, usually 1 (integer) - '''''optional for SA, default 1'''''
|D ||MeshCount ||integer ||Number of meshes. 1 for this type.
|-
|-
|<center>DrawDist</center>||[[draw distance]] in [[unit]]s, one for each sub object (float)
|E ||DrawDistance ||float ||Draw distance in [[unit]]s.
|-
|-
|<center>Flags</center>||object flags, defining special behavior, default 0 (integer)
|F ||Flags ||integer ||Object flags.
|}
|}


===Object Flags===
====Type 2====
Object Flags in SA are text formatted UInt32-Values (Like nearly all other Flags).
This is used for breakable objects.
To understand them better you have to calculate them to binary numbers. Then You will get the Bitsets of the Flags.
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
1 means Enabled, 0 disabled.
!style="width: 4em;" |{{Icon-square|t}}
 
!style="width: 12em;" |Identifier
List of all known flags for San Andreas:
!style="width: 6em;" |Type
 
{|class="prettytable" width="100%" class="collapsible collapsed"
!width="25%"|Binary
!width="5%"|Decimal
!Description
!Description
|-
|-
|0000000000000000000000000000001||1||Wet Effect
|A ||Id ||integer ||Unique object identifier.
|-
|-
|0000000000000000000000000000010||2||Time Object Night Flag
|B ||ModelName ||string ||Name of the <code>.dff</code> model file without extension.
|-
|-
|0000000000000000000000000000100||4||ALPHA Transparency 1
|C ||TxdName ||string ||Name of the <code>.txd</code> texture dictionary without extension.
|-
|-
|0000000000000000000000000001000||8||ALPHA Transparency 2 *
|D ||MeshCount ||integer ||Number of meshes. 2 for this type.
|-
|E,F ||DrawDistance1, DrawDistance2 ||float[2] ||Draw distance in [[unit]]s (one for each mesh, only the first is actually used).
|-
|G ||Flags ||integer ||Object flags.
|}
 
====Type 3====
This is used for complex breakable objects.
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
!style="width: 4em;" |{{Icon-square|t}}
!style="width: 12em;" |Identifier
!style="width: 6em;" |Type
!Description
|-
|-
|0000000000000000000000000010000||16||Time Object Day Flag
|A ||Id ||integer ||Unique object identifier.
|-
|-
|0000000000000000000000000100000||32||Interior-Object **
|B ||ModelName ||string ||Name of the <code>.dff</code> model file without extension.
|-
|-
|0000000000000000000000001000000||64||Disable Shadow Mesh
|C ||TxdName ||string ||Name of the <code>.txd</code> texture dictionary without extension.
|-
|-
|0000000000000000000000010000000||128||Excludes object from culling
|D ||MeshCount ||integer ||Number of meshes. 3 for this type.
|-
|-
|0000000000000000000000100000000||256||Disable Draw Distance for LODs
|E,F,G ||DrawDistance1, DrawDistance2, DrawDistance3 ||float[3] ||Draw distance in [[unit]]s (one for each mesh, only the first is actually used).
|-
|-
|0000000000000000000001000000000||512||Breakable Glass **
|H ||Flags ||integer ||Object flags.
|}
 
====Type 4====
This is used for non-breakable objects and behaves equivalently to [[#Type 1|Type 1]].
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
!style="width: 3em;" |{{Icon-square|sa}}
!style="width: 12em;" |Identifier
!style="width: 6em;" |Type
!Description
|-
|-
|0000000000000000000010000000000||1024||Breakable Glass with crack **
|A ||Id ||integer ||Unique object identifier.
|-
|-
|0000000000000000000100000000000||2048||Garage door **
|B ||ModelName ||string ||Name of the <code>.dff</code> model file without extension.
|-
|-
|0000000000000000001000000000000||4096||2-Clump-Object ** (Switches from Clump 2 to 1 after Collision)
|C ||TxdName ||string ||Name of the <code>.txd</code> texture dictionary without extension.
|-
|-
|0000000000000000010000000000000||8192||Small Vegetation. Object sways in strong wind  (?)
|D ||DrawDistance ||float ||Draw distance in [[unit]]s.
|-
|-
|0000000000000000100000000000000||16384||Standard Vegetation **  (Palms in Hotels, etc.) (?)
|E ||Flags ||integer ||Object flags.
|}
 
=== GTA IV ===
{{Pre|
objs
ModelName, TxdName, DrawDistance, Flag, unknown, MinX, MinY, MinZ, MaxX, MaxY, MaxZ, SphereX, SphereY, SphereZ, Radius, LODModel
end
}}
==== Type 1 ====
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
!style="width: 3em;" |{{Icon-square|4}}
!style="width: 12em;" |Identifier
!style="width: 6em;" |Type
!Description
|-
|-
|0000000000000001000000000000000||32768||Use timecycle PoleShadow flag
|A ||ModelName ||string ||Name of the <code>[[WDR|.wdr]]</code> model file without extension.
|-
|-
|0000000000000010000000000000000||65536||Explosive-Flag **
|B ||TxdName ||string ||Name of the <code>.wtd</code> texture dictionary without extension.
|-
|-
|0000000000000100000000000000000||131072||UNKNOWN (Seems to be an SCM Flag) (?)
|C ||DrawDistance ||float ||Draw distance in units.
|-
|-
|0000000000001000000000000000000||262144||UNKNOWN (1 Object in Jizzy`s Club) (?)
|D ||Flag ||integer ||Object flag.
|-
|-
|0000000000010000000000000000000||524288||UNKNOWN (?)
|E ||''unknown'' ||float ||Unknown integer (usually 0 but uses other values as high as 32).
|-
|-
|0000000000100000000000000000000||1048576||Graffiti Flag
|F,G,H ||MinX, MinY, MinZ ||float[3] ||Lower left corner of the bounding box for the object.
|-
|-
|0000000001000000000000000000000||2097152||Disable backface culling
|I,J,K ||MaxX, MaxY, MaxZ ||float[3] ||Upper right corner of the bounding box for the object.
|-
|-
|0000000010000000000000000000000||4194304||UNKNOWN (Parts of a statue in Atrium) (?)
|L,M,N ||SphereX, SphereY, SphereZ ||float[3] ||Center of the bounding sphere for the object.
|-
|-
|...||||All flags in this range are unused/unknown
|O ||Radius ||float ||Radius of the bounding sphere into all dimensions.
|-
|-
|1000000000000000000000000000000||1073741824||Unknown
|P ||LODModel ||string ||Name of the <code>[[WDD|.wdd]]</code> file that contains the ''lod model'' for the defined modelname; otherwise ''null''.
|}
|}


* If there's no Interior the Texture behind the object changes to black (=> IPL | Interior-value)
GTA IV stores bounding information inside the ''item definitions'' for better performance. The previous games stored bounding information inside the [[COLL|collision]] files. Also it uses the hashes of the model names as a key of an hash table instead of the ID as an index to the definition array for previous games.
** Objects needs to be activated using Object.dat
(?) Not 100 % known
 
To connect different flags you have to add the bit which belongs to the flag. Its the same as adding one value to another..  


1 + 2 + 16 = 19
== Statistics ==
1 2 = 3
Total number of <code>objs</code> entries in:
:GTA III: 2908 (max 5000)
::Type 1: 2844
::Type 2: 63
::Type 3: 1


==GTA IV==
:GTA Vice City: 3800 (max 3885)
ModelName, TextureName, DrawDistance, Flag1, Flag2, (Bounds min)X,Y,Z, (Bounds max)X,Y,Z, (Bounds Sphere)X, Y, Z, Radius, WDD
::Type 1: 3761
::Type 2: 38
::Type 3: 1


Note that GTA IV does not use any unique object ID numbers
:GTA San Andreas: 14052
::Type 1: 1
::Type 4: 14051


{|class="prettytable" width="100%"
:GTA IV: 24820
!width="250px"|Identifier
!Description
|-
|<center>ModelName</center>||name of the .wdr [[DFF|model file]], without extension (string)
|-
|<center>TextureName</center>||name of the .wtd [[TXD|texture dictionary]], without extension (string)
|-
|<center>DrawDistance</center>||[[draw distance]] in [[unit]]s, one for each sub object (float)
|-
|<center>Flag1</center>||object flag, defining special behavior
|-
|<center>Flag2</center>||object flag, defining special behavior, default 0 (integer)
|-
|<center>Bounds Min</center>||Lower Left vertex local position of a model bounding box
|-
|<center>Bounds Max</center>||Upper Right vertex local position of a model bounding box
|-
|<center>Radius</center>||Radius dimensions of the bounding Sphere
|-
|<center>WDD</center>||the model dictionary file that contains the LOD model for the defined Modelname
|}


{{fdl}}
{{fdl}}


{{modding}}
{{modding}}
[[Category:GTA III Modifications]]
[[Category:GTA Vice City]]
[[Category:Modifications]]