USing an SQLITE database in C2 ???

Just started using Construct 2? Post your questions here

Post » Thu Apr 03, 2014 8:53 pm

Hello,

I'm wondering if it is possible to use an SQLITE database with Construct 2?

I have a game idea and I would like the player to be able to save a custom image
as their character in the game.
B
3
Posts: 7
Reputation: 189

Post » Fri Apr 04, 2014 4:54 am

you might be able to achieve that with webstorage? you might not need something that fancy to achieve that specific goal.

I'm looking to better understand how to store data in the app like extensive text and such without using webstorage.

Also I know that in some past testing with my coworker, we were able to get C2 to talk to the Google App Engine to pass text data using the AJAX object.. so that might be what you would use to pass json data back and forth.
B
56
S
9
G
1
Posts: 938
Reputation: 6,458

Post » Fri Apr 04, 2014 8:50 am

I didn't find a solution yet, how to use SQLite with C2. I'm working with Webstorage instead now. But the handling as awful since you just can save strings.
B
14
S
3
G
1
Posts: 255
Reputation: 2,027

Post » Fri Apr 04, 2014 11:11 am

@balistreri1 @Vuuv
Construct2 makes client-side applications/game.

So you can use an online database to hold informations and get informations from it through AJAX calls.
It's just two different things and you have to handle the hosting and management of the database on your own, outside of C2 since it has nothing to see.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,317
Reputation: 87,483

Post » Fri Apr 04, 2014 1:05 pm

@Kyatric: Yes, this wouldnt be a problem. But what if I want to make a complex offline game?
B
14
S
3
G
1
Posts: 255
Reputation: 2,027

Post » Fri Apr 04, 2014 1:58 pm

@Vuuv: Same answer.
Unless you provide a locally hosted database with the binaries for your game. (Think XAMP or EasyPHP here)
It's probably not a good idea for your users.

Otherwise, for data structures use array, dictionary or XML and webstorage to save them if dynamically modified, otherwise you can provide project files to fill/feed them datas if those aren't expected/supposed to change.

You can also check out in the third-part plugins, one like Yann's JSON which can provide an easier way to navigate datas.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,317
Reputation: 87,483

Post » Fri Apr 04, 2014 2:07 pm

As I said I currently use webstorage to save all my data. I'm already working with JSON Objects and convert them to strings whenever I save them back to webstorage.
I tried to setup something like a database. Every key in the webstorage represents a table where I save my JSON string. Unfortunately I have to update the whole table whenever I change one variable in the string.
B
14
S
3
G
1
Posts: 255
Reputation: 2,027


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests