Expand description
Gvas
UE4 Save File parsing library
§Examples
use gvas::{error::Error, GvasFile};
use std::{
fs::File,
};
use gvas::game_version::GameVersion;
let mut file = File::open("save.sav")?;
let gvas_file = GvasFile::read(&mut file, GameVersion::Default);
println!("{:#?}", gvas_file);
§Hints
If your file fails while parsing with a DeserializeError::MissingHint
error you need hints.
When a struct is stored inside ArrayProperty/SetProperty/MapProperty in GvasFile it does not contain type annotations.
This means that a library parsing the file must know the type beforehand. That’s why you need hints.
The error usually looks like this:
ⓘ
MissingHint(
"StructProperty" /* property type */,
"UnLockedMissionParameters.MapProperty.Key.StructProperty" /* property path */,
120550 /* position */)
To get a hint type you need to look at the position of DeserializeError::MissingHint
error.
Then you go to that position in the file and try to determine which type the struct has.
Afterwards you parse the file like this:
use gvas::{error::Error, GvasFile};
use std::{
collections::HashMap,
fs::File,
};
use gvas::game_version::GameVersion;
let mut file = File::open("save.sav")?;
let mut hints = HashMap::new();
hints.insert("UnLockedMissionParameters.MapProperty.Key.StructProperty".to_string(), "Guid".to_string());
let gvas_file = GvasFile::read_with_hints(&mut file, GameVersion::Default, &hints);
println!("{:#?}", gvas_file);
Modules§
- cursor_
ext - Extensions for
Cursor
. - custom_
version - Custom version information. Custom version information
- engine_
version - Engine version information. Engine version information
- error
- Error types.
- game_
version - Game version enumeration. Game version enumeration
- object_
version - Object version information.
- properties
- Property types.
- savegame_
version - Savegame version information.
- types
- Various types.
Structs§
- Gvas
File - Main UE4 save file struct
Enums§
- Gvas
Header - Stores information about GVAS file, engine version, etc.
Constants§
- FILE_
TYPE_ GVAS - The four bytes ‘GVAS’ appear at the beginning of every GVAS file.