Open Shoggomo opened 2 months ago
Missing property seems to either be a NameProperty
or a StrProperty
, most likely StrProperty
.
Thanks, that got me further, but it's still not working and this looks weird. I'm getting this error (i added the the start, end and length prints).
panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/gvas-0.9.0/src/properties/map_property.rs:444:5:
assertion `left == right` failed: read_body read 0x6a, expected 0x680
Start: 59364
End: 59470
Length: 1664
Properties { key_type: "ByteProperty", value_type: "BoolProperty", allocation_flags: 0, value: {ByteProperty(ByteProperty { name: None, value: Byte(28) }): BoolProperty(false), ByteProperty(ByteProperty { name: None, value: Byte(0) }): BoolProperty(false), ByteProperty(ByteProperty { name: None, value: Byte(69) }): BoolProperty(true), ByteProperty(ByteProperty { name: None, value: Byte(84) }): BoolProperty(true), ByteProperty(ByteProperty { name: None, value: Byte(116) }): BoolProperty(true), ByteProperty(ByteProperty { name: None, value: Byte(114) }): BoolProperty(true), ByteProperty(ByteProperty { name: None, value: Byte(97) }): BoolProperty(true), ByteProperty(ByteProperty { name: None, value: Byte(115) }): BoolProperty(true), ByteProperty(ByteProperty { name: None, value: Byte(58) }): BoolProperty(true), ByteProperty(ByteProperty { name: None, value: Byte(101) }): BoolProperty(true), ByteProperty(ByteProperty { name: None, value: Byte(117) }): BoolProperty(true), ByteProperty(ByteProperty { name: None, value: Byte(111) }): BoolProperty(true), ByteProperty(ByteProperty { name: None, value: Byte(48) }): BoolProperty(false), ByteProperty(ByteProperty { name: None, value: Byte(95) }): BoolProperty(true), ByteProperty(ByteProperty { name: None, value: Byte(105) }): BoolProperty(true), ByteProperty(ByteProperty { name: None, value: Byte(108) }): BoolProperty(true), ByteProperty(ByteProperty { name: None, value: Byte(78) }): BoolProperty(true), ByteProperty(ByteProperty { name: None, value: Byte(119) }): BoolProperty(true), ByteProperty(ByteProperty { name: None, value: Byte(110) }): BoolProperty(true), ByteProperty(ByteProperty { name: None, value: Byte(109) }): BoolProperty(true), ByteProperty(ByteProperty { name: None, value: Byte(50) }): BoolProperty(false)} }
left: 106
right: 1664
Here is the corresponding section from the save file:
It looks like this should be a map of booleans, but it's clearly not. What's going on there?
@trumank explained to me, that ByteProperties can have an additional label, in case an named Enum is used. More about it can be read here https://github.com/trumank/uesave-rs/issues/41#issuecomment-2105965642
This library supports "namespaced" bytes, you could try something like:
diff --git a/src/properties/map_property.rs b/src/properties/map_property.rs
index 203fc9a..7723e06 100644
--- a/src/properties/map_property.rs
+++ b/src/properties/map_property.rs
@@ -457,7 +457,11 @@ impl MapProperty {
for _ in 0..element_count {
let properties_stack = &mut options.properties_stack;
let key_stack_entry = ScopedStackEntry::new(properties_stack, "Key".to_string());
- let key = Property::new(cursor, &key_type, false, options, None)?;
+ let suggested_length = match key_type.as_ref() {
+ "ByteProperty" => Some(u32::MAX),
+ _ => None,
+ };
+ let key = Property::new(cursor, &key_type, false, options, suggested_length)?;
drop(key_stack_entry);
let properties_stack = &mut options.properties_stack;
UE5 file format version 1012 (PROPERTY_TAG_COMPLETE_TYPE_NAME
) introduces some changes to the format that will need to be considered.
https://github.com/EpicGames/UnrealEngine/commit/9fb9d5f0f12bb2d46fbab507141394680d699d4e
On closer inspection, the provided save file does not have PROPERTY_TAG_COMPLETE_TYPE_NAME
enabled (the UE version is older than this feature), however the ByteProperty objects definitely do contain strings in the attached file. More research is required to understand why this game is using this format, and how to detect which variant of ByteProperty should be used.
I want to build a save editor for Medieval Dynasty and use this library for it.
When trying to load a save I'm missing a hint though and I cannot figure out, how to fix this.
Error:
Err(Deserialize(MissingHint("StructProperty", "LandscapeData.MapProperty.Value.StructProperty", 1789)))
This should be the correct section:
Here's my save file: Autosave.zip