Attribute for reference

Discussion and help for Easy Save 3
Post Reply
giltar
Posts: 8
Joined: Sun Feb 27, 2022 1:07 pm

Attribute for reference

Post by giltar »

Hey, I found this feature request that does not seem to have much support. That means people have some workaround how to save certain properties by reference (value or both as mention in the feature request). Can anyone please share it? I have no Idea how to implement it properly. Thank you

This it the request:
https://moodkie.com/forum/viewtopic.php?f=14&t=1995
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Attribute for reference

Post by Joel »

Hi there,

To do this you would create an ES3Type (see https://docs.moodkie.com/easy-save-3/es ... g-es3types), and then modify the writer.WriteProperty calls in ES3Type to include the memberReferenceMode parameter.

I.e. instead of this:

Code: Select all

writer.WritePropertyByRef("dict", instance.dict);
Use this:

Code: Select all

writer.WriteProperty("dict", instance.dict, ES3.ReferenceMode.ByRefAndValue);
However, we've seen very few situations where people have needed to do this over the past 10 or so years we've been doing this, which is why it's not explicitly documented and hasn't been implemented as attributes.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply