Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ME1 Savegame serialization issue #3

Open
Mgamerz opened this issue Apr 9, 2023 · 3 comments
Open

ME1 Savegame serialization issue #3

Mgamerz opened this issue Apr 9, 2023 · 3 comments

Comments

@Mgamerz
Copy link

Mgamerz commented Apr 9, 2023

I'm working on converting this to C# classes and am seeing a duplicate variable declared here of ClassName:
https://github.com/electronicarts/MELE_ModdingSupport/blob/master/DataFormats/ME1_Savegame.h#L377

I assume this is an accident?

@KarlitosVII
Copy link

KarlitosVII commented Apr 9, 2023

It's not a class name like Soldier or Adept but an Unreal class name needed by the game when it deserialize the file.
In your example this is the class name of the squad and the inventory but they are only deserialized if the boolean is true.

Capture

@Mgamerz
Copy link
Author

Mgamerz commented Apr 9, 2023 via email

@KarlitosVII
Copy link

KarlitosVII commented Apr 9, 2023

It's just a string that tells the deserializer how to deserialize the next bytes. You have to read this string to know which class to use. Just like I did here:

https://github.com/KarlitosVII/trilogy-save-editor/blob/main/src/save_data/mass_effect_1_le/legacy/mod.rs#L62-L84

In the same way, when you serialize you must indicate the name of the class before serializing the object.

Throughout the Legacy part of LE1, as soon as you see ClassName and LEGACY_BaseObjectSaveRecord , the only way to guess how to deserialize is at runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants