How do I write data in json file

Get help using Construct 2

Post » Mon Jun 06, 2016 5:32 pm

I'm creating a educational game where the user have to write synonyms and antonyms of suggested words. I need to use a previous json data to compare the words and I need to write the words the user wrote in another json file, besides the time elapsed and the points for each word that the user find. I just know how to read json but I don't know how to write all this data.
B
4
S
2
Posts: 129
Reputation: 858

Post » Tue Jun 07, 2016 10:50 am

Is it so difficult that no one can answer it??
B
4
S
2
Posts: 129
Reputation: 858

Post » Tue Jun 07, 2016 4:23 pm

Braus wrote:I just know how to read json but I don't know how to write all this data.


plugin-json-import-export-generate-edit-inspect_t100042

Besides that, you can get the json from arrays and dictionarys. Fill an array, or fill a dictionary. Store its json in the local storage.

https://www.scirra.com/manual/188/local-storage
https://www.scirra.com/manual/108/array
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Tue Jun 07, 2016 5:47 pm

Message: Braus can only post plain text URLS until they have 500 rep. 3 URLS modified. Why?
99Instances2Go wrote:
Braus wrote:I just know how to read json but I don't know how to write all this data.


plugin-json-import-export-generate-edit-inspect_t100042

Besides that, you can get the json from arrays and dictionarys. Fill an array, or fill a dictionary. Store its json in the local storage.

https://www.scirra.com/manual/188/local-storage
https://www.scirra.com/manual/108/array



Thanks

I've found this plugin but I think that I don't need it. I can use the browser object with "invoke string"command to show the array in browser, but I need to get it as a file saved on my server. Do you know how I can do this?
B
4
S
2
Posts: 129
Reputation: 858

Post » Tue Jun 07, 2016 7:11 pm

[*]AJAX

  • Scores on a website - LINK
  • Scores on a website 2 - LINK
  • Highscore table - LINK
  • AJAX tutorial example - LINK
  • How do I pull variables out of a PHP page using AJAX ? - LINK
  • Ize's AJAX/PHP practical "Online Highscore" example - LINK
  • More about using PHP - LINK
  • Use GameJolt's API in C2 - LINK
  • Various questions and answers on using AJAX with server-side scripting to make an online game - LINK

But, if you attent to do things that a normal secured browser will not allow, i cant help you.
If its gonna be cross domain, then you gots look for that.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Wed Jun 08, 2016 1:30 pm

Anyway to save the json file on my server without using PHP? I just want to save data as name, scores, time left, levels, etc, directly from my game, to be loaded and analysed by a system.
B
4
S
2
Posts: 129
Reputation: 858

Post » Thu Jun 09, 2016 3:43 pm

Someone could explain to me how could I save the JSON file on my server?
B
4
S
2
Posts: 129
Reputation: 858

Post » Fri Jun 10, 2016 8:05 pm

Any good and wise soul to help me to figure out how to save a JSON file in my server?
B
4
S
2
Posts: 129
Reputation: 858

Post » Sun Aug 14, 2016 11:05 pm

Sorry to se that you havent received any help yet. But just to understand, how do you intent to pass your JSON data to your server if you are not willing to run a webserver script that would accept the incoming data )like a PHP code)??

You will have to POST the data to some sort of web script, which can read it and save it to the server right?


BTW how are you reading JSON? I need some help :)
Create your own Isometric Runner Game using C2:

Image

Check out my game "Last of the Survivors":
Play Store
App Store
B
58
S
13
G
2
Posts: 421
Reputation: 5,397


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, maranpis, oosyrag, Yahoo [Bot] and 31 guests