In-Game File Deleting

Non-platform specific questions.

In-Game File Deleting

Postby BlenderFreak » Fri Oct 01, 2010 9:39 pm

Can someone please send me a script that will allow me to delete a file called "data.sav" from the game itself? I can obviously go in and manually delete the save file, but I'd like to set the game up so that when the "NewGame" tab is clicked on in the main menu, a data.sav will be deleted and the game will start from the beginning.
Data.sav is created when your character reaches a checkpoint.

On a similar note, I used Bee-ant's checkpoint tutorial ( http://game-editor.com/forum/viewtopic.php?f=4&t=8744 ) to create the method of saving, but if someone could give me a brief tutorial on how to save the score for the game, that would be pretty awesome, too! Let me know if you can provide an answer! Thanks a million!

-BlenderFreak

P.S. Sorry about all the questions - trying to teach myself GE as fast as possible so I can get started on a *real* project instead of a cheap-graphic deal. XP
There's not much there yet, but you can find information on my current projects here.

https://sites.google.com/site/darkst3am/
User avatar
BlenderFreak
 
Posts: 55
Joined: Sun Sep 26, 2010 5:46 am
Location: His Computer
Score: 2 Give a positive score

Re: In-Game File Deleting

Postby DilloDude » Sat Oct 02, 2010 12:14 am

In GE, there is no way (as far as I'm aware) to actually delete an external file. You can, however, completely clear its contents or reset its data when you want to start a new game.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Re: In-Game File Deleting

Postby BlenderFreak » Sat Oct 02, 2010 3:09 am

Ah alright - that's basically what I was wanting. How do you do that, exactly?
There's not much there yet, but you can find information on my current projects here.

https://sites.google.com/site/darkst3am/
User avatar
BlenderFreak
 
Posts: 55
Joined: Sun Sep 26, 2010 5:46 am
Location: His Computer
Score: 2 Give a positive score

Re: In-Game File Deleting

Postby Rux » Sun Oct 03, 2010 10:21 pm

What you do is you is you set all your variables to 0, and all your strings set to "", EXAMPLE
Code: Select all
variable1 = 0;
strcpy(string1, "");
//rest of your variables


Then you use save vars and save all the save groups to data.sav. There you go.

EXAMPLE
Code: Select all
variable1 = 0;
strcpy(string1, "");
//rest of your variables
saveVars("data.sav", "INSERTSAVEGROUPHERE");
I'm not good at coming up with signatures...
User avatar
Rux
 
Posts: 645
Joined: Sun Apr 29, 2007 9:26 pm
Location: Sitting on your moniter invisable.
Score: 35 Give a positive score

Re: In-Game File Deleting

Postby BlenderFreak » Sun Oct 03, 2010 11:07 pm

Thanks! That should work! :D
There's not much there yet, but you can find information on my current projects here.

https://sites.google.com/site/darkst3am/
User avatar
BlenderFreak
 
Posts: 55
Joined: Sun Sep 26, 2010 5:46 am
Location: His Computer
Score: 2 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest