Help pls

Pages: 12
Jun 19, 2016 at 2:33pm
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 :'(
Jun 19, 2016 at 2:52pm
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 Jun 19, 2016 at 2:52pm
Jun 19, 2016 at 7:39pm
I just saw tutorials, I wrote what he write, but I edited somethings.


I want to save all ^^
Jun 19, 2016 at 7:49pm
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?
Jun 20, 2016 at 10:27am
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?
Jun 20, 2016 at 10:48am
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/
Jun 20, 2016 at 2:31pm
It's a C++ script, I saw your link and I understood no-thing :c
Jun 20, 2016 at 2:54pm
closed account (48T7M4Gy)
Ah well, never mind. Somebody might come along who can help you. All the best. :)
Jun 20, 2016 at 3:04pm
What language is your game written in ?
Unity sounds like .NET
Jun 20, 2016 at 3:31pm
closed account (48T7M4Gy)
https://unity3d.com/learn/tutorials. I suspect the OP is about this.
Jun 20, 2016 at 3:36pm
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?
Jun 21, 2016 at 10:14am
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#)
Jun 21, 2016 at 10:28am
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/
Jun 21, 2016 at 11:53am
I will see your links my game is Unity2D, I putted a Canvas idk if you understand, I'm french xdd
Jun 21, 2016 at 12:01pm
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...
Jun 21, 2016 at 12:07pm
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?
Jun 21, 2016 at 12:08pm
closed account (48T7M4Gy)
https://www.youtube.com/watch?v=zaCa8Tw8q4g
Jun 21, 2016 at 12:14pm
closed account (48T7M4Gy)
http://stackoverflow.com/questions/11854308/why-am-i-getting-error-cs0246-the-type-or-namespace-name-could-not-be-found
Jun 21, 2016 at 12:17pm
closed account (48T7M4Gy)
https://www.youtube.com/watch?v=w1td4vqt4Xg
Jun 21, 2016 at 1:54pm
Pages: 12