Help pls

Pages: 12
Hello, I'm new in this site. I need help for my Unity Game. So I finished my game but I want the game to Auto-Save and Auto-Load. And I'm a NOOB at C++, I know NOTHING, I created the game with a tutorial, just copy and paste, and I need you guys, if it doesn't matter you, to create a auto-save/auto-load script for me ^^

My game is a "cookie-clicker" based game: You click on a ball, and you buy upgrades with the "click number" and this upgrades are to auto-click or multiplier... etc

It has been 2 hours I'm searching on the web a script, I found nothing... Please help :'(
closed account (48T7M4Gy)
One of the best ways to end being a NOOB who knows NOTHING is to do a bit more than cut and paste other people's work.

So, as a suggestion, how in words do you think you might go about it?

First step might be to consider what parts of your game you are going to save and what is to be auto loaded.
Last edited on
I just saw tutorials, I wrote what he write, but I edited somethings.


I want to save all ^^
closed account (48T7M4Gy)
So how many lines of code in your unity game. Can you post it here?

And now we know you want to save all, what do you want to auto load. Would that be all too?
Yes, Auto load all, because it's a cookie clicker game, idk if u know ^^

So, I made 5 scripts, shall I put them in a .zip file and send you the link?
closed account (48T7M4Gy)
I don't need the zip file thanks. My point is for you to post a relevant sample of your code so your problem is less generic. It seems also your program is not written in C++ so you might be looking in the wrong place, maybe not.

Whatever the situation is, if you are primarily loading and saving data then use the following tutorial as a start.

For the 'auto' component of the saves maybe you need to investigate timers and interrupts.

http://www.cplusplus.com/doc/tutorial/files/
It's a C++ script, I saw your link and I understood no-thing :c
closed account (48T7M4Gy)
Ah well, never mind. Somebody might come along who can help you. All the best. :)
What language is your game written in ?
Unity sounds like .NET
closed account (48T7M4Gy)
https://unity3d.com/learn/tutorials. I suspect the OP is about this.
It looks like the Unity Game Engine use either JavaScript, C# or Boo. So maybe the OP might be better off at one of those forums, or indeed the Unity Forum?
In the Unity forum, no one wants to help me... :(

My game is written in c# (Is c++ = c#?)

My game is written in c# (Idk if C# IS C++ , if it's not, sorry for my mistake, my game is written in c#)
closed account (48T7M4Gy)
You haven't even confirmed one way or the other whether your game is a Unity3D game so the mystery continues.

However, be that as it may, C# is not the same as C++. Like Java there are strong similarities but that's as far as it goes.

You're pretty much left to the Unity forums etc as TIM suggested.

I just found this by googling which might help.

You need to surf around. :)

http://www.tallior.com/auto-save-in-unity/
http://forum.unity3d.com/threads/auto-save-auto-save-please.21743/
I will see your links my game is Unity2D, I putted a Canvas idk if you understand, I'm french xdd
Ok, so after pasted your auto-save script, it works. I have the auto saves scenes, but now, I've been searching how to auto-load these scenes when I start the game for 10 minutes and i don't know how I can auto-load the last saved scene and not all the scenes...
Oh? When I want to build the game in order to test the AutoSave, they said this: Assets/Scripts/Save.cs(4,7): error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing a using directive or an assembly reference?
Assets/Scripts/Save.cs(7,2): error CS0246: The type or namespace name `InitializeOnLoadAttribute' could not be found. Are you missing a using directive or an assembly reference?
Assets/Scripts/Save.cs(4,7): error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing a using directive or an assembly reference?


--> Error building Player because scripts had compiler errors

It's the same script than your link, what's the problem?
closed account (48T7M4Gy)
https://www.youtube.com/watch?v=zaCa8Tw8q4g
closed account (48T7M4Gy)
http://stackoverflow.com/questions/11854308/why-am-i-getting-error-cs0246-the-type-or-namespace-name-could-not-be-found
closed account (48T7M4Gy)
https://www.youtube.com/watch?v=w1td4vqt4Xg
Pages: 12