The Daily Click ::. Forums ::. Klik Coding Help ::. How do you have an option to save your game?
 

Post Reply  Post Oekaki 
 

Posted By Message

Patrix



Registered
  21/02/2008
Points
  13
27th November, 2015 at 27/11/2015 21:53:23 -

I want to make it so you can save your game and then load it later in a game I'm making. How do you go about setting that kind of thing up?

 
n/a

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
28th November, 2015 at 28/11/2015 00:15:39 -

You want to use the ini object.
You use one event to set it up.

Start of frame: Ini
Set current file = Appdir$+"save.txt"

Then you write values into items, or retrieve values from items.
An item is an alias for ini data. example,
player_score = 320

 
n/a

hapsi



Registered
  13/11/2003
Points
  775
4th December, 2015 at 04/12/2015 11:51:18 -

I would bring forward that saving all the values of all the objects is a lot of work and I don't know if there is an extension to this.. I'd recommend savepoints or save per level with ini.

The save file can be .save .ini .txt what ever you want, and it can be encrypted with some extension i don't remember now.

Edited by hapsi

 
[Signature][/Signature]

AmyS3

Walking Insanity

Registered
  06/12/2015 19:00:07
Points
  212

VIP MemberStarBox PurpleBox OrangeBox GreenBox YellowBox RedBox Blue
7th December, 2015 at 07/12/2015 22:52:49 -

if you use arrays in your game you can store all objects relevant data like their position/id/health/coins/ect.., you can just save the whole array into a file or load a previously stored array from a file.

it is similar to a INI file but more flexible and faster.

just have a look at the array object in the event editor to check out how to use the save/load function

Edited by AmyS3

 
Image
...all typos belongz to me... ...yes all of em... ...oi handz off my typoz...
Image

Dr James 2



Registered
  17/02/2015 13:10:14
Points
  64
9th December, 2015 at 09/12/2015 15:56:30 -

I find it best to build game data around global values, that way you can just run a loop to save or load all the values. And during the save process have it also store object positions in the global value list.

If you choose to go down this route keep an Excel doc reference for your global values to prevent values 'overlapping'.

That's a simple way, anyways.

 
n/a

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
13th December, 2015 at 13/12/2015 02:47:29 -

for managing your global values you could also try using my "ArrayTool" program.

 
n/a

J.C



Registered
  22/03/2013 05:18:14
Points
  118
13th December, 2015 at 13/12/2015 03:23:12 -

Wouldn't the Save Game Object extension come in store here? Unless it's a faulty extension?

 
n/a

hapsi



Registered
  13/11/2003
Points
  775
18th December, 2015 at 18/12/2015 15:05:26 -

Array tool(s) work in some types of apps if your game is array based. This isn't always the case.

@J.C
I remember Save Game extension way back.. i tested it, but as far as i can remember it took pretty much as much effort as the INI -object, and it didn't have an option to save all the nescessary values.

Clickteam should have included saving/quick saving years ago, same thing with the damn 32-directions, scaling etc. There still are some really dumb lacks of functions from knp to CF2.5.

 
[Signature][/Signature]

J.C



Registered
  22/03/2013 05:18:14
Points
  118
26th December, 2015 at 26/12/2015 19:52:07 -


Originally Posted by Patrix
I want to make it so you can save your game and then load it later in a game I'm making. How do you go about setting that kind of thing up?



Maybe this tutorial from the clickteam website could help you? http://www.clickteam.com/tutorials Look under: Advanced

I hope it helps

 
n/a
   

Post Reply



 



Advertisement

Worth A Click