The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX Ace => Topic started by: crow5derlock on May 11, 2012, 10:45:40 PM

Title: save delete VX Ace RESOLVED
Post by: crow5derlock on May 11, 2012, 10:45:40 PM
i need either a small script or an eventing process to delete a save file when hackers are cheating.

Basically it's for those little unreachable places we put into the game to see if people are willing to hack to get to it, i need something to delete the save file for after the event has gone through.

If it ends up a small script, could you please use the script call, thx.

(And Yes i did just get ace)

Edit: am i missing required information?




Code: [Select]
Dir.glob("Save*").each do |f|
  File.delete(f)
end
  This works!
Title: Re: save delete VX Ace
Post by: D&P3 on May 12, 2012, 03:17:15 PM
Well I haven't used VXA all that much, but I remember that they had regions set into them and that you can use a parallel process over an entire region.

Basically set your outbound region to something like 6 or 7 ::)
Then use a common event to check if the player is on one of those regions with the event using a script call then returning them to the title screen.

I'm not testing this on my own games.
But this script call is supposed to work.

Code: [Select]
File.delete(Save01)

Obviously modifying that to do something with the appropriate save file.
Title: Re: save delete VX Ace
Post by: crow5derlock on May 12, 2012, 05:19:38 PM
Thank you

Edit: I get an error: (https://sphotos.xx.fbcdn.net/hphotos-ash3/577011_2789616078648_1805738848_1662228_1888982846_n.jpg)
Title: Re: save delete VX Ace
Post by: Mushu on May 12, 2012, 05:21:23 PM
Omg haha, I'm going to make a door that deletes your save file every time you open it. ;8
Title: Re: save delete VX Ace
Post by: D&P3 on May 12, 2012, 05:28:33 PM
You better have a troll face after I open that door, otherwise I'll grow to hate your game really quickly ;8
Title: Re: save delete VX Ace
Post by: Mushu on May 12, 2012, 05:32:15 PM
I'm just kidding, I wouldn't actually do that. Thinking about it gave me a good laugh though..
Title: Re: save delete VX Ace
Post by: crow5derlock on May 12, 2012, 05:45:01 PM
The call deosnt work, theres an error, it probably needs something
Title: Re: save delete VX Ace
Post by: D&P3 on May 12, 2012, 05:47:17 PM
Thank you

Edit: I get an error: (https://sphotos.xx.fbcdn.net/hphotos-ash3/577011_2789616078648_1805738848_1662228_1888982846_n.jpg)
Put it in quotation marks

Code: [Select]
File.delete("Save01")

See if that helps.
Title: Re: save delete VX Ace
Post by: Fall From Eden on May 12, 2012, 05:49:31 PM
Code: [Select]
File.delete(Save01)

Code: [Select]
File.delete("Save01")

That should be the problem. Save01 tries to access a defined constant while "Save01" sends the string to the delete method which should delete the save file from the project's root folder.

EDIT: D&P3 beat me to it. :)
Title: Re: save delete VX Ace
Post by: crow5derlock on May 12, 2012, 05:51:22 PM
Code: [Select]
File.delete(Save01)

Code: [Select]
File.delete("Save01")

That should be the problem. Save01 tries to access a defined constant while "Save01" sends the string to the delete method which should delete the save file from the project's root folder.

EDIT: D&P3 beat me to it. :)
(https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash3/578114_2789711961045_1805738848_1662321_1208590037_n.jpg)

It seems to be looking for a file type
Title: Re: save delete VX Ace
Post by: Fall From Eden on May 12, 2012, 05:55:23 PM
It seems to be looking for a file type

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FvJlcF.png&hash=12d0aa9b4ba6035f35cc72a09c8c8de3b81f40ab)

Wonder what that could be. ;)
Title: Re: save delete VX Ace
Post by: D&P3 on May 12, 2012, 05:57:58 PM
the filename is .rvdata2

I'm not sure if it is put inside or outside of the quotation marks.

Code: [Select]
File.delete("Save01.rvdata2")
Code: [Select]
File.delete("Save01".rvdata2)

See if it works.

EDIT: D&P3 beat me to it. :)
Edit: Role-reversal :)
Title: Re: save delete VX Ace
Post by: Fall From Eden on May 12, 2012, 06:00:00 PM
It would be inside the quotation marks.

Code: [Select]
File.delete("Save01.rvdata2")
Title: Re: save delete VX Ace
Post by: crow5derlock on May 12, 2012, 06:01:21 PM
the filename is .rvdata2

I'm not sure if it is put inside or outside of the quotation marks.

Code: [Select]
File.delete("Save01.rvdata2")
Code: [Select]
File.delete("Save01".rvdata2)

See if it works.

it works, but the call deletes all 4 save files and i get an error saying "Save02.rvdata2" not found, what would be the correct if then statement for the call

like if "Save02" is present then Delete it

if it helps this is the event: (https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-prn1/s720x720/564951_2789758682213_1805738848_1662338_1816450546_n.jpg)
Title: Re: save delete VX Ace
Post by: Fall From Eden on May 12, 2012, 06:04:46 PM
There is plenty of documentation on Ruby and RGSS3, and I do not see how it would hurt to look into it a little bit before asking us to do it for you. Conditional statements are essential in any case, and honestly, the delete method should not delete all of the save files; how are you calling it?
Title: Re: save delete VX Ace
Post by: crow5derlock on May 12, 2012, 06:06:48 PM
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Title: Re: save delete VX Ace
Post by: D&P3 on May 12, 2012, 06:09:26 PM
It would be inside the quotation marks.

Code: [Select]
File.delete("Save01.rvdata2")
Yeah I thought it was supposed to be inside the " " but I wasn't 100% sure :)
Title: Re: save delete VX Ace
Post by: Fall From Eden on May 12, 2012, 06:11:59 PM
Well, you're calling it to delete all of the save files. It makes sense that it's... deleting all of the save files.

How, exactly, are you trying to determine which save file (or files) to delete, anyway?
Title: Re: save delete VX Ace
Post by: crow5derlock on May 12, 2012, 06:14:51 PM
in the script call: i just repeated the line with different file names.

then i tried this;

Code: [Select]
if File ("Save01.rvdata2")
 File.delete ("Save01.rvdata2")
end
Title: Re: save delete VX Ace
Post by: D&P3 on May 12, 2012, 06:15:29 PM
crow5derlock - I think you have common sense and should know how to use this without an explanation :)

Code: [Select]
if File::exists?("FILENAME")
Title: Re: save delete VX Ace
Post by: Fall From Eden on May 12, 2012, 06:18:47 PM
Oh, I get it. You want it to delete all of the save files if the player has reached an area they aren't supposed to (meaning, we assume, that they cheated to get there). Well, that's not so hard. There's a better way to delete all of the save files, though.

Code: [Select]
Dir.glob("Save*").each do |f|
  File.delete(f)
end

EDIT: This kind of goes without saying, but you know that doing this can be incredibly dangerous to abuse, right?
Title: Re: save delete VX Ace
Post by: crow5derlock on May 12, 2012, 06:22:41 PM
im just trying to make a cheat proof game
Title: Re: save delete VX Ace
Post by: Fall From Eden on May 12, 2012, 06:26:14 PM
im just trying to make a cheat proof game

So what happens if they make copies of their save files outside of the directory structure of your game? Making something cheat-proof is pretty much impossible.
Title: Re: save delete VX Ace RESOLVED
Post by: crow5derlock on May 12, 2012, 06:28:33 PM
at least they'll think twice before going to certain places after that
Title: Re: save delete VX Ace
Post by: D&P3 on May 12, 2012, 06:30:37 PM
im just trying to make a cheat proof game
That's fine, but make sure you're not deleting anything important. Save files are ok because they are only accessed when you're loading or saving to them.

If you were to tell the compiler to delete your game file, it could become corrupted, and in a worse case scenario even infect your computer.

So just make sure that nothing in the middle of a process is being forcefully deleted and you should be ok.
Title: Re: save delete VX Ace RESOLVED
Post by: crow5derlock on May 12, 2012, 06:32:50 PM
I'll keep that in mind, thanks for all of your help
Title: Re: save delete VX Ace RESOLVED
Post by: Fall From Eden on May 12, 2012, 06:34:47 PM
Not a problem. Just... be careful. ;)