Saving a Game

For questions about using Classic.

Post » Mon Nov 02, 2009 2:34 pm

I was wondering how to create a method for saving a game...

...someone told me that I could have a directory w/ a .txt file that will hold all of my variables, so when it starts up the game gets the variables and loads everything. However, I have no idea how to do this, so if someone could run down some basic methods I'd be eternally grateful. :D


Thanks,
~Cetanu
B
3
G
3
Posts: 11
Reputation: 897

Post » Mon Nov 02, 2009 3:12 pm

Hmm I would also like to know how to do this just like those RPG game save screens. However, saving it in .text seems a bit too "hackable". SInce its basically a notepad, someone could just open it and change the values.
B
10
S
5
G
8
Posts: 203
Reputation: 4,395

Post » Mon Nov 02, 2009 3:42 pm

If you only need to remember simple things, like player stats and position, I'd simply use a hash table and save it as a random file. It's not that easy editable compared to having it in a txt or ini, where all the values are just out in the clear for everyone to see and edit as they please.

A very basic protection would also be what Minor describes in this thread: INI Protection with CRC32
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Mon Nov 02, 2009 4:17 pm

i thought ini's were viewable in a txt editor.

i'm not sure about the binary object

it has a little bit of a learning curve, but the 's' plugin let's you store any type of data, and saving it to an encrypted file is just one action.
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Tue Nov 03, 2009 7:52 pm

I took a look at that INI example and it broke it down for me, but still didn't tell me enough...

...how do I make Construct read/load the file? :?:
B
3
G
3
Posts: 11
Reputation: 897

Post » Wed Nov 04, 2009 9:22 am

There are built in save/load actions in the system object which take care of all the complexities for you.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Wed Nov 04, 2009 10:44 am

Okay, thanks! I actually just found them a while ago, and I said to myself, "Can it really be this easy?" :D
B
3
G
3
Posts: 11
Reputation: 897


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest