Webstorage (Save Game)

Show us your completed creations made in Construct 2

Post » Tue Dec 13, 2011 1:14 am

Also hashing saved game data would make it irretrievable, hashes are one way.
Image Image
Scirra Founder
B
124
S
37
G
25
Posts: 3,945
Reputation: 44,887

Post » Mon May 14, 2012 9:04 pm

Thanks!
B
19
S
6
G
4
Posts: 7
Reputation: 4,221

Post » Wed May 16, 2012 10:20 am

Nice topic for a tutorial!

if you don't have the time or motivation to make a tutorial, please let me know, I'll do it. I think lots of others will be helped with a tut about this topic.

MADMark4Media2012-05-16 10:21:00
B
19
S
6
G
3
Posts: 33
Reputation: 2,712

Post » Mon Jun 04, 2012 11:51 am

@tonycrew this will be working on game made for mobile phones /tablets?
B
93
S
19
G
34
Posts: 1,840
Reputation: 27,963

Post » Thu Jun 07, 2012 12:08 pm

@delgado
(Tested only on Android 2.3+)
Phonegap works perfectly with webstorage.
Appmobi has some conceptual flaws that make it difficult to implement. Basically c2 assets are zipped during appmobi build and then unzipped on first execution inside the app data folder.
This leads to two problems:
1) Your app size is bloated (container + zipped assets + unzipped assets + cache)
2) Application updates pushed via appmobi update system destroy saved data.
I said "pushed via appmobi update system" because currently it's not possible to update a C2 application bundled with appmobi even using the new version number feature and, frankly, looking at the source of their containers I doubt will ever be.Knifegrinder2012-06-07 12:09:16
B
11
S
3
Posts: 224
Reputation: 2,028

Post » Sat Jun 16, 2012 7:26 am

I know it will save your data, but HOW? What were the expressions like 'Save "Wfile" from Wood' or something like that? An did that have to do with instance variables?
B
2
Posts: 1
Reputation: 377

Post » Mon Jul 09, 2012 5:39 pm

[QUOTE=GameCreator] I know it will save your data, but HOW? What were the expressions like 'Save "Wfile" from Wood' or something like that? An did that have to do with instance variables?
[/QUOTE]

It just storage some variables where you can read from webstorage, so, when you load the file, it will load that variables and show the game after that statement, but you'll need to make your game all following this philosophy.

Example: I'm doing a RPG, where the player get lvl 3 and 3200XP, also a sword with ID number of 3, he is on the map 3, unlocked map 2 and 1 and a shortcut number 13.

Webstorage it and restore it, all the thing on the game will check their variables, consolidating only the checked variables, so, your player will come up, after loading, with the maps 1, 2, 3 and the shortcut 13 opened, also, a sword number 3, 3200XP, and level 3, hes last position can be done making a new variable, telling the game the player position map, so on.

This is an awesome way of making RPGs and simpler games.            
ImageImageImageImageImageImage
B
92
S
19
G
12
Posts: 1,192
Reputation: 18,276

Post » Mon Dec 24, 2012 3:32 pm

Hello I'm new here and do not know English very well!
well, I did the tutorial and was very good (very good), but when I click load of NaN in place of total coins, how can I solve this?
Thank you!
Ps.: Brazilian;-)
Mirdov Indie Games
B
41
S
10
G
2
Posts: 43
Reputation: 5,728

Post » Mon Jan 21, 2013 8:24 am

Is this part of C2 ? can we use this method for commercial games?
B
9
S
3
Posts: 148
Reputation: 1,738

Post » Mon Mar 18, 2013 9:32 am

I have a doubt with this.

Im making a RPG game with larges arrays to Player info, Inventory, Objects info, etc. If I need save all the whole information with WebStorage, I need save data by data on separated keys?

Im download the .Capx example and I modify that to use arrays:

Example with array

If that works on this way, is a really boring and hard work.
Is some other way to save this type of data?
B
18
S
5
G
3
Posts: 158
Reputation: 4,813

PreviousNext

Return to Completed Creations

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest