Difference between revisions of "INST"

From GTAMods Wiki
Jump to navigation Jump to search
m
(INST flags doc table)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{File-stub}}
 
 
{{IplSection
 
{{IplSection
| game        = [[GTA III]], [[GTA VC]], [[GTA SA]], [[GTA IV]]
+
| game        = {{Icon|t}} {{Icon|4}}
 
| description = Used to place objects in the world
 
| description = Used to place objects in the world
 
}}
 
}}
'''INST''' is one of the [[IPL]] sections. It is used to place [[OBJS|static]], [[object.dat|dynamic]], [[TOBJ|time controlled]] and [[ANIM|animated]] objects in the world. It is supported by all major PC versions of the GTA 3D series but its format differs slightly between the games.
+
'''INST''' is a section in the [[item placement]] file in [[GTA III]], [[Vice City]], [[San Andreas]], and [[GTA IV]]. It is used to place [[OBJS|static]], [[object.dat|dynamic]], [[TOBJ|time controlled]] and [[ANIM|animated]] objects in the world. It is supported by all major PC versions of the GTA 3D series but its format differs slightly between the games.
  
 
== Format ==
 
== Format ==
===GTA III format===
+
=== GTA III and Vice City ===
ID, ModelName, PosX, PosY, PosZ, ScaleX, ScaleY, ScaleZ, RotX, RotY, RotZ, RotW
+
{{Pre|
 +
inst
 +
Id, ModelName, PosX, PosY, PosZ, ScaleX, ScaleY, ScaleZ, RotX, RotY, RotZ, RotW
 +
end
 +
}}
  
{|{{Prettytable}} width="100%" class="collapsible"
+
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
!width="250px"|Identifier
+
! style="width: 3em;"| {{Icon|3}} {{Icon|VC}}
!Description
+
! style="width: 12em;"| Identifier
 +
! style="width: 6em;" | Type
 +
! Description
 
|-
 
|-
|<center>ID</center>||A number which is used to identify the object as defined in the [[IDE]] file inside the map system.
+
|A ||Id ||integer ||A number which is used to identify the object as defined in the [[IDE]] file inside the map system.
 
|-
 
|-
|<center>ModelName</center>||The name of the model inside an [[IMG|image]] file which is defined in the [[gta.dat]] file without extension (<code>.[[DFF|dff]]</code>)
+
|B ||ModelName ||string ||The name of the model inside an [[IMG|image]] file which is defined in the [[gta.dat]] file without extension (<code>.[[DFF|dff]]</code>)
 
|-
 
|-
|<center>PosX, PosY, PosZ</center>||The position of the object in the world as floating point values.<br>''Note:'' the decimal seperator must be ".", not ",".
+
|C,D,E ||PosX, PosY, PosZ ||float[3] ||The position of the object in the world as floating point values.<br>''Note:'' the decimal seperator must be ".", not ",".
 
|-
 
|-
|<center>ScaleX, ScaleY, ScaleZ</center>||The scaling of the object as floating point values. By default each value is ''1.0'', which means the object is not scaled at all.<br>''Note:'' the decimal seperator must be ".", not ",".
+
|F,G,H ||ScaleX, ScaleY, ScaleZ ||float[3] ||The scaling of the object as floating point values. By default each value is ''1.0'', which means the object is not scaled at all.<br>''Note:'' the decimal seperator must be ".", not ",".
 
|-
 
|-
|<center>RotX, RotY, RotZ, RotW</center>||The rotation of the object as [[Wikipedia:Quarternion|quarternion]].<br>''Note:'' the decimal seperator must be ".", not ",".
+
|I,J,K,L ||RotX, RotY, RotZ, RotW ||float[4] ||The rotation of the object as [[Wikipedia:Quarternion|quarternion]].<br>''Note:'' the decimal seperator must be ".", not ",".
 
|}
 
|}
  
===GTA VC format===
+
Note that if this format is used in Vice City, the interior of the object defaults to 0.
  
ID, ModelName, Interior, PosX, PosY, PosZ, ScaleX, ScaleY, ScaleZ, RotX, RotY, RotZ, RotW
+
=== Vice City ===
 +
{{Pre|
 +
inst
 +
Id, ModelName, Interior, PosX, PosY, PosZ, ScaleX, ScaleY, ScaleZ, RotX, RotY, RotZ, RotW
 +
end
 +
}}
  
{|{{Prettytable}} width="100%" class="collapsible"
+
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
!width="250px"|Identifier
+
! style="width: 3em;"| {{Icon|VC}}
!Description
+
! style="width: 12em;"| Identifier
 +
! style="width: 6em;" | Type
 +
! Description
 
|-
 
|-
|<center>ID</center>||A number which is used to identify the object as defined in the [[IDE]] inside the map system.
+
|A ||Id ||integer ||A number which is used to identify the object as defined in the [[IDE]] file inside the map system.
 
|-
 
|-
|<center>ModelName</center>||The name of the model inside an [[IMG|image]] file which is defined in the [[gta.dat]] file without extension (<code>.[[DFF|dff]]</code>)
+
|B ||ModelName ||string ||The name of the model inside an [[IMG|image]] file which is defined in the [[gta.dat]] file without extension (<code>.[[DFF|dff]]</code>)
 
|-
 
|-
|<center>Interior</center>||A number defining the [[interior]] (render-level) the object is located in. It is an optional parameter; by default the object's interior is 0.
+
|C ||Interior ||float ||A number defining the [[interior]] (render-level) the object is located in.
 
|-
 
|-
|<center>PosX, PosY, PosZ</center>||The position of the object in the world as floating point values.
+
|D,E,F ||PosX, PosY, PosZ ||float[3] ||The position of the object in the world as floating point values.<br>''Note:'' the decimal seperator must be ".", not ",".
 
|-
 
|-
|<center>ScaleX, ScaleY, ScaleZ</center>||The scaling of the object as floating point values. By default each value is ''1.0'', which means the object is not scaled at all.
+
|G,H,I ||ScaleX, ScaleY, ScaleZ ||float[3] ||The scaling of the object as floating point values. By default each value is ''1.0'', which means the object is not scaled at all.<br>''Note:'' the decimal seperator must be ".", not ",".
 
|-
 
|-
|<center>RotX, RotY, RotZ, RotW</center>||The rotation of the object as [[Wikipedia:Quarternion|quarternion]].
+
|J,K,L,M ||RotX, RotY, RotZ, RotW ||float[4] ||The rotation of the object as [[Wikipedia:Quarternion|quarternion]].<br>''Note:'' the decimal seperator must be ".", not ",".
 
|}
 
|}
  
===GTA SA format===
+
=== San Andreas ===
 
+
{{Pre|
ID, ModelName, Interior, PosX, PosY, PosZ, RotX, RotY, RotZ, RotW, LOD
+
inst
 +
Id, ModelName, Flags/Interior, PosX, PosY, PosZ, RotX, RotY, RotZ, RotW, LOD
 +
end
 +
}}
  
{|{{Prettytable}} width="100%" class="collapsible"
+
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
!width="250px"|Identifier
+
! style="width: 3em;"| {{Icon|SA}}
!Description
+
! style="width: 12em;"| Identifier
|-
+
! style="width: 6em;" | Type
|<center>ID</center>||A number which is used to identify the object as defined in the [[IDE]] inside the map system.
+
! Description
 
|-
 
|-
|<center>ModelName</center>||The name of the model inside an [[IMG|image]] file which is defined in the [[gta.dat]] file without extension (<code>.[[DFF|dff]]</code>). The parameter doesn't seem to function in the game. Any name used will not affect the rendering of the model.
+
|A ||Id ||integer ||A number which is used to identify the object as defined in the [[IDE]] inside the map system.
 
|-
 
|-
|<center>Interior</center>||A number defining the [[interior]] (render-level) the object is located in.
+
|B ||ModelName ||string ||The name of the model inside an [[IMG|image]] file which is defined in the [[gta.dat]] file without extension (<code>.[[DFF|dff]]</code>). The parameter doesn't seem to function in the game. Any name used will not affect the rendering of the model.
 
|-
 
|-
|<center>PosX, PosY, PosZ</center>||The position of the object in the world as floating point values.
+
|C ||Flags / Interior ||integer || Flags for specific object instance. First byte is used for defining the [[interior]] (render-level) the object is located in.
 
|-
 
|-
|<center>RotX, RotY, RotZ, RotW</center>||The rotation of the object as [[Wikipedia:Quarternion|quarternion]].<br>''Note:'' the decimal seperator must be ".", not ",".
+
|D,E,F ||PosX, PosY, PosZ ||float[3] ||The position of the object in the world as floating point values.
 
|-
 
|-
|<center>LOD</center>||The number of the [[LOD]] which is located inside the same instance block as the current model.<br>By default this is ''-1'' which means no LOD is defined.{{Ref|1}}
+
|G,H,I,J ||RotX, RotY, RotZ, RotW ||float[4] ||The rotation of the object as [[Wikipedia:Quarternion|quarternion]].<br>''Note:'' the decimal seperator must be ".", not ",".
 
|-
 
|-
 +
|K ||LOD ||integer ||The number of the [[LOD]] which is located inside the same instance block as the current model.<br>By default this is ''-1'' which means no LOD is defined.{{Ref|1}}
 
|}
 
|}
  
 
==== Binary Format ====
 
==== Binary Format ====
  
''INST'' is also one of the known sections which can be used in binary format inside [[Binary IPL|streaming IPLs]]. For detailed information about the format see the [[Binary_IPL#INST_Structure|format specification]] in the supposed article.
+
''INST'' is also one of the known sections which can be used in binary format inside streaming files. Its format is similar to the plain text format:
 +
 
 +
4b  - FLOAT    - Position X
 +
4b  - FLOAT    - Position Y
 +
4b  - FLOAT    - Position Z
 +
4b  - FLOAT    - Rotation X
 +
4b  - FLOAT    - Rotation Y
 +
4b  - FLOAT    - Rotation Z
 +
4b  - FLOAT    - Rotation W
 +
4b  - INT32    - Object ID (as an index to the ''IDE'')
 +
4b  - INT32    - Flags / Interior (first byte used as interior (visible area))
 +
4b  - INT32    - ''LOD'' index
 +
 
 +
==== Flags ====
 +
 
 +
San Andreas also includes flags in addition to the interior ID for ''INST'' lines. First byte is used for interior ID, so there is no flags for first bits.
 +
 
 +
{| class="wikitable"
 +
! Bits !! Dec !! Hex !! Description !! Examples
 +
|-
 +
| 8 || 256 || 0x100 || Unimportant || Mostly telegraph poles and other props
 +
|-
 +
| 9 || 512 || 0x200 || Force the use of matrix rotation, even if XY rotation is low || Props with XY rotation
 +
|-
 +
| 10 || 1024 || 0x400 || Underwater || Land masses, touching or bellow water
 +
|-
 +
| 11 || 2048 || 0x800 || Underground || Tunnels
 +
|-
 +
| 12 || 4096 || 0x1000 || Underground top || Tunnel entrances and roof
 +
|}
  
 
===GTA IV format===
 
===GTA IV format===
Line 79: Line 124:
 
Each game has different limitations. The most important limit for the instance section is the so-called ''map boundary'', which is a notional boundary around the map. Outside those borders no objects will be visible. If an object is intersecting the bounds it may be displayed incorrectly.
 
Each game has different limitations. The most important limit for the instance section is the so-called ''map boundary'', which is a notional boundary around the map. Outside those borders no objects will be visible. If an object is intersecting the bounds it may be displayed incorrectly.
  
{|{{Prettytable}} class="collapsible"
+
{|class="wikitable"
 
! Game
 
! Game
 
! Mapping Boundary
 
! Mapping Boundary
Line 99: Line 144:
 
* {{GTAF|118193|GTA III/Vice City mapping formats}}
 
* {{GTAF|118193|GTA III/Vice City mapping formats}}
  
{{N|4|SA}}
+
{{N|4|SA|VC|3}}
 
 
[[Category:GTA 3]][[Category:GTA VC]]
 

Latest revision as of 23:20, 6 July 2021

INST (IPL section)
Short description:Used to place objects in the world
Supported games:GTA III Vice City San Andreas GTA IV
IPL Sections:
2DFX AUZO BLOK CARS CULL ENEX GRGE
INST JUMP LINK LODM MLO+ MULT OCCL
PATH PICK RTFX SLOW TCYC VNOD ZONE

INST is a section in the item placement file in GTA III, Vice City, San Andreas, and GTA IV. It is used to place static, dynamic, time controlled and animated objects in the world. It is supported by all major PC versions of the GTA 3D series but its format differs slightly between the games.

Format

GTA III and Vice City

inst
Id, ModelName, PosX, PosY, PosZ, ScaleX, ScaleY, ScaleZ, RotX, RotY, RotZ, RotW
end
GTA III Vice City Identifier Type Description
A Id integer A number which is used to identify the object as defined in the IDE file inside the map system.
B ModelName string The name of the model inside an image file which is defined in the gta.dat file without extension (.dff)
C,D,E PosX, PosY, PosZ float[3] The position of the object in the world as floating point values.
Note: the decimal seperator must be ".", not ",".
F,G,H ScaleX, ScaleY, ScaleZ float[3] The scaling of the object as floating point values. By default each value is 1.0, which means the object is not scaled at all.
Note: the decimal seperator must be ".", not ",".
I,J,K,L RotX, RotY, RotZ, RotW float[4] The rotation of the object as quarternion.
Note: the decimal seperator must be ".", not ",".

Note that if this format is used in Vice City, the interior of the object defaults to 0.

Vice City

inst
Id, ModelName, Interior, PosX, PosY, PosZ, ScaleX, ScaleY, ScaleZ, RotX, RotY, RotZ, RotW
end
Vice City Identifier Type Description
A Id integer A number which is used to identify the object as defined in the IDE file inside the map system.
B ModelName string The name of the model inside an image file which is defined in the gta.dat file without extension (.dff)
C Interior float A number defining the interior (render-level) the object is located in.
D,E,F PosX, PosY, PosZ float[3] The position of the object in the world as floating point values.
Note: the decimal seperator must be ".", not ",".
G,H,I ScaleX, ScaleY, ScaleZ float[3] The scaling of the object as floating point values. By default each value is 1.0, which means the object is not scaled at all.
Note: the decimal seperator must be ".", not ",".
J,K,L,M RotX, RotY, RotZ, RotW float[4] The rotation of the object as quarternion.
Note: the decimal seperator must be ".", not ",".

San Andreas

inst
Id, ModelName, Flags/Interior, PosX, PosY, PosZ, RotX, RotY, RotZ, RotW, LOD
end
San Andreas Identifier Type Description
A Id integer A number which is used to identify the object as defined in the IDE inside the map system.
B ModelName string The name of the model inside an image file which is defined in the gta.dat file without extension (.dff). The parameter doesn't seem to function in the game. Any name used will not affect the rendering of the model.
C Flags / Interior integer Flags for specific object instance. First byte is used for defining the interior (render-level) the object is located in.
D,E,F PosX, PosY, PosZ float[3] The position of the object in the world as floating point values.
G,H,I,J RotX, RotY, RotZ, RotW float[4] The rotation of the object as quarternion.
Note: the decimal seperator must be ".", not ",".
K LOD integer The number of the LOD which is located inside the same instance block as the current model.
By default this is -1 which means no LOD is defined.[1]

Binary Format

INST is also one of the known sections which can be used in binary format inside streaming files. Its format is similar to the plain text format:

4b  - FLOAT    - Position X
4b  - FLOAT    - Position Y
4b  - FLOAT    - Position Z
4b  - FLOAT    - Rotation X
4b  - FLOAT    - Rotation Y
4b  - FLOAT    - Rotation Z
4b  - FLOAT    - Rotation W
4b  - INT32    - Object ID (as an index to the IDE)
4b  - INT32    - Flags / Interior (first byte used as interior (visible area))
4b  - INT32    - LOD index

Flags

San Andreas also includes flags in addition to the interior ID for INST lines. First byte is used for interior ID, so there is no flags for first bits.

Bits Dec Hex Description Examples
8 256 0x100 Unimportant Mostly telegraph poles and other props
9 512 0x200 Force the use of matrix rotation, even if XY rotation is low Props with XY rotation
10 1024 0x400 Underwater Land masses, touching or bellow water
11 2048 0x800 Underground Tunnels
12 4096 0x1000 Underground top Tunnel entrances and roof

GTA IV format

Limitations

Each game has different limitations. The most important limit for the instance section is the so-called map boundary, which is a notional boundary around the map. Outside those borders no objects will be visible. If an object is intersecting the bounds it may be displayed incorrectly.

Game Mapping Boundary
San Andreas
San Andreas has a square (or cube) as the major limit. Its dimension is 3000.0 units away from the origin point.
This limit can be increased using the SA Limit Adjuster by Sacky

Related tools

See also

External links