Save scores in an external file

Get help using Construct 2

Post » Tue Mar 10, 2015 10:40 am

Hello there !

I need a little help. I am currently creating a HTML5 game. For many reasons i need to keep some informations such as Name of the player, his score and so one. Is there a way to export those informations as a Json file ?
I need to keep this file on the server. I tried with the "download" function but it creates a DL link... I need the game to automatically select the folder and save...
How do i export these informations as a Json file with Construct 2 ?

Please help :D and thanks a lot !!
B
3
Posts: 2
Reputation: 179

Post » Tue Mar 10, 2015 11:03 am

If you need to keep the information on a server you then need the AJAX plugin to call a saving script on your server (that script is out of the scope of C2 and totally dependent on your server, coding language, etc...)

Simply pass the name, score, etc... through the AJAX call.

Be sure to look at the how do I FAQ to find out some examples of AJAX calls to a server, passing informations in the process.

Finally, if you want to get the infos as JSON, you likely want to first put them into an array and only pass the array.asJSON expression for that array.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
296
S
119
G
96
Posts: 7,332
Reputation: 71,306


Return to How do I....?

Who is online

Users browsing this forum: Klarner, Lancifer and 17 guests