CARS (IDE Section): Difference between revisions

contributions from myself, Aschratt, DexX, LINK2012, SonofUgly, and The Hero
No edit summary
(contributions from myself, Aschratt, DexX, LINK2012, SonofUgly, and The Hero)
Line 5: Line 5:
| description = Used to define vehicles
| description = Used to define vehicles
}}
}}
'''CARS''' is a section in the [[IDE|item definition]] file. It is used to define vehicles and some their properties.
'''CARS''' 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 vehicles and some their properties.


== GTA III ==
== Format ==
=== Format ===
Between GTA III and GTA 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.
This section is mainly used in the <code>default.ide</code> file. Each type of vehicle has its own format.


''Car''
=== GTA III ===
ID, ModelName, TxdName, Type, HandlingID, GameName, Class, Frequency, Level, Comprules, WheelID, WheelScale
This section is mainly used in the <code>\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
</pre>


''Boat and Train''
{|class="wikitable center-col-1 center-col-2" width="100%"
ID, ModelName, TxdName, Type, HandlingID, GameName, Class, Frequency, Level, Comprules
!style="width: 3em;"|{{Icon|3}}
 
!style="width: 12em;"|Identifier
''Plane''
!style="width: 6em;" |Type
ID, ModelName, TxdName, Type, HandlingID, GameName, Class, Frequency, Level, Comprules, LODModel
!Description
 
{| {{subst:Prettytable}} width="100%"
! width="250px"| Identifier
! Description
|-
|-
| <center>ID</center> || Unique model ID.
|A ||Id ||integer ||Unique object ID.
|-
|-
| <center>ModelName</center> || Name of the .dff [[DFF|model file]], without extension.
|B ||ModelName ||string ||Name of the <code>.dff</code> model file without extension.
|-
|-
| <center>TxdName</center> || Name of the .txd [[TXD|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'', ''plane'', and ''bike''.<br>This data is related to hardcoded functions and must not be changed or else it might crash the game. The ''bike'' type is never used in the game but is documented here for sake of completion.
|-
|-
| <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; it is 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.
|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.
|I ||Lvl ||integer ||unknown <!--Island appearance-->
|-
|-
| <center>Comprules</center> || Unknown.
|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 ||style="text-align: left;" |
* ''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 ||style="text-align: left;" |
* ''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)
|-
|-
| <center>LODModel</center> || ID number of LOD model, can be any valid vehicle model.<br>Only available for type ''plane''.
|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
|}
|}


=== Class ===
==== Wheels ====
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|PEDS]] section of the IDE file. These are the classes that are available and used in the game.
 
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.
 
=== GTA Vice City ===
By default all cars are defined inside the <code>\data\default.ide</code> file. From GTA III, type ''train'' becomes unused but ''bike'' is used.
 
<pre>
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
</pre>


* big
{|class="wikitable center-col-1 center-col-2" width="100%"
* executive
!style="width: 3em;"|{{Icon|VC}}
* ignore
!style="width: 12em;"|Identifier
!style="width: 6em;" |Type
!Description
|-
|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'', ''plane'', and ''bike''. Flyable helicopters are of type ''car''. 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 <code>handling.cfg</code> file.
|-
|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.
|-
|G ||Anims ||string ||Appropriate animation file mainly used on bikes.
|-
|H ||Class ||string ||Class of the vehicle.
* normal
* poorfamily
* poorfamily
* richfamily
* richfamily
* special
* executive
* worker
* worker
 
* big
=== Wheels ===
* taxi
Wheel models are located in the <code>wheels.DFF</code> file in the <code>models\Generic</code> folder. Wheel textures are located in the <code>MISC.TXD</code> file in the <code>models</code> folder. Wheels are defined in the <code>default.ide</code> file.
* moped
 
* motorbike
{| border="2" cellpadding="4" cellspacing="0" style="margin: 1em 1em 1em 0; border: 1px #aaa solid; border-collapse: collapse;"
* leisureboat
! ID
* workerboat
! Image
* ignore
|-
|-
| 160
|I ||Frq ||integer ||Frequency of the vehicle spawning randomly on the streets.
| wheel_sport
|-
|-
| 161
|J ||Lvl ||integer ||unknown <!--Island appearance-->
| wheel_saloon
|-
|-
| 162
|K ||Comprules ||hex ||Component rules, alters how vehicle models' "extras" behave, [[#Comprules_2|see below]] for list
| wheel_lightvan
|-
|-
| 163
|L ||style="text-align: left;" |
| wheel_classic
* ''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)
|-
|-
| 164
|M ||style="text-align: left;" |
| wheel_alloy
* ''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.
{|class="wikitable" width="100%"
!style="width: 10em;" |Non-Zero Value
!Vehicle(s)
|-
|-
| 165
|0x1f10 ||Taxi, Cabbie, Zebra Cab, Kaufman Cab
| wheel_lighttruck
|-
|-
| 166
|0x2ff0 ||Stinger, Stallion, Sabre, Sabre Turbo, Comet, Deluxo
| wheel_smallcar
|-
|0x4fff ||Flatbed, Hotring A, Hotring B, Bloodring Banger A, Bloodring Banger B
|-
|0x30123345 ||Caddy
|}
|}


== Vice City ==
==== Wheels ====
=== Format ===
This section is mainly used in the <code>default.ide</code> file. Each type of vehicle has its own format.


''Car''
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.
ID, ModelName, TxdName, Type, HandlingID, GameName, Anims, Class, Frequency, Level, Comprules, WheelID, WheelScale


''Bike''
=== San Andreas ===
ID, ModelName, TxdName, Type, HandlingID, GameName, Anims, Class, Frequency, Level, Comprules, Unknown, WheelScale


''Boat and Heli''
By default all cars are defined inside the <code>\data\vehicles.ide</code> file.
ID, ModelName, TxdName, Type, HandlingID, GameName, Anims, Class, Frequency, Level, Comprules
<pre>
cars
# type car
Id, ModelName, TxdName, Type, HandlingID, GameName, Anims, Class, Frequency, Flags, Comprules, WheelID, WheelScale_Front, WheelScale_Rear, Unknown_value
end
</pre>


''Plane''
{|class="wikitable center-col-1" width="100%"
ID, ModelName, TxdName, Type, HandlingID, GameName, Anims, Class, Frequency, Level, Comprules, LODModel
!width="250px"|Identifier
!Description
|-
|Id||Unique model ID
|-
|ModelName||Name of the <code>.dff</code> ''model file'' without extension.
|-
|TxdName||Name of the <code>.txd</code> ''texture dictionary'' without extension.
|-
|Type||Type of vehicle, which includes ''trailer'', ''bmx'', ''bike'', ''train'', ''boat'', ''plane'', ''heli'', ''quad'', ''mtruck'' and ''car''
|-
|HandlingID||Name corresponding to its handling data in the ''handling.cfg'' file.
|-
|GameName||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.
|-
|Anims||Appropriate character animation
|-
|Class||Class of the vehicle.
* normal
* poorfamily
* richfamily
* executive
* worker
* big
* taxi
* moped
* motorbike
* leisureboat
* workerboat
* bicycle
* ignore
|-
|Frequency||Frequency of the vehicle spawning randomly on the streets.
|-
|Flags||Unknown integer.
|-
|Comprules||Component rules, alters how vehicle models' "extras" behave, [[#Comprules_3|see below]] for list
|-
|WheelID||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||Scale of front wheels and collision models for types ''car'', ''trailer'', ''quad'', ''mtruck'', ''bmx'' and ''bike''
|-
|WheelScale_Rear||Scale of rear wheels and collision models for types ''car'', ''trailer'', ''quad'', ''mtruck'', ''bmx'' and ''bike''
|-
|Wheel Upgrade Class||The wheel set this vehicle relates to, the ids are equivalent to the ones defined in carmods.dat
|}


{| {{subst:Prettytable}} width="100%"
====Flags====
! width="250px"| Identifier
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.
! Description
{|class="wikitable" width="100%"
!style="width: 10em;" |Non-Zero Value
!Vehicle(s)
|-
|-
| <center>ID</center> || Unique model ID.
|0x01||Dumper, Mr. Whoopee, Pizzaboy
|-
|-
| <center>ModelName</center> || Name of the .dff [[DFF|model file]], without extension.
|0x07||Huntley
|}
 
====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>TxdName</center> || Name of the .txd [[TXD|texture dictionary]], without extension.
|0x1012||Tram
|-
|-
| <center>Type</center> || Type of vehicle, which includes ''car'', ''bike'', ''boat'', ''plane'', and ''heli''; flyable helicopters are type ''car''.
|0x1f10||Taxi, Barracks Ol, Coach, Cabbie, Slamvan
|-
|-
| <center>HandlingID</center> || Name corresponding to its handling data in the [[handling.cfg]] file.
|0x2ff0||Sabre, Comet, Savanna, Broadway, Tornado
|-
|-
| <center>GameName</center> || Name corresponding to its [[GXT]] entry; it is case sensitive and must be seven characters or less!<br>Invalid name will not show up in the game.
|0x3012||Coast Guard
|-
|-
| <center>Anims</center> || Appropriate animation file mainly used on bikes.
|0x3210||Stallion
|-
|-
| <center>Class</center> || Class of the vehicle.
|0x3f01||Reefer
|-
|-
| <center>Frequency</center> || Frequency of the vehicle spawning randomly on the streets.
|0x3f10||Securicar
|-
|-
| <center>Level</center> || Unknown.
|0x4fff||Speeder, Tropic, Flatbed, Hotring Racer A, Hotring Racer B, Bloodring Banger, DFT30
|-
|-
| <center>Comprules</center> || Unknown.
|0x1f341210||NRG500
|-
|-
| <center>WheelID</center> || ID number of wheel model<br>Only available for type ''car'', has no effect if used on type ''boat''.
|0x30123345||Caddy
|-
|-
| <center>WheelScale</center> || Scale of wheel and [[Collision File|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''.
|0x3f341210||FCR900, BF400
|-
| <center>LODModel</center> || ID number of LOD model, can be any valid vehicle model.<br>Only available for type ''plane''.
|}
|}


=== Class ===
==== Wheels ====
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. These are the classes that are available and used in the game.
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 ===


* big
By default all cars are defined inside the <code>\common\data\vehicles.ide</code> file.
* executive
* ignore
* leisureboat
* moped
* motorbike
* normal
* poorfamily
* richfamily
* taxi
* worker
* workerboat


=== Wheels ===
{|class="wikitable center-col-1 center-col-2" width="100%"
Wheel models are located in the <code>wheels.DFF</code> file in the <code>models\generic</code> folder. Wheel textures are located in the <code>wheels.TXD</code> file in the <code>models\generic</code> folder. Wheels are defined in the <code>default.ide</code> file.
!style="width: 3em;"|{{Icon|4}}
{| border="2" cellpadding="4" cellspacing="0" style="margin: 1em 1em 1em 0; border: 1px #aaa solid; border-collapse: collapse;"
!style="width: 12em;"|Identifier
! ID
!style="width: 6em;" |Type
! Image
!Description
|-
|-
| 237
|A ||ModelName ||string ||Name of the <code>[[WDR|.wdr]]</code> model file without extension.
| wheel_rim
|-
|-
| 238
|B ||TxdName ||string ||Name of the <code>.wtd</code> texture dictionary without extension.
| wheel_offroad
|-
|-
| 239
|C ||Type ||string ||Type of vehicle, which includes ''car'', ''bike'', ''boat'', ''train'', ''heli'', and ''plane''.
| wheel_truck
|-
|-
| 250
|D ||HandlingId ||string ||Name corresponding to its handling data in the <code>handling.dat</code> file.
| wheel_sport
|-
|-
| 251
|E ||GameName ||string ||Name corresponding to its [[GXT]] key (changing this will also change the sound of the vehicle)
| wheel_saloon
|-
|-
| 252
|F ||Anims ||string ||Name of the animation used while entering and driving a vehicle from <code>anim.img</code> file.
| wheel_lightvan
*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
|-
|-
| 253
|G ||Anims2 ||string ||Name of the secondary vehicle animation used from <code>anim.img</code> file.
| wheel_classic
*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
|-
|-
| 254
|H ||Frq ||integer ||Frequency of the vehicle spawning randomly on the streets.
| wheel_alloy
|-
|-
| 255
|I ||MaxNum ||integer ||Maximum number of vehicles to exist at a time.
| wheel_lighttruck
|-
|-
| 256
|J,K ||WheelRadius ||float[2] ||
| wheel_smallcar
|-
|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).
|-
|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
|}
|}


12,236

edits