URI:
   DIR Return Create A Forum - Home
       ---------------------------------------------------------
       gtaforums
  HTML https://gtamixmods.createaforum.com
       ---------------------------------------------------------
       *****************************************************
   DIR Return to: Coding Lounge
       *****************************************************
       #Post#: 112--------------------------------------------------
       GTA SA savefile format
   DIR By: ArijitSen
       Date: October 16, 2012, 6:55 am
       ---------------------------------------------------------
       This is the format for GTA SA Save files:
       --- Code ---
       ===============================================
       GTA San Andreas Save File format v0.2
       ===============================================
       
       written by
       1. Technetium(tc.technetium@gmail.com)
       
       ----------------
       Introduction
       ----------------
       This document is aimed to completely describe the format of
       savefiles for GTASA. It is still working in progress. Editing or
       adding info. into this document are welcome.
       
       ----------------
       Marco strcuture
       ----------------
       Savefiles consist of 32 blocks which are storing different
       kind of data. Sequency of the block determines what kind of data
       it stores.
       At the end of the file, there is a dword storing the checksum,
       which is calcuated by Checksum-32 algorithm, which sum up all
       the bytes in the file.
       Below is the sequency of blocks:
       1: Header with global script indepentent variable
       2: SCM global variable
       3: CPedPool
       4: Parked car in garages
       5: Unknown
       6: Unknown
       7: Pickup
       8: Unknown
       9: Unknown
       10: Unknown
       11: Unknown(zone?)
       12: Unknown
       13: Car generator
       14..32:Unknown
       17: Player_Status
       ----------------
       Micro strcuture
       ----------------
       
       ***************************
       Block 4 : Car in garages
       ***************************
       char Header_perfex[5];// "BLOCK"
       dword Garages_count;
       char Unknown[31];
       dword Unknown;
       ParkedCar Pool[];
       the structure of ParkedCar:
       Since it is dumped from memory, its strucutre is completely
       identical to data in memory.
       Its strcture:(credits: saracoglu, Quoted from
  HTML http://www.gtaforums.com/index.php?showtopic=194199&st=60)
       Offsets:
       + 0 X Coord (Float)
       + 4 Y Coord (Float)
       + 8 Z Coord (Float)
       +14 BPDPEPFP (Word) coding
       +16 Car ID (Word)
       +47 Body Color ordinal (Byte)
       +48 Stripe Color ordinal (Byte)
       +60 Car Angle (Float)
       
       ***************************
       Block 7 : Pickup
       ***************************
       char Header_perfex[5];// "BLOCK"
       char Unknown[16];
       Pickup Pool[];
       the structure of Pickup:
       struct Pickup
       {
       word x, y, z;     // Coordination of pickup. To convert the
       coord. into GTA high percision unit, multiply 8 to the coord.
       word Unknown;
       char Pickup_Type1; // 0x66 = adrenaline, 0x6e = health, etc
       char Pickup_Type2; // 0x01 = health dependent pickup, 0x04 =
       weapons pickup
       char Unknown; // It always equal to 0x02
       char Unknown;
       word Pickup_Flag; // 0x15 = free pickup
       dword Unknown;
       dword Unknown;
       word Unknown;
       dword Ammo_count;
       dword Unknown;
       };
       
       ***************************
       Block 13 : Car generator
       ***************************
       char[5] Header_perfex; // "BLOCK"
       dword Generator_count;
       CarGen Pool[];
       the structure of CarGen:
       struct CarGen
       {
       word Unknown;
       word Unknown;
       word Car_ID;  // pls refer to vehicles.ide
       char Unknown; // always -1. wheelmodelId? Please refer to
       mission coding reference.
       char Unknown; // always -1. wheel scale?  Please refer to
       mission coding reference.
       word x, y, z;     // Coordination of pickup. To convert the
       coord. into GTA high percision unit, multiply 8 to the coord.
       word rotate_Z;
       char Unknown; // Alarm?
       char Unknown; // Door_lock?
       word Unknown;
       char Unknown;
       dword Unknown; // always 10000. Please refer to mission coding
       reference.
       dword Unknown;
       dword Unknown;
       word Unknown;
       };
       
       ***************************
       Block 17 : Player_Status
       ***************************
       char[5] Header_perfex; // "BLOCK"
       float Status_array[486];// for index id, please refer to
       statdisp.dat. P.S. some of the data are stored as long(e.g.
       repect).
       --- End Code ---
       *****************************************************
       Page 1 of 1