Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: [DFHack script] load-screen  (Read 4376 times)

lethosor

  • Bay Watcher
    • View Profile
[DFHack script] load-screen
« on: May 22, 2014, 06:17:20 pm »

I'm rewriting this in Lua - you can find the development version of the script here (works with r3 and up).
« Last Edit: June 08, 2014, 01:15:25 pm by lethosor »
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.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: [DFHack plugin] load-screen - suggestions wanted
« Reply #1 on: May 23, 2014, 09:36:29 am »

Can it rename the folders? The biggest issue for people is that a save called "summer 2013" is loaded, played till winter, saved, and is still called "summer 2013", even if the save is in winter. So "Rename Save" and adding a custom name should get rid of that confusion. I usually do it by hand, just renaming the region folders, but if that would come included, it would be great.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

lethosor

  • Bay Watcher
    • View Profile
Re: [DFHack plugin] load-screen - suggestions wanted
« Reply #2 on: May 23, 2014, 08:47:20 pm »

Implemented:

I've restricted the names to letters, numbers, dashes (-) and underscores (_) to avoid problems certain characters can cause on different operating systems. The method I use to actually rename the folder should work on Windows (based on the fact that Lua's os.rename() works on Windows and uses the same standard function), although I'm not sure how it handles trying to overwrite an existing folder (which it refuses to do on OS X and Linux). Anyone willing to test this?

Edit: I also added options to toggle the display of backups and colors. Thoughts? (Mouse support and persistent storage are low priorities for now, although it would be nice for it to remember your preferences in the future.) 

« Last Edit: May 23, 2014, 09:15:55 pm by lethosor »
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.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: [DFHack plugin] load-screen - suggestions wanted
« Reply #3 on: May 24, 2014, 08:32:01 am »

You are quick. :)

More suggestions: Copy Save. Delete Save. Again, both things are manually possible, but since you work on a save-management gui, these shouldnt be missing.

The next thing that comes to mind is adding saves from other locations, for example downloaded region folders from succession forts, which are somewhere in your pcs download folder. So... Import Save, Export Save, which copies/moves (?) the wanted save folder to either the data/saves fdirectory (import) or to a directory of your choice (export). Yet again, manually possible...  hope its not too much effort adding this.

More interesting suggestion: Altering saves. For example installing different tilesets to already existing saves, or 'activate cheat mode' on a specific save, which alters a reaction to give near unlimited resources. Or implementing a rudimentary difficulty setting to a save. Setting it to easy makes plants grow faster, dwarves larger and enemies slower, normal is vanilla df, hard gives narural combat skills to all invaders and makes wildlife larger and increases the cluster size... many possibilities.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

lethosor

  • Bay Watcher
    • View Profile
Re: [DFHack plugin] load-screen - suggestions wanted
« Reply #4 on: May 24, 2014, 02:38:36 pm »

Interesting ideas. I can probably figure out a way to copy saves, although there isn't a simple, cross-platform method of doing this. I'm not sure if deleting saves would be a good idea, since most people would expect a way to undo accidental deletions (while most programming languages offer permanent deletion instead). Moving saves around should be fairly easy, although I'm not sure about decompressing/compressing them.
Warmist's mod-manager can probably do most of the things you mentioned, although I'm not sure if it can modify existing saves and patch specific files (e.g. [SPEED:0]).
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.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: [DFHack plugin] load-screen - suggestions wanted
« Reply #5 on: May 24, 2014, 02:50:38 pm »

Warmists Mod Manager? How long have I been away?
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

lethosor

  • Bay Watcher
    • View Profile
Re: [DFHack plugin] load-screen - suggestions wanted
« Reply #6 on: May 24, 2014, 03:29:46 pm »

It isn't in r4, but you can find it here and some mods here. On second glance, it doesn't appear to be able to modify existing saves, although a simple Lua script could probably do so. I'll look into Lua integration to make things like this easier, although I'm hoping to get the backup-restoring feature working first.
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.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: [DFHack plugin] load-screen - suggestions wanted
« Reply #7 on: May 24, 2014, 03:37:38 pm »

Thank you and sorry for the short off-topic. Seems I might have to get dfhack experimental version r5 for MasterworkDF now. ;)

But other than the suggestions above, I could not actually think of anything. The adjustable difficulty setting would be new, because its done to a running save, but the rest you pretty much covered. :) What else could be done with saves anyway?
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [DFHack plugin] load-screen - suggestions wanted
« Reply #8 on: May 24, 2014, 11:51:07 pm »

If you're interested, Fantastic uses (a version modified for r4 of) Warmist's mod manager as its primary options GUI. Press "s" on the title screen.

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: [DFHack plugin] load-screen - suggestions wanted
« Reply #9 on: May 30, 2014, 08:00:54 pm »

Awesome, PTW until there's a stable windows version :D

Ideas: 
- Current sorting goes "1, 10, 11, 12, 2, 3, 4..." - it's easy to sort per-character, but better for humans to go by magnitude of integer. 
- I usually play with autosave, but no autobackup (file size and clutter issues) - which has obvious risks.  If I could automatically just keep the X most recent saves per region that would be awesome; a rolling buffer to catch problems without the constantly growing folder. 
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

lethosor

  • Bay Watcher
    • View Profile
Re: [DFHack plugin] load-screen - suggestions wanted
« Reply #10 on: June 03, 2014, 06:14:35 pm »

The problem with copying and deleting save folders is that C++ only has a few standard filesystem-related functions, including rename(), which renames a file or folder, and remove(), which deletes a file. Copying and deleting folders is a challenge, especially on multiple platforms (although I found a Lua library that does these things, which I may be able to port back to C++). I may also rewrite the majority of this plugin in Lua, since the C++ plugin is getting a little large to maintain. This will hopefully make file management less work, as well as making things like sorting, searching, and accurate determination of backups easier.
(Actually, I may be able to implement the entire plugin in Lua - the only obvious difference would be that Lua scripts can't use the plugin enabling/disabling mechanism in r4+, so it would need to be enabled by "load-screen enable" instead of "enable load-screen". However, the filesystem API would require at least r5, since it's not included in current versions of DFHack.)
« Last Edit: June 03, 2014, 06:18:30 pm by lethosor »
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.

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: [DFHack plugin] load-screen - suggestions wanted
« Reply #11 on: June 03, 2014, 07:20:21 pm »

With r5 expected within weeks, I say go for it!
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

lethosor

  • Bay Watcher
    • View Profile
Re: [DFHack script] load-screen - suggestions wanted
« Reply #12 on: June 07, 2014, 02:43:25 pm »

I've begun porting this to Lua. It's still missing a couple features of the plugin (e.g. renaming and mouse support), but it now supports searching and it handles backups correctly. It can be found on GitHub if anyone wants to take a look.
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.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: [DFHack script] load-screen
« Reply #13 on: June 07, 2014, 03:02:23 pm »

So, I could potentially add this to MasterworkDF? It runs dfhack r4 atm, and the default download is for Windows.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

lethosor

  • Bay Watcher
    • View Profile
Re: [DFHack script] load-screen
« Reply #14 on: June 07, 2014, 03:09:23 pm »

It's not finished yet, but it should work regardless of the platform or DFHack version.
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.
Pages: [1] 2