Jump to content

Saves (GTA SA): Difference between revisions

m
clean up, replaced: {{subst:Prettytable}} → class="prettytable" (3), {{SA-navi}} → {{gtasa}}
m (1 revision: Imported from gtamodding.com - under GNU FDL)
m (clean up, replaced: {{subst:Prettytable}} → class="prettytable" (3), {{SA-navi}} → {{gtasa}})
Line 20: Line 20:
====Block 0: Miscellaneous====
====Block 0: Miscellaneous====
Game "meta-information" giving the overall state of things. This block has a constant length of 0x138 bytes
Game "meta-information" giving the overall state of things. This block has a constant length of 0x138 bytes
{|{{Prettytable}} class="sortable"
{|class="prettytable" class="sortable"
!OFFSET
!OFFSET
!TYPE
!TYPE
Line 29: Line 29:
|0x0004  ||char[100]||save name (long names are truncated on the save/load screen){{Ref|2}}
|0x0004  ||char[100]||save name (long names are truncated on the save/load screen){{Ref|2}}
|-
|-
|0x0068  ||byte    ||current [[Mission_Pack|mission pack]]
|0x0068  ||byte    ||current [[Mission Pack|mission pack]]
|-
|-
|0x0069  ||byte[3]  ||(Align)
|0x0069  ||byte[3]  ||(Align)
Line 152: Line 152:
Notes:<br>
Notes:<br>
{{Note|1}} Version 2.0 of GTASA will not load a save file if the Version ID String does not match its own Version ID String. Thus if a game was played on a version 1.x exe using the exact same set of mission scripts as a version 2.0 installation, the version 2.0 game will refuse to load the save unless this ID is changed. Version 1.x exes make no Version ID String check and will attempt to load any non-corrupted save. Some known Version ID String values (listed as consecutive bytes):
{{Note|1}} Version 2.0 of GTASA will not load a save file if the Version ID String does not match its own Version ID String. Thus if a game was played on a version 1.x exe using the exact same set of mission scripts as a version 2.0 installation, the version 2.0 game will refuse to load the save unless this ID is changed. Version 1.x exes make no Version ID String check and will attempt to load any non-corrupted save. Some known Version ID String values (listed as consecutive bytes):
* 0x75 0x81 0xDA 0x35 -- Version 1.00 Unmodified EXE
* 0x75 0x81 0xDA 0x35—Version 1.00 Unmodified EXE
* 0x83 0xE5 0xF3 0x65 -- Version 1.00 Modified EXE
* 0x83 0xE5 0xF3 0x65—Version 1.00 Modified EXE
* 0x58 0xBE 0x6E 0x9A -- Version 1.01 Unmodified EXE
* 0x58 0xBE 0x6E 0x9A—Version 1.01 Unmodified EXE
* 0x5E 0x76 0x45 0x93 -- Version 1.01 Modified EXE
* 0x5E 0x76 0x45 0x93—Version 1.01 Modified EXE
* 0xF6 0x8D 0x14 0xFD -- Version 2.00 Unmodified EXE
* 0xF6 0x8D 0x14 0xFD—Version 2.00 Unmodified EXE
* 0x22 0xCC 0x31 0x5D -- Version 2.00 (German)
* 0x22 0xCC 0x31 0x5D—Version 2.00 (German)
* 0xF6 0x8D 0x14 0xFD -- PS2 Version 2 (Greatest Hits)
* 0xF6 0x8D 0x14 0xFD—PS2 Version 2 (Greatest Hits)
* 0x4C 0xDC 0x1D 0x64 -- PS2 Version 1 (Original Edition)<br>
* 0x4C 0xDC 0x1D 0x64—PS2 Version 1 (Original Edition)
{{Note|2}} While the save name can be changed here to pretty much anything, that name will not persist the next time the game is saved, even if no missions were completed during the play session. This is because each time the game is saved this name string is reset based upon the [[GXT]] entry for the Last Mission Passed key stored in Block 16.<br>
{{Note|2}} While the save name can be changed here to pretty much anything, that name will not persist the next time the game is saved, even if no missions were completed during the play session. This is because each time the game is saved this name string is reset based upon the [[GXT]] entry for the Last Mission Passed key stored in Block 16.<br>
{{Note|3}} Time copy flag shows whether the time data was saved using opcode [[0253]].<br>
{{Note|3}} Time copy flag shows whether the time data was saved using opcode [[0253]].<br>
Line 174: Line 174:
  OFFSET  TYPE                      DESCRIPTION
  OFFSET  TYPE                      DESCRIPTION
  0x0000  dword                    Size of Global Variable space
  0x0000  dword                    Size of Global Variable space
  0x0004  dword[]                  Global Variable Space -- every var is 4 bytes; the types can vary
  0x0004  dword[]                  Global Variable Space—every var is 4 bytes; the types can vary
   ...
   ...
  0x0000  ExternalScriptTrigger[70] each is 0x14 bytes in size; see details below
  0x0000  ExternalScriptTrigger[70] each is 0x14 bytes in size; see details below
  0x0578  dword                    OnMissionFlag offset  -- address of the global variable set by opcode 0180
  0x0578  dword                    OnMissionFlag offset—address of the global variable set by opcode 0180
  0x057C  dword                    time when last mission was passed (when either opcode 0318 or 0595 is executed)
  0x057C  dword                    time when last mission was passed (when either opcode 0318 or 0595 is executed)
  0x0580  StaticReplacement[25]    each is 0x10 bytes in size; see details below
  0x0580  StaticReplacement[25]    each is 0x10 bytes in size; see details below
Line 192: Line 192:
  0x08FE  dword                    highest local variable ever in a mission
  0x08FE  dword                    highest local variable ever in a mission
  0x0902  dword                    Number of Running Threads (nThreads)
  0x0902  dword                    Number of Running Threads (nThreads)
  0x0906  Thread[nThreads]          Thread structures -- each is 0x106 bytes in size; see details below
  0x0906  Thread[nThreads]          Thread structures—each is 0x106 bytes in size; see details below


  ExternalScriptTrigger
  ExternalScriptTrigger
Line 199: Line 199:
   0x03  byte                    Type? -- only for ObjectTrigger
   0x03  byte                    Type? -- only for ObjectTrigger
   0x04  dword                    Status?
   0x04  dword                    Status?
   0x08  float                    Radius -- vary only for ObjectTrigger (ActorTrigger uses a pre-defined radius of 5.0)
   0x08  float                    Radius—vary only for ObjectTrigger (ActorTrigger uses a pre-defined radius of 5.0)
   0x0C  word                    modelID
   0x0C  word                    modelID
   0x0E  word                    priority
   0x0E  word                    priority
Line 210: Line 210:
  Thread Structure:
  Thread Structure:
   0x00  word                      Index/Handle
   0x00  word                      Index/Handle
   0x02  byte[224]                Thread Memory Dump -- see details below
   0x02  byte[224]                Thread Memory Dump—see details below
   0xE2  byte[36]                  Relative Addresses -- see details below
   0xE2  byte[36]                  Relative Addresses—see details below


  Thread Memory Dump:
  Thread Memory Dump:
Line 278: Line 278:
  OFFSET  TYPE        DESCRIPTION
  OFFSET  TYPE        DESCRIPTION
  0x00  dword        Number of Players
  0x00  dword        Number of Players
  0x04  Player[]    Player structures -- each is 0x224 bytes in size; see details below
  0x04  Player[]    Player structures—each is 0x224 bytes in size; see details below
  0x00  dword        Number of Objects
  0x00  dword        Number of Objects
  0x04  Object[]    Object structures -- each is 0x3C bytes in size; see details below
  0x04  Object[]    Object structures—each is 0x3C bytes in size; see details below


  Player Structure:
  Player Structure:
Line 291: Line 291:
   0x001C  float      Health
   0x001C  float      Health
   0x0020  float      Armor
   0x0020  float      Armor
   0x0024  Weapon[13] Weapon Structure -- each is 0x1C in size; see details below
   0x0024  Weapon[13] Weapon Structure—each is 0x1C in size; see details below
   0x0190  byte      Ped reference (normally 2)
   0x0190  byte      Ped reference (normally 2)
   0x0191  byte      Current weapon slot
   0x0191  byte      Current weapon slot
Line 367: Line 367:
  0x0013  dword[4]      (Unknown)
  0x0013  dword[4]      (Unknown)
  0x0023  dword        (Unknown)
  0x0023  dword        (Unknown)
  0x0027  GrgCar[20][4] Garage Car structures -- each is 0x40 bytes in size; see details below
  0x0027  GrgCar[20][4] Garage Car structures—each is 0x40 bytes in size; see details below
  0x1427  Garage[]      Garage structures -- each is 0x50 bytes in size; see details below
  0x1427  Garage[]      Garage structures—each is 0x50 bytes in size; see details below


  Garage Car Structure (GrgCar):
  Garage Car Structure (GrgCar):
Line 403: Line 403:
   0x3C  float        Door is Open = 1
   0x3C  float        Door is Open = 1
   0x40  float        (Unknown)door timer/timestamp?
   0x40  float        (Unknown)door timer/timestamp?
   0x44  char[8]      Garage Name -- can be used by mission script to access garage
   0x44  char[8]      Garage Name—can be used by mission script to access garage
   0x4C  word          (Unknown) Possibly Original Type
   0x4C  word          (Unknown) Possibly Original Type
   0x4E  byte[2]      (Align?)
   0x4E  byte[2]      (Align?)
Line 470: Line 470:
====Block 5: Disabled Pathnode Cubes====
====Block 5: Disabled Pathnode Cubes====
   0x00    dword          count
   0x00    dword          count
   0x04    Entry[count]    entries  --0x1C size
   0x04    Entry[count]    entries—0x1C size
    
    
  Entry structure:
  Entry structure:
Line 480: Line 480:
====Block 6: Pickups====
====Block 6: Pickups====


  0x0000  Pickup[620]    Pickups  --Size 0x20
  0x0000  Pickup[620]    Pickups—Size 0x20
  0x4D80  word            Number of pickups being picked up (up to 20)
  0x4D80  word            Number of pickups being picked up (up to 20)
  0x4D82  byte            Weapon pickup message counter (see note 1 below)
  0x4D82  byte            Weapon pickup message counter (see note 1 below)
Line 539: Line 539:
====Block 9: Markers====
====Block 9: Markers====
  OFFSET  TYPE          DESCRIPTION
  OFFSET  TYPE          DESCRIPTION
  0x0000  Markers[175]  Marker structures -- each is 0x28 bytes in size, see details below
  0x0000  Markers[175]  Marker structures—each is 0x28 bytes in size, see details below
  0x1B58  end  
  0x1B58  end  


Line 609: Line 609:
====Block 11: Gang Weapons====
====Block 11: Gang Weapons====
  OFFSET  TYPE            DESCRIPTION
  OFFSET  TYPE            DESCRIPTION
  0x0000  GangWeapons[10] GangWeapons structures -- each is 0x10 bytes in size; see details below
  0x0000  GangWeapons[10] GangWeapons structures—each is 0x10 bytes in size; see details below
  0x00A0  (end)
  0x00A0  (end)


Line 704: Line 704:
  OFFSET  TYPE                  DESCRIPTION
  OFFSET  TYPE                  DESCRIPTION
  0x0000  dword                  Number of Police trigger zones  
  0x0000  dword                  Number of Police trigger zones  
  0x0004  PoliceTriggerZone[210] Trigger structures -- each is 0x20 bytes in size; see details below
  0x0004  PoliceTriggerZone[210] Trigger structures—each is 0x20 bytes in size; see details below
  0x1A44                        end
  0x1A44                        end


Line 746: Line 746:
====Block 19: Ped Acquaintances====
====Block 19: Ped Acquaintances====
  OFFSET  TYPE                      DESCRIPTION
  OFFSET  TYPE                      DESCRIPTION
  0x000  PedAcquaintance[32]        PedAcquaintance structures, each is 20 bytes in size -- see details below
  0x000  PedAcquaintance[32]        PedAcquaintance structures, each is 20 bytes in size—see details below
  0x280  end
  0x280  end


  PedAcquaintance -- See notes below
  PedAcquaintance—See notes below
   0x00  dword    respect bitmask
   0x00  dword    respect bitmask
   0x04  dword    like bitmask
   0x04  dword    like bitmask
Line 831: Line 831:
  OFFSET  TYPE        DESCRIPTION
  OFFSET  TYPE        DESCRIPTION
  0x0000  dword      Number of [[JUMP|Unique Stunt Jumps]] (USJ)
  0x0000  dword      Number of [[JUMP|Unique Stunt Jumps]] (USJ)
  0x0004  StuntJump[] Jump structures -- each is 0x44 bytes in size; see details below
  0x0004  StuntJump[] Jump structures—each is 0x44 bytes in size; see details below


  StuntJump -- See note below
  StuntJump—See note below
   0x00  float[3]    Start zone point 1 (x,y,z)
   0x00  float[3]    Start zone point 1 (x,y,z)
   0x0C  float[3]    Start zone point 2 (x,y,z)
   0x0C  float[3]    Start zone point 2 (x,y,z)
Line 844: Line 844:
   0x42  byte[2]    (Align)
   0x42  byte[2]    (Align)


The starting and landing zones are cubes; each is defined by 2 points -- point 1 is the lower, left, front of the cube and point 2 is the upper, right, rear. These cubes are aligned with the coordinate axes and not rotated at all. If a vehicle enters the starting zone while airborne, the USJ triggers (and is marked as 'found'); if the vehicle then lands inside the landing zone, the USJ is successful (and is marked as 'done') and the reward is given.
The starting and landing zones are cubes; each is defined by 2 points—point 1 is the lower, left, front of the cube and point 2 is the upper, right, rear. These cubes are aligned with the coordinate axes and not rotated at all. If a vehicle enters the starting zone while airborne, the USJ triggers (and is marked as 'found'); if the vehicle then lands inside the landing zone, the USJ is successful (and is marked as 'done') and the reward is given.


====Block 25: ENEX Connections====
====Block 25: ENEX Connections====
Line 881: Line 881:
This block contains data relating to various radio stations. The bulk of the block is an array of data structures for each station. Not much is known about these structures currently but part of the data seems to be a record of which tracks have played recently. Following this array of structures there is a collection of byte flags which are related to high-number player Stats. These Stats are used to trigger different episodes and radio clips throughout the game. Note that the "set by" comments refer to missions in the original, unmodified game and they can obviously be set at different times instead.
This block contains data relating to various radio stations. The bulk of the block is an array of data structures for each station. Not much is known about these structures currently but part of the data seems to be a record of which tracks have played recently. Following this array of structures there is a collection of byte flags which are related to high-number player Stats. These Stats are used to trigger different episodes and radio clips throughout the game. Note that the "set by" comments refer to missions in the original, unmodified game and they can obviously be set at different times instead.
   
   
  0x0000 StationInfo[14] State info for radio stations; each is 0x110 in size -- see details below
  0x0000 StationInfo[14] State info for radio stations; each is 0x110 in size—see details below
  0x0EE0 byte            Cities Unlocked (stat 181)
  0x0EE0 byte            Cities Unlocked (stat 181)
  0x0EE1 byte            (stat 327; set by "Learning to Fly")
  0x0EE1 byte            (stat 327; set by "Learning to Fly")
Line 933: Line 933:
   10  RG  Master Sounds
   10  RG  Master Sounds
   11  TK  WCTR
   11  TK  WCTR
   12  --  User Track Player
   12—User Track Player
   13  ??  (Unknown)
   13  ??  (Unknown)


====Block 27: Entrance markers====
====Block 27: Entrance markers====
{|{{Prettytable}}
{|class="prettytable"
!OFFSET
!OFFSET
!TYPE
!TYPE
Line 947: Line 947:
|}
|}


{|{{Prettytable}}
{|class="prettytable"
|+CEntranceMarker struct
|+CEntranceMarker struct
!OFFSET
!OFFSET
Line 985: Line 985:
* GTA:SA Save Game Tool v1.0 http://home.comcast.net/~shamblertm/pages/gtasa_sgt.html
* GTA:SA Save Game Tool v1.0 http://home.comcast.net/~shamblertm/pages/gtasa_sgt.html


{{SA-navi}}
{{gtasa}}
[[Category:Save Formats]]{{fdl}}
[[Category:Save Formats]]{{fdl}}
25,470

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.