Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Modder Mode (Save Deletion After Quitting)  (Read 1131 times)

MachinaMandala

  • Bay Watcher
    • View Profile
Modder Mode (Save Deletion After Quitting)
« on: November 08, 2017, 12:31:58 pm »

I'm testing a mod I'm currently in the process of making and part of the problem I'm finding is that I have to manually go and delete saves after every change.

Would it be possible to have a modder mode where (on game quit) the game deletes all saves for you?
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: Modder Mode (Save Deletion After Quitting)
« Reply #1 on: November 08, 2017, 01:23:53 pm »

What are you actually trying to achieve?
You can kill DF from the OS so it won't save on exit, and if you turn off seasonal saves there won't be any saves other than those you have created, which shouldn't be too many (what's the point of saving the game if you don't intend to use the save anyway?).
It's probably possible to make a DFHack "quit without save" script.
Logged

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: Modder Mode (Save Deletion After Quitting)
« Reply #2 on: November 08, 2017, 03:17:24 pm »

It's probably possible to make a DFHack "quit without save" script.
"die"

You could even bind the command to a key, for example, by putting "keybinding add Alt-Q die" in dfhack's .init.
« Last Edit: November 08, 2017, 03:26:38 pm by Bumber »
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

deathpunch578

  • Bay Watcher
  • local satanist practices black magic in cornfields
    • View Profile
Re: Modder Mode (Save Deletion After Quitting)
« Reply #3 on: November 08, 2017, 03:21:45 pm »

It's probably possible to make a DFHack "quit without save" script.
"die"
in the latest version its "kill"
Logged
Someone hands you a basketful of Jeses.
Cheerful with a side of wink wink nudge nudge I bet this guy's spine would look great mounted on my wall.
You ever get so mad you fuck a donkey?

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: Modder Mode (Save Deletion After Quitting)
« Reply #4 on: November 08, 2017, 03:32:08 pm »

Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

MachinaMandala

  • Bay Watcher
    • View Profile
Re: Modder Mode (Save Deletion After Quitting)
« Reply #5 on: November 08, 2017, 04:04:46 pm »

What are you actually trying to achieve?
You can kill DF from the OS so it won't save on exit, and if you turn off seasonal saves there won't be any saves other than those you have created, which shouldn't be too many (what's the point of saving the game if you don't intend to use the save anyway?).
It's probably possible to make a DFHack "quit without save" script.

It's still necessary to clean up the world save.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: Modder Mode (Save Deletion After Quitting)
« Reply #6 on: November 08, 2017, 04:37:51 pm »

It's probably possible to make a DFHack "quit without save" script.
"die"
in the latest version its "kill"
I don't see anything about that in the docs: https://github.com/DFHack/dfhack/blob/master/docs/Core.rst
Right, it has never been "kill". There is a command (outside of DFHack) on some platforms named "kill", though.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

PatrikLundell

  • Bay Watcher
    • View Profile
Re: Modder Mode (Save Deletion After Quitting)
« Reply #7 on: November 08, 2017, 05:32:52 pm »

"Die" kills DF. I was thinking more along the lines of quitting the game without saving, returning to DF's main menu.

However, if you want to create a world, try it, quit, remove the save, hack the raws, generate a new world,... the above is not what you want. I guess you can make a DFHack script that finds the DF save game you're using and delete all its files and the folder itself and then calls die. However, a shell script might be a better idea, especially if you just want to nuke everything within the save game folder. Start DF from the script, and then wipe the folder contents when DF terminates.

Regardless, I don't think that's something of a sufficiently wide use to be worthy of Toady's time.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: Modder Mode (Save Deletion After Quitting)
« Reply #8 on: November 09, 2017, 09:19:29 pm »

"Die" kills DF. I was thinking more along the lines of quitting the game without saving, returning to DF's main menu.
Oh. It's possible to do that by setting the "save_on_exit" global to false (or 0?), which gets rid of the "save" option in the options menu and adds an "abort game" option, much like the arena, which exits without saving. However, that global isn't consistently available in 0.43.05 (only on some platforms).

I think worlds from worldgen always get written to disk before you can embark, though, so this wouldn't address the issue of cleaning up test worlds. Personally, I would rather do that manually to avoid the risk of a buggy script trashing other worlds, plus writing a DFHack script to delete everything in a folder is non-trivial.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.