Carrec

From GTAMods Wiki
Revision as of 08:04, 9 October 2007 by Seemann (talk | contribs) (R3 file structure)
Jump to navigation Jump to search

The carrec.img file stores a set of R3 files (files with an extension .rrr). These files contain path information used by the mission script for San Andreas only. The paths are predefined and look unnatural during gameplay because the movement of the vehicle is very rigid. The paths ignore many stuff in the game including gravity and obstacles. Original San Andreas installation has 426 R3 paths. Maximul number of these paths is 475.

R3 file structure

An R3 file (.rrr) contains no header, only a binary data, being a set of structures of 32 bytes in length each, described separate path points. The data in each checkpoint structure goes as the following:

00 dword time
04 word velocity in direction X * 16383.5
06 word velocity in direction Y * 16383.5
08 word velocity in direction Z * 16383.5
10 byte XYZ.right.x * 127.0
11 byte XYZ.right.y * 127.0
12 byte XYZ.right.z * 127.0
13 byte XYZ.top.x * 127.0
14 byte XYZ.top.y * 127.0
15 byte XYZ.top.z * 127.0
16 byte Steering Angle
17 byte Gas Pedal Power
18 byte Break Pedal Power
19 byte unknown
20 float XYZ.pos.x
24 float XYZ.pos.y
28 float XYZ.pos.z
32 end

When the vehicle is moving along the path, its XYZ structure is filled with the information from the proper fields of checkpoint data.

Mission Script

You can use the following opcodes to do stuff to your paths.
07C0 - Loads the path
07C1 - Checks if the path has been loaded
0873 - Releases the path from memory
05EB - Assigns a vehicle to the path
0705 - Assigns a vehicle to the path
085E - Assigns a vehicle to a looped path
05EC - Releases the vehicle from a path
05ED - Freezes the vehicle along the path
05EE - Unfreezes the vehicle along the path
06FD - Sets the speed of the vehicle along the path
0706 - Advances the vehicle along the path
060E - Checks if a path is assigned to the vehicle
If you load a non-existant path to a vehicle, path 1 will be loaded instead.

List

The following is a list of paths defined in the carrec.img file.

ID Description
1 Driving School The 360
2 Driving School The 180
3 Unused Driving School unknown test
4 Driving School Whip and Terminate
5 Driving School Pop and Control
7 Driving School Burn and Lap
9 Driving School Cone Coil
10 Driving School The '90'
11 Driving School Wheelie Weave
13 Driving School Spin and Go
14 Driving School P. I. T. Maneuver
15 Driving School Alley Oop
16 Driving School City Slicking
21 Unused Test Drive Cesar's Savanna, most likely used in beta version of game
22 House Party Sweet's Greenwod
23 House Party GSF's Voodoo
24 Unused path, could have been used in Big Smoke, most likely used in beta version of game
25 The Da Nang Thang Triad's Maverick
27 Pier 69 enemy's Pony
28 Pier 69 Toreno's helicopter
30 OG Loc Freddy's PCJ 600 path 1 (beginning)
31 OG Loc Freddy's PCJ 600 path 2
32 OG Loc Freddy's PCJ 600 path 3
33 OG Loc Freddy's PCJ 600 path 4
34 OG Loc Freddy's PCJ 600 path 5
35 OG Loc Freddy's PCJ 600 path 6
36 OG Loc Freddy's PCJ 600 path 7
37 OG Loc Freddy's PCJ 600 path 8
38 OG Loc Freddy's PCJ 600 path 9
39 OG Loc Freddy's PCJ 600 path 10
40 OG Loc Freddy's PCJ 600 path 11 (end)
41 unused Los Santos to San Fierro AT 400, most likely used in beta version of game
42 Los Santos to San Fierro AT 400
43 Las Venturas to San Fierro AT 400
44 San Fierro to Las Venturas AT 400
46 Los Santos to Las Venturas AT 400
48 Las Venturas to Los Santos AT 400
49 San Fierro to Los Santos AT 400
50 OG Loc highway NPC 1
51 OG Loc highway NPC 2
52 OG Loc highway NPC 3
53 OG Loc highway NPC 4
54 OG Loc highway NPC 5
55 OG Loc highway NPC 6
56 OG Loc highway NPC 7
57 OG Loc highway NPC 8
58 OG Loc highway NPC 9
59 OG Loc highway NPC 10
60 OG Loc highway NPC 11
65 Test Drive Cesar's Elegy path enter alley
66 Test Drive cop 1 path enter alley
67 Test Drive cop 2 path enter alley
70 Test Drive Tram path 1
71 Test Drive outside Otto's Autos NPC 1
72 Test Drive outside Otto's Autos NPC 2
73 Test Drive outside Otto's Autos NPC 3
74 Test Drive outside Otto's Autos NPC 4
75 Test Drive outside Otto's Autos NPC 5
76 Test Drive outside Otto's Autos NPC 6
77 Test Drive Tram path 2
78 Test Drive Tram path 3
79 Test Drive Cesar's Elegy path 1
80 Test Drive Tram path 3
81 Test Drive Cesar's Elegy path 2
82 Unused Test Drive path

More to come soon. The last ID is 834.