auto save

Get help using Construct 2

Post » Sun Oct 06, 2013 8:16 pm

any idea how can i do autosave with webstorage? My ganme should behave like a standard iOS game and save should be propably done after unlocking level. But im not sure about the loading?

Thanks,
B
8
S
4
G
1
Posts: 191
Reputation: 1,873

Post » Sun Oct 06, 2013 9:48 pm

Why are you using webstorage? Why not try the save and load commands in system?
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
51
S
24
G
30
Posts: 534
Reputation: 19,620

Post » Mon Oct 07, 2013 11:41 am

Ladestitute after what i red about webstorage, im not sure what to do now. Thing is, im a graphic designer and these things are far beyond my capabitlities so i need a step by step approach. Im happy that with construct i created my game mechanics but to treat databases, thats for now too much altough im learning every day something new
B
8
S
4
G
1
Posts: 191
Reputation: 1,873

Post » Mon Oct 07, 2013 11:53 am

Maybe a strange question, but ..

Why does the Scirra site have a tutorial section?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Oct 07, 2013 12:15 pm

LittleStain, i know that tutorial very well and your sarcasm isnt apropriate as i had to search far more than this = i have to deal with unlocking levels, arrays and stuff that for me as a graphic artist is quite hard to swallow at once for a program that claims "you dont have to program anything". I have to search for similiar capxs try and fail, try and fail and then eventualy something functional will come from this.
B
8
S
4
G
1
Posts: 191
Reputation: 1,873

Post » Mon Oct 07, 2013 12:24 pm

I thought the tutorial was very clear on how to set the local keys and to retrieve them. These are the basics of the webstorage.

Probably I don't understand your question correctly.
What is it that needs to be saved?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Oct 07, 2013 12:37 pm

BTW, I'm a graphic designer myself and untill a year ago hadn't tried any programming for it was way out of my comfort zone.

I think the visual approach to programming (it's still programming) that Construct 2 utilizes is far simpler to understand than anything I've seen before. It still takes a lot of trial and error if you need specific things to happen, but a lot of the basics are covered by the program itself. The many behaviours and plugins available make it so you don't have to invent the wheel constantly and have a visual result very quickly. As a graphic designer I know it takes a lot of time to make things look as if they are very easy, but C2 helps me a lot in getting where I'd like to go.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Oct 07, 2013 1:00 pm

Yes i agree with you, Construct is a powerful tool i wouldnt have invested my money and time in it if i didn't believed in its abilities. I learned so much in the last days. Thing is, you still have to invest a huge ammount of time to learn new things. Which is perfectly fine but the ammount of the things gets revealed in the process. I wouldnt have guesed that i need quite an ammount of advanced knowledge. Right now i have my knowledge limits somewhere around the expressions level. Certain things/lines i understand only halfly.

For the part im solving now: I have levels/level sprites which have locked/unlocked/1-3 stars statuses {frames} and the array. I propably have to save the level when you click "next" level {the next one gets unlocked}. So far i didnt had the unlock variable which is propably very needed if you have to save the levels. :) I know the tutorials which cover this issue however there are still things that i have to custom make to fit my structure. This evening i will hopefuly make some progress.
B
8
S
4
G
1
Posts: 191
Reputation: 1,873

Post » Mon Oct 07, 2013 1:10 pm

I must say I'm very bad at arrays, so big ups for figuring them out. Saving the variables shouldn't be a problem. Retrieving them with int(WebStorage.LocalValue("unlocked")) should be do-able too. How to rearrange the array according to the variables I have no clue, but it should be possible.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Oct 07, 2013 1:48 pm

If you decide to use LoadState/SaveState instead it all becomes real easy. Just add this Action in a running event sheet:

(System) - Save game to slot "autosave"

If there's no autosave slot yet, C2 will create one, otherwise it'll overwrite the old "autosave" with the new. Then use (System) - Load game from slot "autosave" to load it. The autosave Action could be placed inside an On Start of Layout condition for instance.

And to avoid your savegames getting bloated with unnecessary information, add a "NoSave" behaviour to objects that don't need saving (i.e. stuff that gets reloaded/reset on level changes).
B
39
S
16
G
6
Posts: 543
Reputation: 7,619

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 47 guests