Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
savegame:tr4 [2017/01/30 22:56] – created zdimensiontrs:savegame:tr4 [2017/03/25 19:20] (current) zdimension
Line 3: Line 3:
 [[https://sappersblog.blogspot.com/2016/10/trle-file-formats-savegame.html|original research by sapper]], minor improvements by zdimension [[https://sappersblog.blogspot.com/2016/10/trle-file-formats-savegame.html|original research by sapper]], minor improvements by zdimension
 <code cpp> <code cpp>
-struct tr4_savegame+struct TR4Savegame
 { {
-    uint8_t LevelName[40]; // CP437 C string; null-terminated (data after \0 is ignored) +    uint8_t levelName[75]; // CP437 C string; null-terminated (data after \0 is ignored) 
-    uint8_t unknown1[35]; +    int32_t saveNumber
-    int32_t SaveNumber+    uint16_t days
-    uint16_t Days+    uint16_t hours
-    uint16_t Hours+    uint16_t minutes
-    uint16_t Minutes+    uint16_t seconds
-    uint16_t Seconds+    int16_t laraIndex
-    int16_t LaraIndex+    int16_t laraArmAction
-    int16_t LaraArmAction+    int16_t currentItemInHand
-    int16_t CurrentItemInHand+    int16_t changeToItemInHand
-    int16_t ChangeToItemInHand+    int16_t activeWeapon;
-    int16_t ActiveWeapon;+
     uint8_t unknown2[6];     uint8_t unknown2[6];
-    int16_t LaraAir;+    int16_t laraAir;
     uint8_t unknown3[20];     uint8_t unknown3[20];
-    int16_t WeaponOnBack;+    int16_t weaponOnBack;
     uint8_t unknown3b[2];     uint8_t unknown3b[2];
-    int16_t LaraPoison1+    int16_t laraPoison1
-    int16_t LaraPoison2;+    int16_t laraPoison2;
     uint8_t unknown3a[16];     uint8_t unknown3a[16];
-    uint8_t LaraSpecialStatus; // 0x4 = Normal; 0xC = Burning Lara; Anything other = save doesn't appear+    uint8_t laraSpecialStatus; // 0x4 = Normal; 0xC = Burning Lara; Anything other = save doesn't appear
     uint8_t unknown4[95];     uint8_t unknown4[95];
-    int16_t LaraFacing; // Matches data for item below+    int16_t laraFacing; // Matches data for item below
     uint8_t unknown4a[108];     uint8_t unknown4a[108];
-    uint8_t Pistols; // 0 = missing; 9 = present +    uint8_t pistols; // 0 = missing; 9 = present 
-    uint8_t Uzis; // 0 = missing; 1 = present +    uint8_t uzis; // 0 = missing; 1 = present 
-    uint8_t Shotgun; // 0 = missing; 9 = present +    uint8_t shotgun; // 0 = missing; 9 = present 
-    uint8_t Crossbow; // 0 = missing; 9 = present; 13 = combined with lasersight +    uint8_t crossbow; // 0 = missing; 9 = present; 13 = combined with lasersight 
-    uint8_t GrenadeGun; // 0 = missing; 9 = present +    uint8_t grenadeGun; // 0 = missing; 9 = present 
-    uint8_t Revolver; // 0 = missing; 1 = present; 5 = combined with lasersight +    uint8_t revolver; // 0 = missing; 1 = present; 5 = combined with lasersight 
-    uint8_t LaserSight; // 0 = missing or combined; 1 = present separated +    uint8_t laserSight; // 0 = missing or combined; 1 = present separated 
-    uint8_t Binoculars+    uint8_t binoculars
-    uint8_t Crowbar+    uint8_t crowbar
-    uint8_t MechanicalScarab+    uint8_t mechanicalScarab
-    uint8_t SmallWaterSkin+    uint8_t smallWaterSkin
-    int8_t LargeWaterSkin+    int8_t largeWaterSkin
-    uint8_t Examine[3]; +    uint8_t examine[3]; 
-    uint8_t PuzzleItems[12]; +    uint8_t puzzleItems[12]; 
-    uint8_t PuzzleItem1_4Combo+    uint8_t puzzleItem1_4Combo
-    uint8_t PuzzleItem5_8Combo+    uint8_t puzzleItem5_8Combo
-    uint8_t KeyItem1_8+    uint8_t keyItem1_8
-    uint8_t KeyItem9_12+    uint8_t keyItem9_12
-    uint8_t KeyItem1_4Combo+    uint8_t keyItem1_4Combo
-    uint8_t KeyItem5_8Combo+    uint8_t keyItem5_8Combo
-    uint8_t PickupItem1_4;+    uint8_t pickupItem1_4;
     uint8_t unknown5;     uint8_t unknown5;
-    uint8_t PickupItem1_4Combo;+    uint8_t pickupItem1_4Combo;
     uint8_t unknown6;     uint8_t unknown6;
-    uint8_t QuestItem1_6;+    uint8_t questItem1_6;
     uint8_t unknown7;     uint8_t unknown7;
-    int16_t SmallMediPacks; // 65535 means unlimited +    int16_t smallMediPacks; // 65535 means unlimited 
-    int16_t LargeMediPacks; // 65535 means unlimited +    int16_t largeMediPacks; // 65535 means unlimited 
-    int16_t Flares; // 65535 means unlimited +    int16_t flares; // 65535 means unlimited 
-    int16_t PistolAmmo+    int16_t pistolAmmo
-    int16_t UziAmmo+    int16_t uziAmmo
-    int16_t RevolverAmmo+    int16_t revolverAmmo
-    int16_t ShotgunAmmo[2]; // normal; wide, divide by 6 for real value +    int16_t shotgunAmmo[2]; // normal; wide, divide by 6 for real value 
-    int16_t GrenadeAmmo[3]; // normal; super; flash +    int16_t grenadeAmmo[3]; // normal; super; flash 
-    int16_t CrossbowAmmo[3]; // normal; poison; explosive +    int16_t crossbowAmmo[3]; // normal; poison; explosive 
-    int16_t MEchanicalScarabRemaining;+    int16_t mechanicalScarabRemaining;
     uint8_t unknown8[57];     uint8_t unknown8[57];
-    uint8_t LevelNumber;+    uint8_t levelNumber;
     uint8_t unknown9; // clock??     uint8_t unknown9; // clock??
-    uint32_t TimeTaken; // in game ticks (1/30th of a second), so divide by 30 for time in seconds +    uint32_t timeTaken; // in game ticks (1/30th of a second), so divide by 30 for time in seconds 
-    uint32_t DistanceTravelled; // Divide by 419.15 for value in meters +    uint32_t distanceTravelled; // Divide by 419.15 for value in meters 
-    int32_t AmmoUsed+    int32_t ammoUsed
-    int32_t Hits;+    int32_t hits;
     uint8_t unknown10[2];     uint8_t unknown10[2];
-    uint8_t Secrets+    uint8_t secrets
-    uint8_t HealthPacksUsed;+    uint8_t healthPacksUsed;
     uint8_t unknown11[16];     uint8_t unknown11[16];
-    uint16_t Kills;+    uint16_t kills;
     uint8_t unknown11a[11];     uint8_t unknown11a[11];
     struct     struct
Line 84: Line 83:
         uint8_t green;         uint8_t green;
         uint8_t red;         uint8_t red;
-    } FogColour+    } fogColour
-    int8_t AutoAimingForEnemy;+    int8_t autoAimingForEnemy;
     uint8_t unknown12[172];     uint8_t unknown12[172];
-    uint8_t TheGreatUnknown[];+    uint8_t theGreatUnknown[];
  
 // When reading a TR4 savegame, first jump to EOF - 8 and check if the string "NGLE" // When reading a TR4 savegame, first jump to EOF - 8 and check if the string "NGLE"
 // is present. If that is the case, then it is a NGLE savegame. // is present. If that is the case, then it is a NGLE savegame.
-// It means that the "standard" TR4 save info (TheGreatUnknown) will have +// It means that the "standard" TR4 save info (theGreatUnknown) will have 
-// a length of (file length) - (pos of TheGreatUnknown) - NGHeader.size+// a length of (file length) - (pos of theGreatUnknown) - sizof(ngHeader)
 #if NGLE #if NGLE
     struct     struct
Line 98: Line 97:
         uint8_t data[size - 8];         uint8_t data[size - 8];
         uint8_t signature[4]; // ASCII string; always "NGLE"         uint8_t signature[4]; // ASCII string; always "NGLE"
-        uint32_t size; +        uint32_t size; // size of the file - size of ngHeader 
-    } NGHeader;+    } ngHeader;
 #endif #endif
 }; };
 </code> </code>
trs/savegame/tr4.txt · Last modified: 2017/03/25 19:20 by zdimension
Back to top
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0