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 !!
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 !
Posts: 7,416
Reputation: 75,228

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests