Página 1 de 1

[MoonLoader] LoadSaver: Loading and Saving Support

Enviado: 12 Dez 2020, 12:15
por HzanRsxa2959
Hey guys.

Note: Requires the latest version of CLEO+ to work.

This is a utility library that adds support to MoonLoader for loading and saving data.
The data is stored in the current save file directory\LoadSaver Data.


How it works:
  • Suppose you programmed the script to save a table using inicfg, then you saved the game.
  • You set the save string ID as Test. The crc32 of your save game is FFFF0000 (in hex). Current save location is Documents\GTA San Andreas User Files.
  • A file will be created:
    Documents\GTA San Andreas User Files\LoadSaver Data\Test\FFFF0000.b
  • This file contains your mod's save data.

Note: You can read and write your data however you want, this library only gives you the path of the file which you will read and write the data from.

Advantages:
  • Data location depends on current save file location, unlike MoonLoader which stores all save data in Documents\GTA San Andreas User Files.
  • Data location depends on the crc32 of the saved file, unlike MoonLoader which loads data based on current save slot.
  • Supports names! You can use a string identifier to load and save your data. Changes in the crc32 of the script will not prevent data from being loaded.
  • You can choose the method you want to save the data. The target file has the extension b.

Disadvantages:
  • Does not work with Quick Save mods.
  • Right after loading the game, needs to wait for one frame before loading data.

Download:
The download comes with an example script. Study it to learn more about how it works.
1.0

Thoughts welcome!