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

MBObjectBase / Generic Saveable Class #5

Open
brandonm4 opened this issue Apr 12, 2020 · 1 comment
Open

MBObjectBase / Generic Saveable Class #5

brandonm4 opened this issue Apr 12, 2020 · 1 comment

Comments

@brandonm4
Copy link

What about a generic save structure, so we don't have to come up with unique saveable classids for our MBObjectBase objects?

Something like:

[SaveableClass(5001000)]
GenericSaveData : MBObjectBase
{
 [SaveableProperty(100)]
 public string ModuleId {get;set;}  //same as the SubModule module id
 [SaveableProperty(200)]
 public string ModuleReference {get;set;}  //reference for the module to know what type of data is here
 [SaveableProperty(300)]
public string JsonData {get;set;}
}

This way we could serialize/deserialize our data objects without stepping on other modules toes / data object by accidentally using the same SaveableClass id.

Or is this not even a potential problem?

@sirdoombox
Copy link
Owner

It seems like currently there's a bug somewhere in Taleworlds save system that makes this a bit of a risky proposition. I'm considering something for this but right now I'm not 100% what the right way to go about it is to prevent bricking saves.

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