How to Load Json Data Into Arrays , Variables etc.. from Server PHP - AJAX - Construct3

4

Stats

2,588 visits, 3,449 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 1 Sep, 2020.

Hello All

If you want to load a Json file from server into arrays , variables or anything else in yor app or game check this out

All My tutorials here

construct.net/en/tutorials/construct-tutorials-2525

1) Upload the file json.php to your server

2) Upload the file array.json to your server

put all in the same folder

when you call the json.php , it has an include to other file array.json , so the ajax can read it as a normal json file and import it into the game

You can use the array json file in the project folder in C3 fill with the information you want , or you can dowload an array you already have save to pc and upload to server ,

There are many usages for this like load fases of your game , eg fase 1 load file xyz from server , fase 2 load file xyz etc

As you will see I put an Id to get the information from php file , so in the same file you can put as many Ids as you want and put the include inside it pointing to others files , just make an ajax call with this especific Id for each one

Enjoy

Download Files here

dropbox.com/s/myfnipo42ruqbiw/array.zip

  • 7 Comments

  • Order by
Want to leave a comment? Login or Register an account!