Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!   (85,087 visits to this link)

    2. News

    1. GTA Online

      1. Find Lobbies & Players
      2. Guides & Strategies
      3. Vehicles
      4. Content Creator
      5. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    4. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption 2

    2. Red Dead Redemption

    3. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Forum Support

    2. Site Suggestions

Seemann

.RRR format explanation (Carrec.img)

Recommended Posts

Seemann

Main Article: wiki:Carrec

The RRR files (R3 files) are stored in the archive carrec.img. These files contain information about predefined paths used in missions of GTA:SA. When a vehicle is assigned to such a path with opcode 05EB or 085E, it is moving along the path without taking into account game physics and environment (traffic cars). Also it does not damage when collided. Opcode 0706 moves the vehicle to the next point along the path. 06FD sets a multiplier for the vehicle’s speed.

The R3 files structure is very simple. It’s a binary file being just a set of structures, without header. Each structure has a size of 32 bytes. A path point structure described below:

(offsets are decimal)

CODE

 

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 * 20.0
17 byte Gas Pedal Power * 100.0
18 byte Break Pedal Power * 100.0
19 byte Handbrake used flag
20 float XYZ.pos.x
24 float XYZ.pos.y
28 float XYZ.pos.z
32 end

(XYZ is the structure that store information about a 3D-object world position (+0x14 offset)).


There’s a way to create new R3 path and use it in the script. I wrote a CLEO script which allows to record a vehicle movement data in-game and write it to a custom RRR file. This file is need to be added to the carrec.img then using any IMG archive editor and it’s ready to be used.

http://sannybuilder.com/dev/carrec.txt (source)
http://cleo.sannybuilder.com/scripts/carrec.rar (compiled CLEO script)

To get it work, you need to install CLEO 3 Library, put the carrec.cs to the "game\CLEO" folder, and start the game. Take any vehicle, press Shift+R (you should get a message box) to start recording. Then drive you vehicle along the path you want to create. When you finish, press Shift+R again to stop recording. The new RRR path is stored at the data\paths\carrec900.rrr file (by default; it could be changed in script).

The RRR file editor made by Sanchez:
http://sannybuilder.com/files/R3D.rar

Examples of new RRR paths made with the script are downloadable here:
http://sannybuilder.com/dev/temp/carrec900.rrr
http://sannybuilder.com/dev/temp/carrec998.rrr

Pay attention, that the game can only operate maximum with 475 RRR paths. The original installation has 426 of them, so the number of paths to add safely is 49.

Original source:
http://sannybuilder.com/forums/viewtopic.php?id=107

Enjoy.

Edited by Seemann

Share this post


Link to post
Share on other sites
Beep

Good work Seemann! Keep it up icon14.gif !

Share this post


Link to post
Share on other sites
Midnightz

Wow, that was helpful! Now I understand some of the issues I was having when writing a mod - thank you very much. Worthy of a PIN, IMHO.

 

I look forward to utilizing CLEO and the recorder function! icon14.gif

Share this post


Link to post
Share on other sites
ZAZ

Excellent cookie.gifcookie.gifcookie.gif

Thats what we need to let car drives safe on their route

 

Please correct 2 details in your post

 

When a vehicle is assigned to such a path with opcode 05BE or

05BE is 05BE: AS_kill_actor @54

you mean 05EB: assign_car [email protected] to_path 706

and the your carrec.sc stores the carrec.rrr in in GTASA\data\Paths

 

I made a exemble script.

press key 11// YES-key, in any state

It teleport the player to SF Airport on motorbike and spawns an actor on motorbike to drive around the airport terminal

 

click to get the necessary carrec.rrr

 

 

004F: create_thread @Drive_1

 

 

:Drive_1////------------------sannybuilder code03A4: name_thread 'DRIV' :DRIV_110001: wait 0 ms 00D6: if 0256:   player $PLAYER_CHAR defined 004D: jump_if_false @DRIV_11 077E: get_active_interior_to $ACTIVE_INTERIOR 00D6: if and0038:   $ACTIVE_INTERIOR == 0 00E1:   player 0 pressed_key 11//<<<<<-------------press YES-key in any state 004D: jump_if_false @DRIV_11 016A: fade 0 time 250 0001: wait 250 ms 01B4: set_player $PLAYER_CHAR can_move 0 0362: remove_actor $PLAYER_ACTOR from_car_and_place_at -1338.5 -408.1 14.1 0173: set_actor $PLAYER_ACTOR Z_angle_to 90.8 0001: wait 500 ms 0247: load_model #NRG500 0247: load_model #MAFFA 07C0: load_path 840 :DRIV_1280001: wait 0 ms 00D6: if and0248:   model #NRG500 available 0248:   model #MAFFA available 07C1:   path 840 available 004D: jump_if_false @DRIV_128 00A5: [email protected] = create_car #NRG500 at -1333.5 -408.1 14.1 0175: set_car [email protected] Z_angle_to 280.0 0224: set_car [email protected] health_to 2000 00A5: [email protected] = create_car #NRG500 at -1354.5 -419.1 14.1 0175: set_car [email protected] Z_angle_to 280.0 0224: set_car [email protected] health_to 2000 020A: set_car [email protected] door_status_to 4 02AC: set_car [email protected] immunities BP 1 FP 1 EP 1 CP 1 MP 1 01EC: make_car [email protected] very_heavy 1 0129: [email protected] = create_actor_pedtype 24 model #MAFFA in_car [email protected] driverseat 0223: set_actor [email protected] health_to 3000 04E4: unknown_refresh_game_renderer_at -1333.5 -408.1 03CB: set_rendering_origin_at -1333.5 -408.1 14.1 029B: [email protected] = init_object #AD_JUMP at -1576.02 -202.34 13.76 0177: set_object [email protected] Z_angle_to 270.0 01C7: remove_object_from_mission_cleanup_list [email protected] 0382: set_object [email protected] collision_detection 1 029B: [email protected] = init_object #AD_JUMP at -1597.9 -506.5 21.7 0177: set_object [email protected] Z_angle_to 270.0 01C7: remove_object_from_mission_cleanup_list [email protected] 0382: set_object [email protected] collision_detection 1 029B: [email protected] = init_object #AD_JUMP at -1375.9 -581.5 13.69 0177: set_object [email protected] Z_angle_to 270.0 01C7: remove_object_from_mission_cleanup_list [email protected] 0382: set_object [email protected] collision_detection 1 029B: [email protected] = init_object #AD_JUMP at -1374.9 -585.5 13.69 0177: set_object [email protected] Z_angle_to 270.0 01C7: remove_object_from_mission_cleanup_list [email protected] 0382: set_object [email protected] collision_detection 1 0177: set_object [email protected] Z_angle_to 135.0 0177: set_object [email protected] Z_angle_to 225.0 0177: set_object [email protected] Z_angle_to 280.0 0177: set_object [email protected] Z_angle_to 280.0 0249: release_model #NRG500 0249: release_model #MAFFA 0001: wait 250 ms 036A: put_actor $PLAYER_ACTOR in_car [email protected] 0001: wait 250 ms 016A: fade 1 time 1000 0001: wait 1000 ms 0373: set_camera_directly_behind_player 02EB: restore_camera_with_jumpcut 01B4: set_player $PLAYER_CHAR can_move 1 085E: assign_car [email protected] to_looped_path 840//<<---vehicle repeat the course again and again//0705: car [email protected] assign_to_path 840 and_drive_normal//<<---vehicle stops after one round06FD: set_car [email protected] speed_on_path_to 0.95 :DRIV_6010001: wait 0 ms 00D6: if 0256:   player $PLAYER_CHAR defined 004D: jump_if_false @DRIV_601 00D6: if and8119:   not car [email protected] wrecked 8119:   not car [email protected] wrecked 8118:   not actor [email protected] dead 004D: jump_if_false @DRIV_601 00D6: if 00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -1333.5 -408.1 14.1 radius 650.5 650.5 50.5 004D: jump_if_false @DRIV_702 0002: jump @DRIV_601 :DRIV_7020873: release_path 840 01C3: remove_references_to_car [email protected] // Like turning a car into any random car 01C3: remove_references_to_car [email protected] // Like turning a car into any random car 01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian 0108: destroy_object [email protected] 0108: destroy_object [email protected] 0108: destroy_object [email protected] 0108: destroy_object [email protected] 0002: jump @DRIV_11

 

Share this post


Link to post
Share on other sites
scarface1994

 

The RRR file editor made by Sanchez (updated):

http://foolroot.nm.ru/R3D.rar

 

 

please reestablish the link.

thanks

Share this post


Link to post
Share on other sites
atfburner

Share this post


Link to post
Share on other sites
dtd mods

 

Main Article: wiki:Carrec

 

The RRR files (R3 files) are stored in the archive carrec.img. These files contain information about predefined paths used in missions of GTA:SA. When a vehicle is assigned to such a path with opcode 05EB or 085E, it is moving along the path without taking into account game physics and environment (traffic cars). Also it does not damage when collided. Opcode 0706 moves the vehicle to the next point along the path. 06FD sets a multiplier for the vehicle’s speed.

 

The R3 files structure is very simple. It’s a binary file being just a set of structures, without header. Each structure has a size of 32 bytes. A path point structure described below:

 

(offsets are decimal)

 

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 * 20.0 17  byte     Gas Pedal Power * 100.0 18  byte     Break Pedal Power * 100.0 19  byte     Handbrake used flag 20  float    XYZ.pos.x 24  float    XYZ.pos.y 28  float    XYZ.pos.z 32  end

 

 

(XYZ is the structure that store information about a 3D-object world position (+0x14 offset)).

 

 

There’s a way to create new R3 path and use it in the script. I wrote a CLEO script which allows to record a vehicle movement data in-game and write it to a custom RRR file. This file is need to be added to the carrec.img then using any IMG archive editor and it’s ready to be used.

 

http://sannybuilder.com/dev/carrec.txt (source)

http://cleo.sannybuilder.com/scripts/carrec.rar (compiled CLEO script)

 

To get it work, you need to install CLEO 3 Library, put the carrec.cs to the "game\CLEO" folder, and start the game. Take any vehicle, press Shift+R (you should get a message box) to start recording. Then drive you vehicle along the path you want to create. When you finish, press Shift+R again to stop recording. The new RRR path is stored at the data\paths\carrec900.rrr file (by default; it could be changed in script).

 

The RRR file editor made by Sanchez (updated):

http://foolroot.nm.ru/R3D.rar

 

Examples of new RRR paths made with the script are downloadable here:

http://sannybuilder.com/dev/temp/carrec900.rrr

http://sannybuilder.com/dev/temp/carrec998.rrr

 

Pay attention, that the game can only operate maximum with 475 RRR paths. The original installation has 426 of them, so the number of paths to add safely is 49.

 

Original source:

http://sannybuilder.com/forums/viewtopic.php?id=107

 

Enjoy.

With what opcode can i move the vehicle along the path but to have the game physics and environment like the other cars and damage as well.

Edited by dtd mods

Share this post


Link to post
Share on other sites
DvD463

PLEASE PLEASE PLEASE How can i create my own cleo script??????

Share this post


Link to post
Share on other sites
coin-god
PLEASE PLEASE PLEASE How can i create my own cleo script??????

Read tutorials about SA Coding. Dont ask offtopic questions please.

Share this post


Link to post
Share on other sites
-ATP-

Hi,

I found a bug in the R3D tool, I cuts up the number of path point if it has more than 3 character, like here:

 

user posted image

 

I tried to expand this column, but it doesn´t work.

Is there any solution?

Share this post


Link to post
Share on other sites
Joints

nice work. although i dont think i will never need to use this

Share this post


Link to post
Share on other sites
klm889

Will the car stop at the stops if I stop and stand near the bus stop 10 seconds.

 

or need to write code "...car stopped at point... radius 10 10 10 ?

Share this post


Link to post
Share on other sites
coin-god
Will the car stop at the stops if I stop and stand near the bus stop 10 seconds.

 

or need to write code "...car stopped at point... radius 10 10 10 ?

The car will do the exact same thing you did. If you stopped it will stop, if you did not it wont.

Share this post


Link to post
Share on other sites
ThePlayaJam765

I know I am extremely late to the party but Here's a short script i wrote that will playback rrr paths that you've made. Just change 381 into the number of your path then press TAB+P in-game while in the appropiate vehicle type to watch it.

{$CLEO .cs}//-------------MAIN---------------thread 'CARPATH':CARPATH_01wait 0if and0AB0:   key_pressed 90AB0:   key_pressed 80Actor.Driving($PLAYER_ACTOR)else_jump @CARPATH_01jump @CARPATH_02:CARPATH_0207C0: load_path [email protected] = Actor.CurrentCar($PLAYER_ACTOR)jump @CARPATH_03:CARPATH_03wait 1000if860E:   not car [email protected] assigned_to_pathelse_jump @CARPATH_0105EB: assign_car [email protected] to path 38106FD: set_car [email protected] speed_on_path_to 1.0jump @CARPATH_01
Edited by ThePlayaJam765

Share this post


Link to post
Share on other sites
gettgettGTA

R3D how use ? what is it? who show me please

Share this post


Link to post
Share on other sites
skatefilter5

it's sucks that i have to completely close the game when I add it carrec.img,

if the game runs, it won't let me open or save, with carrec.rrr902 by itself, the car just teleport to san ferrio's car practice area

 

then I record the path and I got it working but the car is invisible and driving up-side then blows up, it glitchly

Share this post


Link to post
Share on other sites
deltaCJ

it's sucks that i have to completely close the game when I add it carrec.img,

if the game runs, it won't let me open or save, with carrec.rrr902 by itself, the car just teleport to san ferrio's car practice area

 

then I record the path and I got it working but the car is invisible and driving up-side then blows up, it glitchly

Sorry, but you can't replace anything in the games original .IMG without closing the game. That's pretty obvious.

 

Also, make sure to run your IMG editor in Administrator mode because the same happened to me. You have to make sure you actually import the car path. It's not glitchy at all. You're just bad at coding.

Share this post


Link to post
Share on other sites
TheEstPlays

Path recorder works fine, although It doesn't show Started Recording/Ended recording(?). But, I recorded the path, put it into IMG and when I try to run it in SAMP, my game just freezes. Anyone knows how to fix this or It just doesn't work in SAMP?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.