Simple INI Example

Post your own tutorials, guides and demos.

Post » Sun Jul 17, 2011 6:16 pm

This .cap is an example of the INI object, it first loads the INI file at the start of the layout. Then you can move the box around using the arrow keys. If you wish to save the position of the box press 'S', to load the position of the box press 'L'. It saves to the group "Sprites" and the Items BlockX and BlockY, which store the X and Y values of the "Box".

Download here: http://mrkdgaming.com/initest.cap
B
4
G
1
Posts: 50
Reputation: 652

Post » Mon Jul 18, 2011 12:45 am

Thank you for your share.

I wonder what is the difference between this system(saving stated values to ini file, than loading stated values to game) and construct's own system save / system load option. As I see if I choose to save and load with c1's save load system. Again I see same result. When I press save button it saves something to ini file. When I press to load button, it automatically loads that values.

Plus if you save as txt file, than it saves with weird code style so no one can decode it and change some values (change max health from 200 to 3000) So you got encoded file, you don't have to state all values one to one, you don't have to load all values one to one, you don't need to prepare your own encode system to protect your game from cheats.

Please don't get me wrong, I really have no clue with both these systems cause I never tried them yet. I never had a enough game to think about its save/load system yet :). I'm just asking to learn. Cause I hope I'll need it later. :)

Thank you.
B
7
S
1
G
1
Posts: 76
Reputation: 904

Post » Mon Jul 18, 2011 1:42 am

Construct's own save and load system saves the whole layout, with the INI object you can save certain values. You can also protect your game by hashing it with the CRC32 object. Also C1's own S/L system seems to be a bit buggy.
B
4
G
1
Posts: 50
Reputation: 652

Post » Mon Jul 18, 2011 8:25 am

Thank you. I didn't know them. Can you send us a example ini file hashed with crc32, save/load system please, but of course if you have spare time.

Thank you.
B
7
S
1
G
1
Posts: 76
Reputation: 904


Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 0 guests