Problem with array download as json

Get help using Construct 2

Post » Thu Aug 22, 2013 4:40 pm

I'm making a very basic level editor, & its save function works by creating a temporary tester sprite which scans over the playing grid, & an array is then filled with values from objects that overlap the tester.

The problem I'm having is that when downloading the array as a text file, it doesn't always save properly. Sometimes it downloads what looks like a random string of chinese characters, other times it works.

The problem can usually be fixed in the level editor by pressing its reset button (clearing the array & playing grid of objects), then laying out again & saving.

Any idea what might be causing this hit & miss behaviour?


fyi here's what the save events look like:

B
27
S
12
G
1
Posts: 157
Reputation: 3,359

Post » Thu Aug 22, 2013 6:45 pm

Weird, but why are you saving it as a .txt? You can save it as a .json just fine and open it with notepad. Maybe that's it but I doubt it..
B
122
S
41
G
40
Posts: 846
Reputation: 27,894

Post » Thu Aug 22, 2013 7:52 pm

I'm using the FileReader plugin for loading back into the array, so file extension doesn't matter. I did try saving it as a json too, & that has the same hit & miss wierdness.
B
27
S
12
G
1
Posts: 157
Reputation: 3,359


Return to How do I....?

Who is online

Users browsing this forum: marc254 and 9 guests