x


How to script a Save/Load game option

I would like to be able to save and load a players progress to a players hard disk.

as an example if i have a player that collects 3 gems then a door will open automatically when the 3rd gem is collected. so id like to be able to save the location of the player (in the world or at a save location spot) as well as save the information that the crystals have been collected (i assume each crystal would have a unique name such as crystal_A crystal_B etc...so that when the player loads the game all the crystals won't be loaded again just the ones that have not been collected. )

I would like this system to work as a stand alone game (not a web browser run game) is it possible? does anyone know how?

OH and the reason for the hard disk save is so that if the player has to wipe the pc clean the player should be able to fine the directory where the file is saved and back up his save game. (this has saved me from loosing all my hard work on games i've played in the past when antivirus failed to protect my pc)

more ▼

asked Dec 01 '09 at 04:37 AM

reboot2009 gravatar image

reboot2009
456 3 3 6

(comments are locked)
10|3000 characters needed characters left

16 answers: sort voted first

This post has an excellent solution for those of you that would rather use JavaScript:

http://forum.unity3d.com/threads/94997-Need-Help-Save-Load

I explain the entire process all the way down to modifying individual variables such as incrementing the "levelsCompleted" by 1 and more!

more ▼

answered Aug 02 '11 at 01:55 PM

kingdutka gravatar image

kingdutka
61 6 7 8

(comments are locked)
10|3000 characters needed characters left

i have a question for The Stone.

can you help me? i want to store the points in this script i use now : http://unifycommunity.com/wiki/index.php?title=Save_and_Load_from_XML

i tried everything plz help :(

btw i am 13 and my english sucks XD

more ▼

answered Jun 29 '10 at 03:50 PM

crasyboy42 gravatar image

crasyboy42
229 21 21 23

MAY 13 YEAR OLDS LIVE FOREVER!!!!!lol sorry about that...

Mar 22 '11 at 09:54 PM Kurt P

@crasyboy42 Please do not post questions or comments as answers. This is not a forum.

@Kurt P We can only live in your specified state for a maximum of one 365-day Earth-year plus one Earth-day, in the event of a leap-year. Or in my case, at the time of posting, 30 days and 20 minutes.

Nov 02 '11 at 06:40 AM Keavon
(comments are locked)
10|3000 characters needed characters left

Is there any clear explanation showing how to rework this for serializing HashTables or Arrays?

more ▼

answered Jun 03 '12 at 08:06 PM

johndevor gravatar image

johndevor
0

(comments are locked)
10|3000 characters needed characters left

I gonna probably dig up this topic but I've got a question.

I want do the same thing with my iPhone program to save data but when I do that, I got this on Execution :

EXC_BAD_ACCESS in the function :

public sealed class VersionDeserializationBinder : SerializationBinder

If someone got an idea or want more details on this...

more ▼

answered Aug 20 '12 at 03:48 PM

liszto gravatar image

liszto
1.8k 15 26 38

(comments are locked)
10|3000 characters needed characters left

Oh, can anybody help me in a similar situation? I want my game to share saves between all the users in OS (I want allow all the users to see all the game profiles). Is there any way in Unity to get a folder where I could store save files in? (for example, in Windows this folder would be "Documents and SettingsAll UsersApplication Data" or in MacOS "/Users/Shared/")

more ▼

answered Dec 09 '11 at 09:07 PM

igorkro gravatar image

igorkro
1

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x455
x443
x190
x60

asked: Dec 01 '09 at 04:37 AM

Seen: 77753 times

Last Updated: Jan 25 at 02:38 AM