How do I transfer data between JSON files?

  • Hi I have some JSON files in the properties bar. Lets say I have Player 1 in one JSON file and player 2 in another JSON file how can I swap these?

  • In the editor? Simply rename the files, or copy-paste the content. Or do you mean something else?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In the editor? Simply rename the files, or copy-paste the content. Or do you mean something else?

    dop2000

    What I mean is I have files like this:

    They have a structure like this:

    How would I transfer a player from one to another?

  • You want to transfer it in the editor? Simply select the cells you want to transfer, press Ctrl-C, open another file, place cursor where you want to insert these cells, press Ctrl-V.

    Have you ever used Excel? It's very similar.

  • You want to transfer it in the editor? Simply select the cells you want to transfer, press Ctrl-C, open another file, place cursor where you want to insert these cells, press Ctrl-V.

    Have you ever used Excel? It's very similar.

    dop2000

    No How do I transfer using events?

  • In runtime you can move data from one array to another, by copying from cell to cell - "Array2 Set value at (X,Y) to Array1.at(X,Y)". Do this in a loop, if you need to copy the entire row or column.

    But it is not possible to modify JSON files in the project, so you will not be able to save modified arrays in the same JSON files. You can write them to Local Storage or some cloud storage.

  • In runtime you can move data from one array to another, by copying from cell to cell - "Array2 Set value at (X,Y) to Array1.at(X,Y)". Do this in a loop, if you need to copy the entire row or column.

    But it is not possible to modify JSON files in the project, so you will not be able to save modified arrays in the same JSON files. You can write them to Local Storage or some cloud storage.

    Ok thank you!

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