Difference between revisions of "CARS (IPL Section)"

From GTAMods Wiki
Jump to navigation Jump to search
(GTA San Andreas)
m
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{This|descripes the usage of the CARS section inside a plain text [[IPL]]. For the definition of vehicle models see [[CARS (IDE Section)]]}}
+
{{This|This article describes the usage of the CARS section inside a plain text [[IPL]]. For the [[Item Definition|definition]] of vehicle models see [[CARS (IDE Section)]]}}
 
{{IplSection
 
{{IplSection
|game        = [[GTA SA]], [[GTA IV]]
+
|name        = CARS
|description = Creates a [[IPL]] parked car generator
+
|game        = {{Icon|SA}} {{Icon|4}}
 +
|description = Creates a parked car generator
 
}}
 
}}
 
+
'''CARS''' is a section in the [[item placement]] file in [[San Andreas]] and [[GTA IV]]. This section is a simplified method to create parked cars. Usually parked cars are created by the [[script]]s, but just as [[JUMP|unique stunt jumps]] they can be written inside plain text or [[binary IPL]]s. Since parked car generators are related to [[savegame]]s{{ref|1}} a new game must be started before they are applied to the game. It is possible to create parked car generators without starting a new game using [[CLEO]].{{ref|2}}
The '''CARS''' section is a simplified method to create parked cars. Usually parked cars are created by the [[SCM|Script]], but just as [[JUMP|unique stunt jumps]] they can be seperated and written inside plain text or [[Binary IPL|binary]] [[IPL]]s. Since parked car generators are related into [[Saves_(GTA_SA)#Block_12:_Car_Generators|savegames]] a new game must be started before they are applied to the game. It is possible to create parked car generators without starting a new game using [[CLEO]].{{ref|1}}
 
  
 
== Format ==
 
== Format ==
  
''CARS'' or parked car generators are used to place permanently, randomly or limited cars which are placed (parked) around the world. For this they need a position, a rotation, information about which car should be placed, the car's colors and some additional information.
+
''CARS'' is used to place car generators (parked cars) permanently, randomly or limited, around the game world. For this they need a position, a rotation, information about which car should be placed, the car's colors and some additional information.
 
 
=== GTA San Andreas ===
 
  
<pre>PosX, PosY, PosZ, Angle, CarID, PrimCol, SecCol, ForceSpawn, Alarm, DoorLock, Unknown1, Unknown2</pre>
+
=== San Andreas ===
 +
<pre<includeonly></includeonly> style="overflow-x: auto;">
 +
cars
 +
PosX, PosY, PosZ, Angle, CarID, PrimCol, SecCol, ForceSpawn, Alarm, DoorLock, Unknown1, Unknown2
 +
end
 +
</pre>
  
{|{{Prettytable}} width="100%" class="collapsible"
+
{|class="wikitable center-col-1" style="width: 100%;"
!width="250px"|Identifier
+
!style="width: 12em;"|Identifier
 
!Description
 
!Description
 
|-
 
|-
|<center>PosX, PosY, PosZ</center>||The real world coordinates of the car as floating point values.
+
|PosX, PosY, PosZ||The real world coordinates of the car as floating point values.
 
|-
 
|-
|<center>Angle</center>||The angle of the car in dagrees.
+
|Angle||The angle of the car in radians (degrees/~57.2958).
 
|-
 
|-
|<center>CarID</center>||The ID number of the car as defined in the [[IDE]] or -1 for random car parks (influened by the [[pocycle.dat]] file)
+
|CarID||The ID number of the car as defined in the [[IDE]] or -1 for random car parks (influenced by the <code>[[popcycle.dat]]</code> file)
 
|-
 
|-
|<center>PrimCol, SecCol</center>||A car color defined in the <code>[[carcols.dat]]</code> file. If it is set to -1 the color will be randomly choosed.
+
|PrimCol, SecCol||A car color defined in the <code>[[carcols.dat]]</code> file. If it is set to -1 the color will be randomly chosen.
 
|-
 
|-
|<center>ForceSpawn</center>||Vehicles spawn more reliably if this is 1.
+
|ForceSpawn||Vehicles spawn more reliably if this is set to 1.
 
|-
 
|-
|<center>Alarm</center>||The probability of triggering the alarm system (0 - 100).
+
|Alarm||The probability of triggering the alarm system (0 - 100).
 
|-
 
|-
|<center>DoorLock</center>||The propability that the doors of the vehicle is locked (0 - 100).
+
|DoorLock||The probability that the doors of the vehicle is locked (0 - 100).
 
|-
 
|-
|<CeNtEr>Unknown1, Unknown2</CeNtEr>||Unknown (Zero).
+
|Unknown1, Unknown2||Unknown (Zero).
 
|}
 
|}
  
 
==== Binary format ====
 
==== Binary format ====
  
{{Incomplete}}
+
''CARS'' is one of the known sections which can be used in binary format inside streaming files. It's format is similar to the plain text format:
 +
 
 +
4b  - FLOAT    - Position X
 +
4b  - FLOAT    - Position Y
 +
4b  - FLOAT    - Position Z
 +
4b  - FLOAT    - Angle (Around Z-Axis)
 +
4b  - INT32    - Object ID (an index to an [[CARS_(IDE_Section)|vehicle definition]])
 +
4b  - INT32    - Primary color
 +
4b  - INT32    - Secondary color
 +
4b  - INT32    - Force spawn (Windows BOOL - see ''<code>WinDef.h</code>'')
 +
4b  - INT32    - Alarm probability
 +
4b  - INT32    - Locked probability
 +
4b  - INT32    - Unknown1 (Could be tertiary color)
 +
4b  - INT32    - Unknown2 (Could be quarterdeck color)
  
 
=== GTA IV ===
 
=== GTA IV ===
Line 44: Line 60:
 
{{Research}}
 
{{Research}}
  
==Script representation==
+
== References ==
 +
{{note|1}} {{Icon|SA}} [[Saves_(GTA_SA)#Block_12:_Car_Generators|Car generators in save files]]<br>
 +
{{note|2}} {{Icon|SA}} [[Spawn a vehicle#... car generator opcode|Creating a parked car generator]] via scripts.
  
* [[014B]] &ndash; Creates a parked car generator in [[SCM]]
+
== External link ==
* [[014C]] &ndash; Sets the flags for the parked car generator.
 
* [[09E2]] &ndash; Creates a parked car generator where the car has a special numplate text.
 
* [[0A17]] &ndash; Identifies a parked car generator to be owned by the player
 
 
 
<!--- ToDo: GTA IV native functions! --->
 
{{Incomplete}}
 
 
 
==See also==
 
* {{note|1}} [[Car_Spawn|Creating a parked car generator]] using SCM.
 
 
 
==External Link==
 
 
* {{GTAF|202532|Documentation of San Andreas IPL file format}}
 
* {{GTAF|202532|Documentation of San Andreas IPL file format}}
  
 
{{N|4|SA}}
 
{{N|4|SA}}
 
[[Category:Map_Formats]]
 

Latest revision as of 20:48, 12 December 2015

This article describes the usage of the CARS section inside a plain text IPL. For the definition of vehicle models see CARS (IDE Section)
CARS (IPL section)
Short description:Creates a parked car generator
Supported games: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

CARS is a section in the item placement file in San Andreas and GTA IV. This section is a simplified method to create parked cars. Usually parked cars are created by the scripts, but just as unique stunt jumps they can be written inside plain text or binary IPLs. Since parked car generators are related to savegames[1] a new game must be started before they are applied to the game. It is possible to create parked car generators without starting a new game using CLEO.[2]

Format

CARS is used to place car generators (parked cars) permanently, randomly or limited, around the game world. For this they need a position, a rotation, information about which car should be placed, the car's colors and some additional information.

San Andreas

cars
PosX, PosY, PosZ, Angle, CarID, PrimCol, SecCol, ForceSpawn, Alarm, DoorLock, Unknown1, Unknown2
end
Identifier Description
PosX, PosY, PosZ The real world coordinates of the car as floating point values.
Angle The angle of the car in radians (degrees/~57.2958).
CarID The ID number of the car as defined in the IDE or -1 for random car parks (influenced by the popcycle.dat file)
PrimCol, SecCol A car color defined in the carcols.dat file. If it is set to -1 the color will be randomly chosen.
ForceSpawn Vehicles spawn more reliably if this is set to 1.
Alarm The probability of triggering the alarm system (0 - 100).
DoorLock The probability that the doors of the vehicle is locked (0 - 100).
Unknown1, Unknown2 Unknown (Zero).

Binary format

CARS is one of the known sections which can be used in binary format inside streaming files. It's format is similar to the plain text format:

4b  - FLOAT    - Position X
4b  - FLOAT    - Position Y
4b  - FLOAT    - Position Z
4b  - FLOAT    - Angle (Around Z-Axis)
4b  - INT32    - Object ID (an index to an vehicle definition)
4b  - INT32    - Primary color
4b  - INT32    - Secondary color
4b  - INT32    - Force spawn (Windows BOOL - see WinDef.h)
4b  - INT32    - Alarm probability
4b  - INT32    - Locked probability
4b  - INT32    - Unknown1 (Could be tertiary color)
4b  - INT32    - Unknown2 (Could be quarterdeck color)

GTA IV

References

^ San Andreas Car generators in save files
^ San Andreas Creating a parked car generator via scripts.

External link