possible to preserve Dictionary data during savegame / load?

Discussion and feedback on Construct 2

Post » Thu Sep 21, 2017 2:19 am

Is there a way to preserve dictionary data from being included in the save state when using System Save / Load? There is a No Save behaviour that can be added to sprites, but I need to achieve a similar thing for data stored in a dictionary.

I have a fairly ugly work-around happening at the moment where, following a System > Save event, values that are changed and stored in a dictionary are saved to LocalStorage. Then following System > Load, these new values are read from LocalStorage and put back into the relevant dictionaries, but this is not ideal because there is a fraction of a second where, on System > Load, values revert to the saved state, before being updated to the values stored in LocalStorage... it's just not a good way of doing it I guess. It would be better if I could stop that data being changed back to the saved state somehow?

Im aware of rex's plugin 'instance bank', but if I understand properly I would need to go through and specify all objects to be included in a saved state, leaving out dictionaries? I think it would be hard to make this plugin recreate the way the native System Save / Load functions work, so im hesitant to head off down that route.

Basically the native System Save / Load works great, but I would just really love to be able to exclude data in a single dictionary (or possibly all dictionaries) from being affected. Is this possible?
B
77
S
53
G
62
Posts: 407
Reputation: 39,257

Post » Fri Sep 22, 2017 8:22 am

In my opinion, your current 'workaround' is pretty good as it is. If the solution is consistently working, and does not show itself to be prone to bugs, then why not consider that as a feasible solution?
B
47
S
13
G
1
Posts: 85
Reputation: 3,239

Post » Sat Sep 23, 2017 2:41 am

Well I will have to use the work-around if there is no better way. I just feel like this solution has the potential for problems. While it does work, im not sure how robust it is. It would be better if I could prevent the dictionary data from being changed back to the saved state somehow. I guess thats just not possible though? The option doesnt exit to omit dictionaries from System Save / Load. ?
B
77
S
53
G
62
Posts: 407
Reputation: 39,257


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 10 guests