Problem with array download as json

  • 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:

    <img src="https://dl.dropboxusercontent.com/u/52354372/save_array_problem.png" border="0" />

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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..

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)