How do I upload array from file?

0 favourites
  • 6 posts
From the Asset Store
You can upload screenshots and photos to your server very easily.
  • So I want to make a game with a level editor that lets you save an array containing the positions of the platforms. This worked perfectly, and upon opening the file in notepad it does in fact show the positions of every platform. But when I try to load the file into my game using the following code:

    I did some testing and the first two events seem to work, but the third one does not execute at all.

    What am I doing wrong?

    Tagged:

  • You probably need to remove "Array load" action from the second event.

    If this doesn't help - add browser logging to events, to see if they are triggered.

    Why are you using FileSystem for this? It would be easier to simply import the array into the project and request it with AJAX.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I already tried browser logging, and this is a file that users will make in another place and then upload into the project.

    Take Micrsoft Word for example:

    It doesn't have save slots, that would be stupid.

    And it has no way to know what the user's file will look like.

    I can't download a copy of a file someone makes on my program a month from now.

    And I already removed that event. Sorry, bad picture.

  • So is the third event from your screenshot not triggered at all? Or is it triggered, but the array is not updated?

  • The third event is not triggered at all. I am afraid I am using the wrong trigger, but I do not have as much experience with the File System as other objects.

  • I think it's the right trigger, but check the official example:

    editor.construct.net

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