How do I include an array directly to my game ?

Get help using Construct 2

Post » Wed Feb 01, 2017 8:26 pm

hi , I want to know if it is possible and if yes how I can include an array directly in my game without write im in the start of layout , I have try to download it and load it when I start the game but that don't work so if you can heal me I will be enjoy ^^
B
3
Posts: 5
Reputation: 183

Post » Wed Feb 01, 2017 9:59 pm

You can download or save an array as JSON (basically represent your entire array as a single string), and then load hat later.

Otherwise, if you are using a spreadsheet program to compose your data you can save to a format like .csv, include it as a project file, and parse it into an array with AJAX and the tokenat expression.
Mistakes were made.
B
52
S
26
G
111
Posts: 1,630
Reputation: 62,681

Post » Thu Feb 02, 2017 4:27 pm

I have try to download , change the array , load him and download another time but the second dowload don't give me the modified array , just a blank array .

I create this :

on button1 clicked : dowload "array.json"
on button2 clicked : load "array.json"

So I clicked first on button1 , then change the array and clicked button2 and button 1 after .
B
3
Posts: 5
Reputation: 183

Post » Thu Feb 02, 2017 8:39 pm

Where are you loading from? AJAX?

How are you changing the array? Are you sure that the array is not blank via the debugger before hitting download the second time?

If you can provide a capx example of what you have done, it would be much easier to help you with your problem.
Mistakes were made.
B
52
S
26
G
111
Posts: 1,630
Reputation: 62,681

Post » Fri Feb 03, 2017 5:51 am

Are you using FileChooser and AJAX?
Image
Should work.
B
17
S
6
G
1
Posts: 41
Reputation: 1,725

Post » Sun Feb 05, 2017 4:35 pm

Thx I have find how to solve my probleme with ajax and request file
B
3
Posts: 5
Reputation: 183


Return to How do I....?

Who is online

Users browsing this forum: JackTYGA, PROxMTswatTR and 22 guests