I am using Unity 2017.4.40f1 with EZ 2 and Playmaker 1.8.5
I just updated my app from V1 to V2
In V1 I use an array to save which items where purchased or free of charge.
In V2 I added more items, so I have a larger array.
So far I checked, if the save-file exists and if so, I load the data. Works fine. But now in V2 it can only load the "old" data of course and I am kind of stuck how to update the array in the save file without losing the save data and adding my new data.
As for now, when I load the array from the V1 saved file, it will override ("delete") my new items, as they are all set to "0".
Is there a (playmaker) function, to check if an array entry exsists in the save file? Or any other ideas, how to solve this problem?
And is there a way to manually shorten the array in EZ2/Unity using the file editor for testing purpose?
Check for Update/enlarge existing array
Re: Check for Update/enlarge existing array
Hi there,
I'm not sure I understand what you mean, would you be able to give me a summary of the code you're using and how this differs between versions?
If I understand correctly, you would need to load the old array, and then convert it to a new array.
All the best,
Joel
I'm not sure I understand what you mean, would you be able to give me a summary of the code you're using and how this differs between versions?
If I understand correctly, you would need to load the old array, and then convert it to a new array.
All the best,
Joel
Re: Check for Update/enlarge existing array
The main problem was, that when I was loading the array list data from the save file, it shortened the array, which had more entries by definition in the new version.
Version 1: array list with 7 items.
Version 2: array list with 10 items.
When I loaded the save file, the array list in V2 was shortened to 7 items. So instead of loading the data for the first 7 items and keeping the new three, it replaces the array list. Right?
I build a solution where I check if item 8 is available after loading and if not, I add the 3 new items manually.
Version 1: array list with 7 items.
Version 2: array list with 10 items.
When I loaded the save file, the array list in V2 was shortened to 7 items. So instead of loading the data for the first 7 items and keeping the new three, it replaces the array list. Right?
I build a solution where I check if item 8 is available after loading and if not, I add the 3 new items manually.
Re: Check for Update/enlarge existing array
So just to make sure I'm understanding correctly:
All the best,
Joel
- In version one your code expects to load an array of 7 items
- In version two your code expects to load an array of 10 items
All the best,
Joel