Options when I load a file JSON from "Files" folder

Get help using Construct 2

Post » Sat Aug 26, 2017 5:00 pm

Hello, please I have some JSON files in the "Files" folder of my game.
I need to load them into a tilemap object.
What are my options?.

Is AJAX the only option?
I do not like AJAX because you must first "Request" and then check when it ends.
So these are two actions.
However, using NWJS you just have to do NWJS.ReadFile and you already have the file loaded in a single action.
The problem is that I do not know how to refer to the "Files" directory to use NWJS.ReadFile and to be able to read a file from the "Files" directory using NWJS.

My game will be distributed using NWJS for PC.

----------------------------

Another question is:
How do I move files from the "Files" folder to user's folder on his pc?
This can be done with NWJS using the "Move file" action but... how do I reference the "Files" directory ?.

What I want is that when the player installs my game, those files are moved to a directory on the user's PC.
B
30
S
13
G
21
Posts: 838
Reputation: 14,656

Post » Sun Aug 27, 2017 7:22 pm

Please.
When the user installs my game, how do I find out the path of the folder where the user has installed the game ?.

Ok, the installation path of the game is obtained with the variable "appfolder" of the plugin NW.js
B
30
S
13
G
21
Posts: 838
Reputation: 14,656


Return to How do I....?

Who is online

Users browsing this forum: Congrats2u and 22 guests