Numerical data - store and retrieve

Get help using Construct 2

Post » Mon Oct 08, 2012 10:04 am

I'm looking for the best way to store and retrieve huge amounts of numerical data.

The project I'm working on right now requires some kind of data-base-esque storing possibility, but when it comes to data-bases I'm a complete Noob.
At the moment it's only meant for data I provide, but in the future I want it to also be able to store user-generated data.

In effect it will be just one long string of numbers which are meant as x or y-coordinates. In the project I've already seperated the x from the y to make it easier to adjust.

I've read about hash-tables, arrays, Json (if that's what it's called) and tried the csv-plugin (before I found out it wasn't meant for numerical data). I'm just not sure which road to travel.

Right now I'm using seperate event-sheets for every string of data, but there has to be a better way.

If anyone could point me in the right direction I'll be very grateful. I'm not scared of learning, but sometimes I get a bit overwhelmed by the possibilities of C2 and can't figure out which road will get me to my destination.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
53
S
16
G
8
Posts: 6,157
Reputation: 19,744

Post » Tue Oct 09, 2012 10:15 am

24 hour-bump
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
53
S
16
G
8
Posts: 6,157
Reputation: 19,744

Post » Tue Oct 09, 2012 5:43 pm

There is no best way, all the options you cited can be used (even the csv plugin).

For initial data, like your data strings I would opt for using external file, added to the files folder of your project, and loaded with the csv plugin into an array which works good as a list.
Then after changing the array you could save the Array.AsJSON to the webstorage object, and just make the game load from the webstorage if it exists otherwise load from the csv file.

If you want the database to be accessible by more than one computer then you would need a way to modify a file in dropbox or something, but that's beyond the scope of C2 and you would need to use a php script or something.
B
79
S
24
G
54
Posts: 4,747
Reputation: 40,757

Post » Tue Oct 09, 2012 7:16 pm

thanks rojo, I'll give it a try..

I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
53
S
16
G
8
Posts: 6,157
Reputation: 19,744


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 25 guests