Main Menu
  • Welcome to The RPG Maker Resource Kit.

save delete VX Ace RESOLVED

Started by crow5derlock, May 11, 2012, 10:45:40 PM

0 Members and 2 Guests are viewing this topic.

crow5derlock

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?




Dir.glob("Save*").each do |f|
  File.delete(f)
end
  This works!
Final Statement: I chowder5lock am a dipshit and MA is a pretty cool dude.

D&P3

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.

File.delete(Save01)

Obviously modifying that to do something with the appropriate save file.
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3

crow5derlock

#2
Thank you

Edit: I get an error:
Final Statement: I chowder5lock am a dipshit and MA is a pretty cool dude.

Mushu

Omg haha, I'm going to make a door that deletes your save file every time you open it. ;8

D&P3

You better have a troll face after I open that door, otherwise I'll grow to hate your game really quickly ;8
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3

Mushu

I'm just kidding, I wouldn't actually do that. Thinking about it gave me a good laugh though..

crow5derlock

The call deosnt work, theres an error, it probably needs something
Final Statement: I chowder5lock am a dipshit and MA is a pretty cool dude.

D&P3

Quote from: crow5derlock on May 12, 2012, 05:19:38 PM
Thank you

Edit: I get an error:
Put it in quotation marks

File.delete("Save01")

See if that helps.
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3

Fall From Eden

Quote from: D&P3 on May 12, 2012, 03:17:15 PM
File.delete(Save01)

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. :)

crow5derlock

#9
Quote from: Fall From Eden on May 12, 2012, 05:49:31 PM
Quote from: D&P3 on May 12, 2012, 03:17:15 PM
File.delete(Save01)

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. :)


It seems to be looking for a file type
Final Statement: I chowder5lock am a dipshit and MA is a pretty cool dude.

Fall From Eden

Quote from: crow5derlock on May 12, 2012, 05:51:22 PM
It seems to be looking for a file type



Wonder what that could be. ;)

D&P3

the filename is .rvdata2

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

File.delete("Save01.rvdata2")
File.delete("Save01".rvdata2)

See if it works.

Quote from: Fall From Eden on May 12, 2012, 05:49:31 PM
EDIT: D&P3 beat me to it. :)
Edit: Role-reversal :)
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3

Fall From Eden

It would be inside the quotation marks.


File.delete("Save01.rvdata2")

crow5derlock

#13
Quote from: 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.

File.delete("Save01.rvdata2")
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:
Final Statement: I chowder5lock am a dipshit and MA is a pretty cool dude.

Fall From Eden

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?

crow5derlock

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Final Statement: I chowder5lock am a dipshit and MA is a pretty cool dude.

D&P3

Quote from: Fall From Eden on May 12, 2012, 06:00:00 PM
It would be inside the quotation marks.


File.delete("Save01.rvdata2")

Yeah I thought it was supposed to be inside the " " but I wasn't 100% sure :)
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3

Fall From Eden

#17
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?

crow5derlock

in the script call: i just repeated the line with different file names.

then i tried this;

if File ("Save01.rvdata2")
File.delete ("Save01.rvdata2")
end
Final Statement: I chowder5lock am a dipshit and MA is a pretty cool dude.

D&P3

crow5derlock - I think you have common sense and should know how to use this without an explanation :)

if File::exists?("FILENAME")
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3

Fall From Eden

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.


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?

crow5derlock

im just trying to make a cheat proof game
Final Statement: I chowder5lock am a dipshit and MA is a pretty cool dude.

Fall From Eden

Quote from: crow5derlock on May 12, 2012, 06:22:41 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.

crow5derlock

at least they'll think twice before going to certain places after that
Final Statement: I chowder5lock am a dipshit and MA is a pretty cool dude.

D&P3

Quote from: crow5derlock on May 12, 2012, 06:22:41 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.
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3