-
Save Point
I need to set up a save point in my game. I was wondering if anyone knew any good tutorials on how to do this. I watched one on youtube, about using Ini file, and a couple other objects. It looks like it would work, but I'm not sure if that method would work when the game is put into an installer, and sent to another computer. It may very well be, but I don't want to event something that I'm unsure about...any suggestions?
-
You should use the INI object, yes, and preferably have the INI file saved in the application data directory. It should work on multiple computers that way.
Give it a go and come back if there are issues.
-
"application data directory" How would I got about doing that. See I have my files in my folder on my desktop. All the files I have releated to the game are in the same folder, as well as the save file for my project in mmf2...I have no idea what mmf2 actually does when it creates an installer, lol.
does it take everyhing from the directory the mmf2 save file is in, plus sub directories? I'm a bit in the dark on that side of things...
-
I'm not sure if I'm on the right path with this save business. I'll let you know what I've got set up..
Ini object
file object
The events are as below..
start of frame
name of file to test Appdrive$+Appdir$+"Fizbit.Save" under ini > set current file to Appdrive$+Appdir$+"FizbitSave"
start of frame
name of file to test Appdrive$+Appdir$+"Fizbit.Save" under file > create the file Appdrive$+Appdir$+"FizbitSave" under ini > set current file to Appdrive$+Appdir$+"FizbitSave"
player is overlaping object and presses enter under ini > set value Player_Level to item "Level" in group "FizbitsLevel" (i did this for every global value I wanted saved in the file.
when I run the frame the only thing that I can tell is happening my save animation plays, and sound effect plays. When I look in my project folder I can't find any created file called FizbitSave, so I don't think it's being created....I'm not really sure what to do. I've searched the computer, it doesn't seem to be created anywhere else..
I'm not sure what's on the go, lol.
any ideas whats wrong?
-
-
Whats that form for? I need a bit more information.
*edit* never mind, I explored a bit, the files uploading, thanks :)
-
Hey, the file was 14mb, and you can only do a 10mb upload so I uploaded it to media fire. Hope that's alright.
http://www.mediafire.com/?dls80bgsjyg92oa
Thanks again...I built, and made an installer, and tested the app...no save file gets created in the game folder anywhere, so I'm definitly did something wrong..
-
Hey I actually figured some of this out on my own. I managed to find some information. I wasn't setting the fiile to appdrive appdir...it's finally creating the file, and storing the information, but I've run into a new problem. I think it's only creating the file once...when I save again it doesn't seem to be overwriting the file, so the player can only really save once...how do I tell the game to overwrite the existing Ini to create the new save file?
-
I'm still having trouble with this, I don't know what's going on now, lol....okay my save point works, and saves the data, and I figured out deleting the file to create the new save file, but on my main menu, I'm having a bit of trouble with loading...
on the main menu I have a load button, and the ini object...how do I set the ini to the created file? what does set file do? does that set the ini to the created file, or does that create a new file?
-
Look at my mfa. That's literally all you should do. No File object is necessary.
It's all handled with the INI object. It won't make a file in the game directory because that is bad practice - instead it goes to the AppData directory.
Seriously, you're over complicating this :)
-
I don't have a dir app data...but I've got a lot of this figured out...I can save to an ini...but for some reason the ini deletes itself, whichc is no good, lol...
I get confused when you say appdata directory, I don't have that dir in my project folder, lol... I don't know what your project folder looks like, but I'll sum up mine...lol...I have a folder in my main desktop folder with the name of my game...in it I have dirs that I created, and in them the files I use...in the root folder the folder with my game name I have my MFA project save file....that's where I've been telling the ini to create itself in the root folder.. appdrive appdir...it's been working, but for some reason my ini file deletes itself...I gotta figure out what's triggering that, because as far as I can tell, lol...there's no reason for it...I don't have any file object telling delete a file, or anything like that, lol...
however I can save, the ini is created....Then I can load game....but after so long the ini deletes itself...I'm trying to pinpoint what's triggering that, but I'm having a hard time, lol
-
I found the culprit I had a delete file on an event that it shouldnt have been. I had to run my app, and try a bunch of things, while checking my dir to see what even deleted the file. lol
still, I'm a bit foggy when you say appdata dir...what's that? I don't even have that dir in my project folder, becuase my project folder is explained above...I didn't get a set of project folders when I created a new project, I had to make my own in one of my folders on desktop...
how did you get an appdata dir?
-
AppData is a folder each and every user of the computer has by default. It's a hidden folder. It is NOT part of your project folder. Saving to the project folder is BAD PRACTICE. ;)
My mfa saves to AppData as you can see in the INI properties. It doesn't delete after the application is over, and it doesn't need to be recreated.
-
ohh okay, that makes more sense now. I was pretty confused, Guess I never heard of that folder before..lol.