Difference between revisions of "CARS (IDE Section)"

From GTAMods Wiki
Jump to navigation Jump to search
m (San Andreas)
(Vice City)
 
(28 intermediate revisions by 9 users not shown)
Line 2: Line 2:
 
{{This|CARS redirects here. For the IPL section see [[CARS (IPL Section)]]}}
 
{{This|CARS redirects here. For the IPL section see [[CARS (IPL Section)]]}}
 
{{IdeSection
 
{{IdeSection
| name        = CARS
+
|name        = CARS
| game        = [[GTA III]], [[GTA VC]], [[GTA SA]], [[GTA IV]]
+
|game        = {{Icon|t}} {{Icon|4}}
| description = Used to define vehicles
+
|description = Used to define vehicles
 
}}
 
}}
'''CARS''' is a section in the [[item definition]] file. It is used to define vehicles and some their properties.
+
'''CARS''' is a section in the [[item definition]] file in [[GTA III]], [[Vice City]], [[San Andreas]], and [[GTA IV]]. It is used to define vehicles and some their properties.
  
 
== Format ==
 
== Format ==
 +
Between GTA III and San Andreas, the class of a vehicle helps determine where it should spawn, with the help of [[hardcoded]] features and the [[script]]. The ''ignore'' class is special for its ability to prevent vehicles assigned to that class from spawning as a regular NPC vehicle in traffic. Peds can be assigned to drive classes of vehicle in the [[PEDS]] section of the IDE file.
  
 
=== GTA III ===
 
=== GTA III ===
 +
This section is mainly used in the <code>{{Dir|3}}\data\default.ide</code> file. Each type of vehicle has its own format.
 +
{{Pre|
 +
cars
 +
# type car
 +
Id, ModelName, TxdName, Type, HandlingId, GameName, Class, Frq, Lvl, Comprules, WheelModelId, WheelScale
 +
# type boat
 +
Id, ModelName, TxdName, Type, HandlingId, GameName, Class, Frq, Lvl, Comprules
 +
# type train
 +
Id, ModelName, TxdName, Type, HandlingId, GameName, Class, Frq, Lvl, Comprules
 +
# type heli
 +
Id, ModelName, TxdName, Type, HandlingId, GameName, Class, Frq, Lvl, Comprules
 +
# type plane
 +
Id, ModelName, TxdName, Type, HandlingId, GameName, Class, Frq, Lvl, Comprules, LODModel
 +
end
 +
}}
  
This section is mainly used in the <code>../data/default.ide</code> file. Each type of vehicle has its own format.
+
{|class="wikitable center-col-1 center-col-2" width="100%"
 
+
!style="width: 3em;"|{{Icon|3}}
''Car''
+
!style="width: 12em;"|Identifier
ID, ModelName, TxdName, Type, HandlingID, GameName, Class, Frequency, Level, Comprules, WheelID, WheelScale
+
!style="width: 6em;" |Type
 
 
''Boat and Train''
 
ID, ModelName, TxdName, Type, HandlingID, GameName, Class, Frequency, Level, Comprules
 
 
 
''Plane''
 
ID, ModelName, TxdName, Type, HandlingID, GameName, Class, Frequency, Level, Comprules, LODModel
 
 
 
{|{{Prettytable}} width="100%"
 
!width="250px"|Identifier
 
 
!Description
 
!Description
 
|-
 
|-
|<center>ID</center>||Unique model ID
+
|A ||Id ||integer ||Unique object ID.
 
|-
 
|-
|<center>ModelName</center>||Name of the <code>.dff</code> [[model file]] without extension.
+
|B ||ModelName ||string ||Name of the <code>.dff</code> [[model file]] without extension.
 
|-
 
|-
|<center>TxdName</center>||Name of the <code>.txd</code> [[texture dictionary]] without extension.
+
|C ||TxdName ||string ||Name of the <code>.txd</code> [[texture dictionary]] without extension.
 
|-
 
|-
|<center>Type</center>||Type of vehicle, which includes ''car'', ''boat'', ''train'', and ''plane''<br>This data is related to hardcoded functions and must not be changed or else it might crash the game.
+
|D ||Type ||string ||Type of vehicle, which includes ''car'', ''boat'', ''train'', ''heli'' (NPC helicopter), ''plane'' (NPC plane), and ''bike''.<br>This data determines the class used to instantiate the vehicle and changing it may crash the game. The ''bike'' type is partially defined in the game code but cannot be used.
 
|-
 
|-
|<center>HandlingID</center>||Name corresponding to its handling data in the [[handling.cfg]] file
+
|E ||HandlingId ||string ||Name corresponding to its handling data in the <code>[[handling.cfg]]</code> file.
 
|-
 
|-
|<center>GameName</center>||Name corresponding to its [[GXT]] entry, case sensitive and must be seven characters or less!<br>Invalid name will show up as ''NAME missing''
+
|F ||GameName ||string ||Name corresponding to its [[GXT]] key, case sensitive and must be seven characters or less!<br>Vehicles with an invalid name will show up as ''MODELNAME missing'' when entered
 
|-
 
|-
|<center>Class</center>||Class of the vehicle (see [[CARS_(IDE_Section)#Vehicle_Classes|below]]).
+
|G ||Class ||string ||Class of the vehicle.
 +
* poorfamily
 +
* richfamily
 +
* executive
 +
* worker
 +
* special
 +
* big
 +
* taxi
 +
* ignore
 
|-
 
|-
|<center>Frequency</center>||Frequency of the vehicle spawning randomly on the streets.
+
|H ||Frq ||integer ||Frequency of the vehicle spawning randomly on the streets.
 
|-
 
|-
|<center>Level</center>||Unknown integer.
+
|I ||Lvl ||integer ||unknown <!--Island appearance-->
 
|-
 
|-
|<center>Comprules</center>||Unknown hexadecimal value.
+
|J ||Comprules ||hex ||Component rules, alters how vehicle models' "extras" behave, [[#Comprules|see below]] for list
 
|-
 
|-
|<center>WheelID</center>||ID number of wheel model<br>Only available for type ''car'', has no effect if used on type ''boat''.
+
|K ||{{a|l}} |
 +
* ''car'': WheelModelId
 +
* ''boat'': unused
 +
* ''train'': unused
 +
* ''heli'': unused
 +
* ''plane'': LODModel
 +
* ''bike'': unknown
 +
||integer ||
 +
* Model index of wheel model.
 +
* -
 +
* -
 +
* -
 +
* Model index of [[LOD]] model &ndash; can be any valid [[OBJS|object]].
 +
* unknown
 
|-
 
|-
|<center>WheelScale</center>||Scale of wheel and [[Collision File|collision]] models, 1.0 for original size of wheel and collision models<br>Only available for type ''car'', has no effect if used on type ''boat''.
+
|L ||{{a|l}} |
 +
* ''car'': WheelScale
 +
* ''boat'': unused
 +
* ''train'': unused
 +
* ''heli'': unused
 +
* ''plane'': unused
 +
* ''bike'': unknown
 +
||float ||
 +
* Scale of wheel and [[Collision File|collision]] models, 1.0 for original size of wheel and collision models
 +
* -
 +
* -
 +
* -
 +
* -
 +
* unknown
 +
|}
 +
 
 +
==== Comprules ====
 +
This is a list of all non-zero values used in the column.
 +
{|class="wikitable" width="100%"
 +
!style="width: 10em;" |Non-Zero Value
 +
!Effect
 +
!Vehicle(s)
 +
|-
 +
|0x1f10 ||Forces vehicle to always spawn with one of its first two extras. If a vehicle has more than two extras, one of the first two will always spawn and another extra also may spawn with either of the first two extras. Very rarely (likely due to a glitch) these vehicles can spawn without an extra. ||Taxi, Hoods Rumpo XL
 
|-
 
|-
|<center>LODModel</center>||ID number of [[LOD]] model &ndash; can be any valid [[OBJS|object]].<br>Only available for type ''plane''.
+
|0x2ff0 ||When it is raining, vehicle will spawn with its first extra. Vehicle may also spawn with other extras (if present in the model) in addition to the first extra. ||Stinger, Stallion
 
|}
 
|}
  
 
==== Wheels ====
 
==== Wheels ====
  
Wheel models are located in the <code>../models/generic/wheels.DFF</code> file. Their textures are located in the <code>../models/misc.txd</code> file. Just like the cars themselves they are defined inside the <code>../data/default.ide</code> file by default. The following table shows the different wheels and their ID's.
+
Wheel models are located in the <code>..\models\generic\wheels.DFF</code> file. Their textures are located in the <code>..\models\misc.txd</code> file. Just like the cars themselves they are defined inside the <code>..\data\default.ide</code> file by default. The following table shows the different wheels and their ID's.
  
{| {{prettytable}}
+
{|class="wikitable"
 
!ID
 
!ID
|align="center"|160
+
|{{a|c}}|160
|align="center"|161
+
|{{a|c}}|161
|align="center"|162
+
|{{a|c}}|162
|align="center"|163
+
|{{a|c}}|163
|align="center"|164
+
|{{a|c}}|164
|align="center"|165
+
|{{a|c}}|165
|align="center"|166
+
|{{a|c}}|166
 
|-
 
|-
 
!Image
 
!Image
Line 79: Line 130:
  
 
=== Vice City ===
 
=== Vice City ===
 +
By default all cars are defined inside the <code>{{Dir|vc}}\data\default.ide</code> file. From GTA III, type ''train'' becomes unused but ''bike'' is used.
  
By default all cars are defined inside the <code>../data/default.ide</code> file. Unlike ''GTA III'' there are the types ''bike'' and ''heli'' but ''train'' is missing or unused.
+
{{Pre|
 
+
cars
''Car''
+
# type car
ID, ModelName, TxdName, Type, HandlingID, GameName, Anims, Class, Frequency, Level, Comprules, WheelID, WheelScale
+
Id, ModelName, TxdName, Type, HandlingId, GameName, Anims, Class, Frq, Lvl, Comprules, WheelModelId, WheelScale
 
+
# type boat
''Bike''
+
Id, ModelName, TxdName, Type, HandlingId, GameName, Anims, Class, Frq, Lvl, Comprules
ID, ModelName, TxdName, Type, HandlingID, GameName, Anims, Class, Frequency, Level, Comprules, Unknown, WheelScale
+
# type heli
 
+
Id, ModelName, TxdName, Type, HandlingId, GameName, Anims, Class, Frq, Lvl, Comprules
''Boat and Heli''
+
# type plane
ID, ModelName, TxdName, Type, HandlingID, GameName, Anims, Class, Frequency, Level, Comprules
+
Id, ModelName, TxdName, Type, HandlingId, GameName, Anims, Class, Frq, Lvl, Comprules, LODModel
 
+
# type bike
''Plane''
+
Id, ModelName, TxdName, Type, HandlingId, GameName, Anims, Class, Frq, Lvl, Comprules, SteeringAngle, WheelScale
ID, ModelName, TxdName, Type, HandlingID, GameName, Anims, Class, Frequency, Level, Comprules, LODModel
+
end
 +
}}
  
{|{{Prettytable}} width="100%"
+
{|class="wikitable center-col-1 center-col-2" width="100%"
!width="250px"|Identifier
+
!style="width: 3em;"|{{Icon|VC}}
 +
!style="width: 12em;"|Identifier
 +
!style="width: 6em;" |Type
 
!Description
 
!Description
 
|-
 
|-
|<center>ID</center>||Unique model ID
+
|A ||Id ||integer ||Unique object ID.
 +
|-
 +
|B ||ModelName ||string ||Name of the <code>.dff</code> [[model file]] without extension.
 +
|-
 +
|C ||TxdName ||string ||Name of the <code>.txd</code> [[texture dictionary]] without extension.
 +
|-
 +
|D ||Type ||string ||Type of vehicle, which includes ''car'', ''boat'', ''train'', ''heli'' (NPC helicopter), ''plane'' (NPC plane), and ''bike''. The ''train'' type is never used in the game but is documented here for sake of completion.
 
|-
 
|-
|<center>ModelName</center>||Name of the <code>.dff</code> ''model file'' without extension.
+
|E ||HandlingId ||string ||Name corresponding to its handling data in the <code>handling.cfg</code> file.
 
|-
 
|-
|<center>TxdName</center>||Name of the <code>.txd</code> ''texture dictionary'' without extension.
+
|F ||GameName ||string ||Name corresponding to its [[GXT]] key, case sensitive and must be seven characters or less.<br>Invalid name will not show up in the game.
 
|-
 
|-
|<center>Type</center>||Type of vehicle, which includes ''car'', ''bike'', ''boat'', ''plane'', and ''heli''. Flyable helicopters are of type ''car''.
+
|G ||Anims ||string ||Appropriate animation file mainly used on bikes.
 
|-
 
|-
|<center>HandlingID</center>||Name corresponding to its handling data in the ''handling.cfg'' file.
+
|H ||Class ||string ||Class of the vehicle.
 +
* normal
 +
* poorfamily
 +
* richfamily
 +
* executive
 +
* worker
 +
* big
 +
* taxi
 +
* moped
 +
* motorbike
 +
* leisureboat
 +
* workerboat
 +
* ignore
 
|-
 
|-
|<center>GameName</center>||Name corresponding to its ''GXT'' entry, case sensitive and must be seven characters or less.<br>Invalid name will not show up in the game.
+
|I ||Frq ||integer ||Frequency of the vehicle spawning randomly on the streets.
 
|-
 
|-
|<center>Anims</center>||Appropriate animation file mainly used on bikes.
+
|J ||Lvl ||integer ||unknown <!--Island appearance-->
 
|-
 
|-
|<center>Class</center>||Class of the vehicle (see [[CARS_(IDE_Section)#Vehicle_Classes|below]]).
+
|K ||Comprules ||hex ||Component rules, alters how vehicle models' "extras" behave, [[#Comprules_2|see below]] for list
 
|-
 
|-
|<center>Frequency</center>||Frequency of the vehicle spawning randomly on the streets.
+
|L ||{{a|l}} |
 +
* ''car'': WheelID
 +
* ''boat'': unused
 +
* ''train'': unused
 +
* ''heli'': unused
 +
* ''plane'': LODModel
 +
* ''bike'': Steering angle
 +
||integer ||
 +
* Model index of wheel model.
 +
* -
 +
* -
 +
* -
 +
* Model index of [[LOD]] model &ndash; can be any valid [[OBJS|object]].
 +
* Steering angle (in degrees)
 
|-
 
|-
|<center>Level</center>||Unknown integer.
+
|M ||{{a|l}} |
 +
* ''car'': WheelScale
 +
* ''boat'': unused
 +
* ''train'': unused
 +
* ''heli'': unused
 +
* ''plane'': unused
 +
* ''bike'': WheelScale
 +
||float ||
 +
* Scale of wheel and collision models, 1.0 for original size of wheel and collision models
 +
* -
 +
* -
 +
* -
 +
* -
 +
* Scale of wheel collision model, 1.0 for original size of wheel collision models; wheel visually not affected
 +
|}
 +
<!--
 +
==== Level ====
 +
This column can be more easily read in binary (see [[Binary to decimal conversion#Decimal to binary|decimal to binary conversion]]). It is made of flags 1, 2, and 4 for levels 1, 2, and 3. The island levels are defined in the [[ZONE]] files.
 +
* {{GTAF|post|477801|1060533536|Explanation of levels cloumn}}
 +
-->
 +
 
 +
==== Comprules ====
 +
This is a list of all non-zero values used in the column.
 +
{|class="wikitable" width="100%"
 +
!style="width: 10em;" |Non-Zero Value
 +
!Vehicle(s)
 
|-
 
|-
|<center>Comprules</center>||Unknown hexadecimal value.
+
|0x1f10 ||Taxi, Cabbie, Zebra Cab, Kaufman Cab
 
|-
 
|-
|<center>WheelID</center>||ID number of wheel model<br>Only available for type ''car'', has no effect if used on type ''boat''.
+
|0x2ff0 ||Stinger, Stallion, Sabre, Sabre Turbo, Comet, Deluxo
 
|-
 
|-
|<center>WheelScale</center>||Scale of wheel and ''collision'' models for type ''car'', scale of wheel collision model for type ''bike'', 1.0 for original size of wheel and collision models<br>Only available for types ''car'' and ''bike'', has no effect if used on type ''boat''.
+
|0x4fff ||Flatbed, Hotring A, Hotring B, Bloodring Banger A, Bloodring Banger B
 
|-
 
|-
|<center>LODModel</center>||ID number of ''LOD'' model &ndash; can be any valid [[OBJS|object]].<br>Only available for type ''plane''.
+
|0x30123345 ||Caddy
 
|}
 
|}
  
Line 131: Line 242:
 
The location of the definition files, models and textures are just the same as for ''GTA III''. However there are some different textures and models. The following table shows all ''Vice City'' wheels and their ID's.
 
The location of the definition files, models and textures are just the same as for ''GTA III''. However there are some different textures and models. The following table shows all ''Vice City'' wheels and their ID's.
  
{| {{prettytable}}
+
{|class="wikitable"
!ID
+
!colspan="2" |ID
|align="center"|237
+
|{{a|c}}|237
|align="center"|238
+
|{{a|c}}|238
|align="center"|239
+
|{{a|c}}|239
|align="center"|250
+
|{{a|c}}|250
|align="center"|251
+
|{{a|c}}|251
|align="center"|252
+
|{{a|c}}|252
|align="center"|253
+
|{{a|c}}|253
|align="center"|254
+
|{{a|c}}|254
|align="center"|255
+
|{{a|c}}|255
|align="center"|256
+
|{{a|c}}|256
 
|-
 
|-
!Image
+
!rowspan="2" |Image
 +
!PC/PS2
 
|[[File:Wheel_rim.png|50px|wheel_rim]]
 
|[[File:Wheel_rim.png|50px|wheel_rim]]
 
|[[File:Wheel_offroad.png|50px|wheel_offroad]]
 
|[[File:Wheel_offroad.png|50px|wheel_offroad]]
Line 155: Line 267:
 
|[[File:Wheel_lighttruck.png|50px|wheel_lighttruck]]
 
|[[File:Wheel_lighttruck.png|50px|wheel_lighttruck]]
 
|[[File:Wheel_smallcar.png|50px|wheel_smallcar]]
 
|[[File:Wheel_smallcar.png|50px|wheel_smallcar]]
 +
|-
 +
!Xbox
 +
|[[File:Wheel_rimx.png|50px|wheel_rim]]
 +
|[[File:Wheel_offroadx.png|50px|wheel_offroad]]
 +
|[[File:Wheel_truckx.png|50px|wheel_truck]]
 +
|[[File:Wheel_sportx.png|50px|wheel_sport]]
 +
|[[File:Wheel_saloonx.png|50px|wheel_saloon]]
 +
|[[File:Wheel_lightvanx.png|50px|wheel_lightvan]]
 +
|[[File:Wheel_classicx.png|50px|wheel_classic]]
 +
|[[File:Wheel_alloyx.png|50px|wheel_alloy]]
 +
|[[File:Wheel_lighttruckx.png|50px|wheel_lighttruck]]
 +
|[[File:Wheel_smallcarx.png|50px|wheel_smallcar]]
 
|}
 
|}
  
 
=== San Andreas ===
 
=== San Andreas ===
  
By default all cars are defined inside the <code>../data/vehicles.ide</code> file.
+
By default all cars are defined inside the <code>{{Dir|sa}}\data\vehicles.ide</code> file.
 +
{{Pre|
 +
cars
 +
# type car
 +
Id, ModelName, TxdName, Type, HandlingID, GameName, Anims, Class, Frequency, Flags, Comprules, WheelID, WheelScale_Front, WheelScale_Rear, Unknown_value
 +
# type boat
 +
Id, ModelName, TxdName, Type, HandlingID, GameName, Anims, Class, Frequency, Flags, Comprules
 +
end
 +
}}
  
''Car''
+
{|class="wikitable center-col-1" width="100%"
ID, ModelName, TxdName, Type, HandlingID, GameName, Anims, Class, Frequency, Flags, Comprules, WheelID, WheelScale_Front, WheelScale_Rear, Unknown_value
 
 
 
{|{{Prettytable}} width="100%"
 
 
!width="250px"|Identifier
 
!width="250px"|Identifier
 
!Description
 
!Description
 
|-
 
|-
|<center>ID</center>||Unique model ID
+
|Id||integer||Unique model ID
 
|-
 
|-
|<center>ModelName</center>||Name of the <code>.dff</code> ''model file'' without extension.
+
|ModelName||string||Name of the <code>.dff</code> ''model file'' without extension.
 
|-
 
|-
|<center>TxdName</center>||Name of the <code>.txd</code> ''texture dictionary'' without extension.
+
|TxdName||string||Name of the <code>.txd</code> ''texture dictionary'' without extension.
 
|-
 
|-
|<center>Type</center>||Type of vehicle, which includes ''trailer'', ''bmx'', ''bike'', ''train'', ''boat'', ''plane'', ''heli'', ''quad'', ''mtruck'' and ''car''
+
|Type||string||Type of vehicle, which includes ''trailer'', ''bmx'', ''bike'', ''train'', ''boat'', ''plane'', ''heli'', ''quad'', ''mtruck'' and ''car''
 
|-
 
|-
|<center>HandlingID</center>||Name corresponding to its handling data in the ''handling.cfg'' file.
+
|HandlingID||string||Name corresponding to its handling data in the ''handling.cfg'' file.
 
|-
 
|-
|<center>GameName</center>||Name corresponding to its ''GXT'' entry, case sensitive and must be seven characters or less.<br>Invalid name will not show up in the game.
+
|GameName||string||Name corresponding to its [[GXT]] key, case sensitive and must be seven characters or less.<br>Invalid name will not show up in the game.
 
|-
 
|-
|<center>Anims</center>||Appropriate character animation
+
|Anims||string||Appropriate character animation
 
|-
 
|-
|<center>Class</center>||Class of the vehicle
+
|Class||string||Class of the vehicle.
 +
* normal
 +
* poorfamily
 +
* richfamily
 +
* executive
 +
* worker
 +
* big
 +
* taxi
 +
* moped
 +
* motorbike
 +
* leisureboat
 +
* workerboat
 +
* bicycle
 +
* ignore
 
|-
 
|-
|<center>Frequency</center>||Frequency of the vehicle spawning randomly on the streets.
+
|Frequency||integer||Frequency of the vehicle spawning randomly on the streets.
 
|-
 
|-
|<center>Flags</center>||Unknown integer.
+
|Flags||integer||Unknown integer.
 
|-
 
|-
|<center>Comprules</center>||Unknown hexadecimal value.
+
|Comprules||hex||Component rules, alters how vehicle models' "extras" behave, [[#Comprules_3|see below]] for list
 
|-
 
|-
|<center>WheelID</center>||Wheel index, needs to be -1 for vehicles to use wheel model defined in the vehicle's model (wheels.dff is no longer used)
+
|WheelID||integer||Wheel index, needs to be -1 for vehicles to use wheel model defined in the vehicle's model (wheels.dff is no longer used)
 
|-
 
|-
|<center>WheelScale_Front</center>||Scale of front wheels and collision models for types ''car'', ''trailer'', ''quad'', ''mtruck'', ''bmx'' and ''bike''
+
|WheelScale_Front||float||Scale of front wheels and collision models for types ''car'', ''trailer'', ''quad'', ''mtruck'', ''bmx'' and ''bike''
 
|-
 
|-
|<center>WheelScale_Rear</center>||Scale of rear wheels and collision models for types ''car'', ''trailer'', ''quad'', ''mtruck'', ''bmx'' and ''bike''
+
|WheelScale_Rear||float||Scale of rear wheels and collision models for types ''car'', ''trailer'', ''quad'', ''mtruck'', ''bmx'' and ''bike''
 
|-
 
|-
|<center>Unknown value</center>||Untested value. For most vehicles it is 0, or -1 regardless of ''Type''.
+
|Wheel Upgrade Class||integer||The wheel set this vehicle relates to, the ids are equivalent to the ones defined in [[carmods.dat]]
For the Flash, Elegy, Stratum, Jester and Uranus this value is 1.
 
For the Remington, Blade, Slamvan, Savanna, Broadway and Tornado this value is 2.
 
 
|}
 
|}
  
 
====Flags====
 
====Flags====
 
According to the vehicles.ide file, flag 0x01 streams a vehicle out after it has been spawned once, and flag 0x02 whis is "used internally". There are 3 vehicles that use flag 0x01, none that use flag 0x02, and one that uses 0x07, which is not mentioned at all.
 
According to the vehicles.ide file, flag 0x01 streams a vehicle out after it has been spawned once, and flag 0x02 whis is "used internally". There are 3 vehicles that use flag 0x01, none that use flag 0x02, and one that uses 0x07, which is not mentioned at all.
{|{{Prettytable}} width="100%"
+
{|class="wikitable" width="100%"
!width="250px"|Non-Zero Value
+
!style="width: 10em;" |Non-Zero Value
 
!Vehicle(s)
 
!Vehicle(s)
 
|-
 
|-
Line 213: Line 353:
  
 
====Comprules====
 
====Comprules====
There is no documentation about the Comprules, however there are multiple vehicles, some specific to San Andreas, that have them set to non-zero values indicating use at least during one point in the games development.
+
This is a list of all non-zero values used in the column.
{|{{Prettytable}} width="100%"
+
{|class="wikitable" width="100%"
!width="250px"|Non-Zero Value
+
!style="width: 10em;" |Non-Zero Value
 
!Vehicle(s)
 
!Vehicle(s)
 
|-
 
|-
Line 222: Line 362:
 
|0x1f10||Taxi, Barracks Ol, Coach, Cabbie, Slamvan
 
|0x1f10||Taxi, Barracks Ol, Coach, Cabbie, Slamvan
 
|-
 
|-
|0x2ff0||Sabre, Comet, Savanna, Broadway, Tornado (related to convertibles?)
+
|0x2ff0||Sabre, Comet, Savanna, Broadway, Tornado
 
|-
 
|-
 
|0x3012||Coast Guard
 
|0x3012||Coast Guard
Line 232: Line 372:
 
|0x3f10||Securicar
 
|0x3f10||Securicar
 
|-
 
|-
|0x4fff||Speeder, Tropic, Flatbed, Hotring Racer A, Hotring Racer B, Bloodring Banger, DFT30 (related to racing vehicles?)
+
|0x4fff||Speeder, Tropic, Flatbed, Hotring Racer A, Hotring Racer B, Bloodring Banger, DFT30
 
|-
 
|-
 
|0x1f341210||NRG500
 
|0x1f341210||NRG500
Line 242: Line 382:
  
 
==== Wheels ====
 
==== Wheels ====
Wheel models are now in the same model as the vehicle itself. The "wheels.dff" and "wheels.txd" are still present, but no longer used. If the "WheelID" is -1, the game will scale the wheel collision, but NOT the wheel model. If "WheelID" is 0, the game will scale the collision AND the wheel model, however this only works properly if the wheel model is set up properly before exporting.
+
Wheel models are now in the same model as the vehicle itself. The <code>wheels.dff</code> and <code>wheels.txd</code> are present but not used. If the "WheelID" is -1, the game will scale the wheel collision, but NOT the wheel model. If "WheelID" is 0, the game will scale the collision AND the wheel model, however this only works properly if the wheel model is set up properly before exporting.
  
 
=== GTA IV ===
 
=== GTA IV ===
  
{{Incomplete}}
+
By default all cars are defined inside the <code>..\common\data\vehicles.ide</code> file.
  
== Vehicle Classes ==
+
{|class="wikitable center-col-1 center-col-2" width="100%"
 
+
!style="width: 3em;"|{{Icon|4}}
The class of a vehicle helps determines where a vehicle should spawn, with the help of [[hardcoded]] features and the [[script]]. The ''ignore'' class is special for its ability to prevent vehicles assigned to that class from spawning as a regular NPC vehicle in traffic. Peds can be assigned to drive a class of vehicle in the [[PEDS#Vehicle_Class_2|PEDS]] section of the IDE file. The following table shows the classes that are available and used in the game.
+
!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>0</center>||<center>{{Icon|3}} {{Icon|VC}} {{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 0000 0000 0000 0000</code></center>||ignore
+
|A ||ModelName ||string ||Name of the <code>[[WDR|.wdr]]</code> model file without extension.
 
|-
 
|-
|<center>1</center>||<center>{{Icon|3}} {{Icon|VC}} {{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 0000 0000 0000 0001</code></center>||normal
+
|B ||TxdName ||string ||Name of the <code>[[WTD|.wtd]]</code> texture dictionary 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>||poorfamily
+
|C ||Type ||string ||Type of vehicle, which includes ''car'', ''bike'', ''boat'', ''train'', ''heli'', and ''plane''.
 
|-
 
|-
|<center>4</center>||<center>{{Icon|3}} {{Icon|VC}} {{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 0000 0000 0000 0100</code></center>||richfamily
+
|D ||HandlingId ||string ||Name corresponding to its handling data in the <code>handling.dat</code> file.
 
|-
 
|-
|<center>8</center>||<center>{{Icon|3}} {{Icon|VC}} {{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 0000 0000 0000 1000</code></center>||executive
+
|E ||GameName ||string ||Name corresponding to its [[GXT]] key (changing this will also change the sound of the vehicle)
 
|-
 
|-
|<center>16</center>||<center>{{Icon|3}} {{Icon|VC}} {{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 0000 0000 0001 0000</code></center>||worker
+
|F ||Anims ||string ||Name of the animation used while entering and driving a vehicle from <code>anim.img</code> file.
 +
*VEH@STD - Standard Car
 +
*VEH@VAN - Van
 +
*VEH@LOW - Low to the ground
 +
*VEH@TRUCK - Truck
 +
*VEH@BUS - Bus
 +
*VEH@BIKE_FREEWAY - Freeway Motorcycle
 +
*VEH@BIKE_SCOOTER - Scooter
 +
*VEH@BIKE_SPT - Sports Bike
 +
*VEH@BIKE_DIRT - Dirt Bike
 +
*VEH@BIKE_CHOPPER - Chopper Motor Cycle
 +
*VEH@HELICOPTER - Helicopter
 +
*veh@boat_speed - Speed Boat
 +
*veh@boat_STAND_BIG - Big Boat, player stands while driving
 +
*veh@boat_standing - Boat that player stands while driving
 +
*VEH@TRAIN - Train
 
|-
 
|-
|<center>32</center>||<center>{{Icon|3}} {{Icon|VC}} {{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 0000 0000 0010 0000</code></center>||big
+
|G ||Anims2 ||string ||Name of the secondary vehicle animation used from <code>anim.img</code> file.
 +
*NULL - Ignored
 +
*VEH@HELICOPTER_XX_H
 +
*VEH@HELI_ANNIH
 +
*VEH@VAN_LL_LO, _LR1_LF1, _HL1_HI1, _FO2_FO2, _XX_LE1, _FO1_FO1, _RI1_LE1, _RI2_LE2, _RI3_LE3
 +
*VEH@STD_LO1_LO1, _LO2_LO2, _LO3_LO3, _LO4_LO4, _LO5_LO5, _LE1_RI1, _RI2_LE2, _DF8, _RI1, _RI3, _XX_RI1, _XX_RI2, _RI1_LO1, _RI2_LO2, _RI3_LO3, _FO1,
 +
*VEH@LOW_INFERNUS, _CONV, _LE1_RI1, _LE2_RI2, _LU1_RI1, _LU2_RI2, _HI_HI, _HI2_HI2, _HI3_HI3, _HI4_HI4, _XX_LO1
 +
*VEH@TRUCK_BA_XX, _LE1_RI1, _LO1_LO1, _PHANTOM
 
|-
 
|-
|<center>64</center>||<center>{{Icon|3}} {{Icon|VC}} {{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 0000 0000 0100 0000</code></center>||taxi
+
|H ||Frq ||integer ||Frequency of the vehicle spawning randomly on the streets.
 
|-
 
|-
|<center>128</center>||<center>{{Icon|VC}} {{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 0000 0000 1000 0000</code></center>||moped
+
|I ||MaxNum ||integer ||Maximum number of vehicles to exist at a time.
 
|-
 
|-
|<center>256</center>||<center>{{Icon|VC}} {{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 0000 0001 0000 0000</code></center>||motorbike
+
|J,K ||WheelRadius ||float[2] ||
 
|-
 
|-
|<center>512</center>||<center>{{Icon|VC}} {{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 0000 0010 0000 0000</code></center>||leisureboat
+
|L ||DefDirtLevel ||float ||Dirt level of traffic vehicles that includes a range from set value to 1.0.<br>Supported values range from 0.0 (clean) to 1.0 (dirty).
 
|-
 
|-
|<center>1024</center>||<center>{{Icon|VC}} {{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 0000 0100 0000 0000</code></center>||workerboat
+
|M ||LodMult ||integer ||
 
|-
 
|-
|<center>2048</center>||<center>{{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 0000 1000 0000 0000</code></center>||bicycle
+
|N ||Swankness ||float ||
 
|-
 
|-
|<center>4096</center>||<center>{{Icon|SA}} {{Icon|4}}</center>||<center><code>0000 0000 0001 0000 0000 0000</code></center>||on foot
+
|O ||Flags ||string ||
|}  
+
* noboot
 +
* smallworker
 +
* big
 +
* onlyduringofficehours
 +
* bootinfront
 +
* isvan
 +
* avoidturns
 +
* livery
 +
* liveryextra
 +
* sports
 +
* delivery
 +
* noambocc
 +
* onlyonhighways - spawn only on .NOD path, who uses 'Highway' Flag in 3th section of Flags.
 +
* ext_gang
 +
* ext_conv
 +
* ext_taxi
 +
* ext_rare
 +
* ext_requi
 +
* ext_strong
 +
* ext_script
 +
* ext_all
 +
* ext_sunroof
 +
* tallship
 +
* truckfx
 +
* truckenginefx
 +
* truckexhaustfx
 +
* truckfirefx
 +
* bangerexhaustfx
 +
|}
  
 
== See also ==
 
== See also ==
  
* [[Item definition]]
 
 
* [[PEDS]]
 
* [[PEDS]]
 
* [[CARS (IPL Section)]]
 
* [[CARS (IPL Section)]]
* [[Vehicle ID List]]
+
* [[List of vehicles (III)]]
 +
* [[List of vehicles (VC)]]
 +
* [[List of vehicles (SA)]]
  
{{N|4|SA}}
+
== External link ==
 +
* {{GTAF|530575|Component Rules explanation}}
  
[[Category:Map Formats]][[Category:GTA 3]][[Category:GTA VC]]
+
{{N|4|SA|VC|3}}

Latest revision as of 20:02, 11 April 2024

CARS redirects here. For the IPL section see CARS (IPL Section)
CARS (IDE section)
Supported games:GTA III Vice City San Andreas GTA IV
Brief description:Used to define vehicles
IDE Sections:
2DFX AMAT ANIM CARS HIER HAND MLO OBJS
PATH PEDS TANM TOBJ TREE TXDP WEAP

CARS is a section in the item definition file in GTA III, Vice City, San Andreas, and GTA IV. It is used to define vehicles and some their properties.

Format

Between GTA III and San Andreas, the class of a vehicle helps determine where it should spawn, with the help of hardcoded features and the script. The ignore class is special for its ability to prevent vehicles assigned to that class from spawning as a regular NPC vehicle in traffic. Peds can be assigned to drive classes of vehicle in the PEDS section of the IDE file.

GTA III

This section is mainly used in the .\data\default.ide file. Each type of vehicle has its own format.

cars
# type car
Id, ModelName, TxdName, Type, HandlingId, GameName, Class, Frq, Lvl, Comprules, WheelModelId, WheelScale
# type boat
Id, ModelName, TxdName, Type, HandlingId, GameName, Class, Frq, Lvl, Comprules
# type train
Id, ModelName, TxdName, Type, HandlingId, GameName, Class, Frq, Lvl, Comprules
# type heli
Id, ModelName, TxdName, Type, HandlingId, GameName, Class, Frq, Lvl, Comprules
# type plane
Id, ModelName, TxdName, Type, HandlingId, GameName, Class, Frq, Lvl, Comprules, LODModel
end
GTA III Identifier Type Description
A Id integer Unique object ID.
B ModelName string Name of the .dff model file without extension.
C TxdName string Name of the .txd texture dictionary without extension.
D Type string Type of vehicle, which includes car, boat, train, heli (NPC helicopter), plane (NPC plane), and bike.
This data determines the class used to instantiate the vehicle and changing it may crash the game. The bike type is partially defined in the game code but cannot be used.
E HandlingId string Name corresponding to its handling data in the handling.cfg file.
F GameName string Name corresponding to its GXT key, case sensitive and must be seven characters or less!
Vehicles with an invalid name will show up as MODELNAME missing when entered
G Class string Class of the vehicle.
  • poorfamily
  • richfamily
  • executive
  • worker
  • special
  • big
  • taxi
  • ignore
H Frq integer Frequency of the vehicle spawning randomly on the streets.
I Lvl integer unknown
J Comprules hex Component rules, alters how vehicle models' "extras" behave, see below for list
K
  • car: WheelModelId
  • boat: unused
  • train: unused
  • heli: unused
  • plane: LODModel
  • bike: unknown
integer
  • Model index of wheel model.
  • -
  • -
  • -
  • Model index of LOD model – can be any valid object.
  • unknown
L
  • car: WheelScale
  • boat: unused
  • train: unused
  • heli: unused
  • plane: unused
  • bike: unknown
float
  • Scale of wheel and collision models, 1.0 for original size of wheel and collision models
  • -
  • -
  • -
  • -
  • unknown

Comprules

This is a list of all non-zero values used in the column.

Non-Zero Value Effect Vehicle(s)
0x1f10 Forces vehicle to always spawn with one of its first two extras. If a vehicle has more than two extras, one of the first two will always spawn and another extra also may spawn with either of the first two extras. Very rarely (likely due to a glitch) these vehicles can spawn without an extra. Taxi, Hoods Rumpo XL
0x2ff0 When it is raining, vehicle will spawn with its first extra. Vehicle may also spawn with other extras (if present in the model) in addition to the first extra. Stinger, Stallion

Wheels

Wheel models are located in the ..\models\generic\wheels.DFF file. Their textures are located in the ..\models\misc.txd file. Just like the cars themselves they are defined inside the ..\data\default.ide file by default. The following table shows the different wheels and their ID's.

ID 160 161 162 163 164 165 166
Image wheel_sport64 wheel_saloon64 wheel_lightvan64 wheel_classic64 wheel_alloy64 wheel_lighttruck64 wheel_smallcar64

Vice City

By default all cars are defined inside the .\data\default.ide file. From GTA III, type train becomes unused but bike is used.

cars
# type car
Id, ModelName, TxdName, Type, HandlingId, GameName, Anims, Class, Frq, Lvl, Comprules, WheelModelId, WheelScale
# type boat
Id, ModelName, TxdName, Type, HandlingId, GameName, Anims, Class, Frq, Lvl, Comprules
# type heli
Id, ModelName, TxdName, Type, HandlingId, GameName, Anims, Class, Frq, Lvl, Comprules
# type plane
Id, ModelName, TxdName, Type, HandlingId, GameName, Anims, Class, Frq, Lvl, Comprules, LODModel
# type bike
Id, ModelName, TxdName, Type, HandlingId, GameName, Anims, Class, Frq, Lvl, Comprules, SteeringAngle, WheelScale
end
Vice City Identifier Type Description
A Id integer Unique object ID.
B ModelName string Name of the .dff model file without extension.
C TxdName string Name of the .txd texture dictionary without extension.
D Type string Type of vehicle, which includes car, boat, train, heli (NPC helicopter), plane (NPC plane), and bike. The train type is never used in the game but is documented here for sake of completion.
E HandlingId string Name corresponding to its handling data in the handling.cfg file.
F GameName string Name corresponding to its GXT key, case sensitive and must be seven characters or less.
Invalid name will not show up in the game.
G Anims string Appropriate animation file mainly used on bikes.
H Class string Class of the vehicle.
  • normal
  • poorfamily
  • richfamily
  • executive
  • worker
  • big
  • taxi
  • moped
  • motorbike
  • leisureboat
  • workerboat
  • ignore
I Frq integer Frequency of the vehicle spawning randomly on the streets.
J Lvl integer unknown
K Comprules hex Component rules, alters how vehicle models' "extras" behave, see below for list
L
  • car: WheelID
  • boat: unused
  • train: unused
  • heli: unused
  • plane: LODModel
  • bike: Steering angle
integer
  • Model index of wheel model.
  • -
  • -
  • -
  • Model index of LOD model – can be any valid object.
  • Steering angle (in degrees)
M
  • car: WheelScale
  • boat: unused
  • train: unused
  • heli: unused
  • plane: unused
  • bike: WheelScale
float
  • Scale of wheel and collision models, 1.0 for original size of wheel and collision models
  • -
  • -
  • -
  • -
  • Scale of wheel collision model, 1.0 for original size of wheel collision models; wheel visually not affected

Comprules

This is a list of all non-zero values used in the column.

Non-Zero Value Vehicle(s)
0x1f10 Taxi, Cabbie, Zebra Cab, Kaufman Cab
0x2ff0 Stinger, Stallion, Sabre, Sabre Turbo, Comet, Deluxo
0x4fff Flatbed, Hotring A, Hotring B, Bloodring Banger A, Bloodring Banger B
0x30123345 Caddy

Wheels

The location of the definition files, models and textures are just the same as for GTA III. However there are some different textures and models. The following table shows all Vice City wheels and their ID's.

ID 237 238 239 250 251 252 253 254 255 256
Image PC/PS2 wheel_rim wheel_offroad wheel_truck wheel_sport wheel_saloon wheel_lightvan wheel_classic wheel_alloy wheel_lighttruck wheel_smallcar
Xbox wheel_rim wheel_offroad wheel_truck wheel_sport wheel_saloon wheel_lightvan wheel_classic wheel_alloy wheel_lighttruck wheel_smallcar

San Andreas

By default all cars are defined inside the .\data\vehicles.ide file.

cars
# type car
Id, ModelName, TxdName, Type, HandlingID, GameName, Anims, Class, Frequency, Flags, Comprules, WheelID, WheelScale_Front, WheelScale_Rear, Unknown_value
# type boat
Id, ModelName, TxdName, Type, HandlingID, GameName, Anims, Class, Frequency, Flags, Comprules
end
Identifier Description
Id integer Unique model ID
ModelName string Name of the .dff model file without extension.
TxdName string Name of the .txd texture dictionary without extension.
Type string Type of vehicle, which includes trailer, bmx, bike, train, boat, plane, heli, quad, mtruck and car
HandlingID string Name corresponding to its handling data in the handling.cfg file.
GameName string Name corresponding to its GXT key, case sensitive and must be seven characters or less.
Invalid name will not show up in the game.
Anims string Appropriate character animation
Class string Class of the vehicle.
  • normal
  • poorfamily
  • richfamily
  • executive
  • worker
  • big
  • taxi
  • moped
  • motorbike
  • leisureboat
  • workerboat
  • bicycle
  • ignore
Frequency integer Frequency of the vehicle spawning randomly on the streets.
Flags integer Unknown integer.
Comprules hex Component rules, alters how vehicle models' "extras" behave, see below for list
WheelID integer Wheel index, needs to be -1 for vehicles to use wheel model defined in the vehicle's model (wheels.dff is no longer used)
WheelScale_Front float Scale of front wheels and collision models for types car, trailer, quad, mtruck, bmx and bike
WheelScale_Rear float Scale of rear wheels and collision models for types car, trailer, quad, mtruck, bmx and bike
Wheel Upgrade Class integer The wheel set this vehicle relates to, the ids are equivalent to the ones defined in carmods.dat

Flags

According to the vehicles.ide file, flag 0x01 streams a vehicle out after it has been spawned once, and flag 0x02 whis is "used internally". There are 3 vehicles that use flag 0x01, none that use flag 0x02, and one that uses 0x07, which is not mentioned at all.

Non-Zero Value Vehicle(s)
0x01 Dumper, Mr. Whoopee, Pizzaboy
0x07 Huntley

Comprules

This is a list of all non-zero values used in the column.

Non-Zero Value Vehicle(s)
0x1012 Tram
0x1f10 Taxi, Barracks Ol, Coach, Cabbie, Slamvan
0x2ff0 Sabre, Comet, Savanna, Broadway, Tornado
0x3012 Coast Guard
0x3210 Stallion
0x3f01 Reefer
0x3f10 Securicar
0x4fff Speeder, Tropic, Flatbed, Hotring Racer A, Hotring Racer B, Bloodring Banger, DFT30
0x1f341210 NRG500
0x30123345 Caddy
0x3f341210 FCR900, BF400

Wheels

Wheel models are now in the same model as the vehicle itself. The wheels.dff and wheels.txd are present but not used. If the "WheelID" is -1, the game will scale the wheel collision, but NOT the wheel model. If "WheelID" is 0, the game will scale the collision AND the wheel model, however this only works properly if the wheel model is set up properly before exporting.

GTA IV

By default all cars are defined inside the ..\common\data\vehicles.ide file.

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 Type string Type of vehicle, which includes car, bike, boat, train, heli, and plane.
D HandlingId string Name corresponding to its handling data in the handling.dat file.
E GameName string Name corresponding to its GXT key (changing this will also change the sound of the vehicle)
F Anims string Name of the animation used while entering and driving a vehicle from anim.img file.
  • VEH@STD - Standard Car
  • VEH@VAN - Van
  • VEH@LOW - Low to the ground
  • VEH@TRUCK - Truck
  • VEH@BUS - Bus
  • VEH@BIKE_FREEWAY - Freeway Motorcycle
  • VEH@BIKE_SCOOTER - Scooter
  • VEH@BIKE_SPT - Sports Bike
  • VEH@BIKE_DIRT - Dirt Bike
  • VEH@BIKE_CHOPPER - Chopper Motor Cycle
  • VEH@HELICOPTER - Helicopter
  • veh@boat_speed - Speed Boat
  • veh@boat_STAND_BIG - Big Boat, player stands while driving
  • veh@boat_standing - Boat that player stands while driving
  • VEH@TRAIN - Train
G Anims2 string Name of the secondary vehicle animation used from anim.img file.
  • NULL - Ignored
  • VEH@HELICOPTER_XX_H
  • VEH@HELI_ANNIH
  • VEH@VAN_LL_LO, _LR1_LF1, _HL1_HI1, _FO2_FO2, _XX_LE1, _FO1_FO1, _RI1_LE1, _RI2_LE2, _RI3_LE3
  • VEH@STD_LO1_LO1, _LO2_LO2, _LO3_LO3, _LO4_LO4, _LO5_LO5, _LE1_RI1, _RI2_LE2, _DF8, _RI1, _RI3, _XX_RI1, _XX_RI2, _RI1_LO1, _RI2_LO2, _RI3_LO3, _FO1,
  • VEH@LOW_INFERNUS, _CONV, _LE1_RI1, _LE2_RI2, _LU1_RI1, _LU2_RI2, _HI_HI, _HI2_HI2, _HI3_HI3, _HI4_HI4, _XX_LO1
  • VEH@TRUCK_BA_XX, _LE1_RI1, _LO1_LO1, _PHANTOM
H Frq integer Frequency of the vehicle spawning randomly on the streets.
I MaxNum integer Maximum number of vehicles to exist at a time.
J,K WheelRadius float[2]
L DefDirtLevel float Dirt level of traffic vehicles that includes a range from set value to 1.0.
Supported values range from 0.0 (clean) to 1.0 (dirty).
M LodMult integer
N Swankness float
O Flags string
  • noboot
  • smallworker
  • big
  • onlyduringofficehours
  • bootinfront
  • isvan
  • avoidturns
  • livery
  • liveryextra
  • sports
  • delivery
  • noambocc
  • onlyonhighways - spawn only on .NOD path, who uses 'Highway' Flag in 3th section of Flags.
  • ext_gang
  • ext_conv
  • ext_taxi
  • ext_rare
  • ext_requi
  • ext_strong
  • ext_script
  • ext_all
  • ext_sunroof
  • tallship
  • truckfx
  • truckenginefx
  • truckexhaustfx
  • truckfirefx
  • bangerexhaustfx

See also

External link