Bay 12 Games Forum

Please login or register.

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

Author Topic: Plugin to add alternative stocks interface, with an easier to search list  (Read 7588 times)

falconne

  • Bay Watcher
    • View Profile

Download (Windows, Linux and OS X)
Link contains download archive with all my plugins.
Only works on the latest DFHack r3 (see the dfhack thread). Follow the instructions in the included readme for installation. The relevant file for just this plugin is stocks.plug.*

Stocks Interface
This plugin adds an alternative stocks interface which should hopefully make it quicker to find items. It contains a single searchable list with indicators and filters. Unlike the ingame stocks screen, this list excludes items belonging to merchants, on active invaders, etc.

Add a keybinding to dfhack.init similar to the following and use it to open the screen:
Code: [Select]
keybinding add Shift-Ctrl-K@dwarfmode/Default "stocks show"

Note: change the binding to whatever suits your setup (certain bindings don't work on some systems).



The Search option in the lower right is always on, so just start typing to filter the list to what you want (the example above is filtered to rope items). All other hotkeys on the screen are activated with "Shift" or "Ctrl", to allow the search function to always be active. The search can be cleared with Shift-S.

Also, the mouse works in this screen.

The coloured letters beside each item indicate various item flags; the key is on the right hand pane. You can also see the quality of applicable items, and any decorated items will be marked with a blue asterisk.

Flags
The top of the right hand pane lists filters for the flags each item could have. All items are displayed by default. Pressing Ctrl + the flag key will toggle that filter on and off. When off, items with that flag are not displayed in the list. The state of these flags persist when exiting and returning to the screen. In this example all flags have been turned off except Inventory, to filter the list to only items that are being worn by dwarves:



When using the search function, you can also include the names of flags to filter the results. So if you wanted to find all steel crossbows marked for trade, you can type in "cross steel trade" (notice the order of keywords don't matter nor do they need to be complete).

The "Trade" flag indicates items marked for hauling to the depot. This does not include items at the depot; those are considered "in a building" and not shown in this screen.

The "No Flag" filter is a special case to exclude items that have none of the listed flags; you can turn this off when you want to restrict the list only to items that have a specific flag set.

The "Clear all" and "Enable all" options are convenience functions to operate all the filters.

Quality & Wear
The next set of options allow you to restrict the list to a specific quality range:



You can also filter to minimum "Wear" for clothing items. Currently you can't clear ownership from this screen, you still need to use the cleanowned plugin for that, but once you've done that you can use this screen to find them and mark them for trade, if you wanted to.



Actions
The number in the Actions title is a count of the filtered list, which should make things a bit easier when you're doing inventory checks. Zoom takes you to the selected item, Dump and Forbid toggles the respective flags. The "Apply to" option determines how the Dump and Forbid actions operate. By default it's set to only operate on the highlighted item in the list. If you toggle this to "Listed", those two actions will act on every item in the filtered list. You can use this to filter the list down to a specific type of item and toggle them all. Be careful with it... make sure the list is filtered to exactly what you want.

The "Mark for Trade" option lets you set one or more items for hauling to the depot. Due to complications, you can only mark them, you can't unmark them once they are marked. You would have to use the Trade Depot hauling screen if you want to cancel that job. This option won't mark artifacts, items in inventory, owned items, items in a job or items that match current export restrictions. If you mark an item in a container, the container will be marked for trade, but only if every item in it is valid for trade according to those conditions. When a container is marked for trade, all items in that container will show the Trade flag.

Stockpiles
When you have a stockpile selected in query mode, you can press the "i" hotkey to open this stocks screen showing only items in that stockpile.
« Last Edit: December 26, 2013, 06:49:56 am by falconne »
Logged
Utility plugins for DFHack, for improving Dwarf Fortress' user interface.

Intrinsic

  • Bay Watcher
    • View Profile

Oohh!H!HH! :D looks amazing, once again!
Logged

Undeadlord

  • Bay Watcher
    • View Profile

Incredible, falconne, you make this game more playable every day.
Logged

scamtank

  • Bay Watcher
    • View Profile

You're a goddamn magic wizard.
Logged

Wannabehero

  • Bay Watcher
    • View Profile

While this may be inappropriate, and anatomically improbable...

Falconne, I want to have your babies
Logged

robertheinrich

  • Bay Watcher
    • View Profile

Nice work. Allow me a couple suggestions:

1. The keybinding you propose (Ctrl-K) is already used by the example dfhack-init (which many people just use without modifying, sometimes without even looking into it). And it's bound to "autodump-destroy-item" which is a relatively invasive command, so people might end up accidentally destroying stuff. To avoid confusion something like maybe Ctrl-Z would be more suitable. It's not taken yet and the status/stocks screen in the vanilla UI is associated with z.

2. Some sorting would be good. By item type like in the vanilla stock screen (meat, fish, raw fish, egg, ...) and possibly sorted alphabetically within an item type.

3. The filtering by flags should have 3 states: flag ignored / don't list items with this flag / only list items with this flag. Right now it's only possible to  exclude items with certain flags, not specifically search for them. But it would be quite useful, for example, being able to show only forbidden items to get a quick overview if some items accidentally landed on some quantum piles after mass-dump orgies.

4. Minor issue: It would be a bit more intuitive to switch some of the hotkeys. Specifically forbid, dump and melt (once you get to add an action for that). The keys f,d,m are used in vanilla UI for setting those flags. So I think Shift+F,D,M should execute the actions in your plugin, not change the filters.

5. Some additional filters would be nice. Particularly dyed/undyed. One thing which has been requested pretty often in the past is being able to distinguish between dyed and undyed cloth. Sadly stockpile settings don't allow this directly so players need to setup a chain of "give to workshop / take from workshop / only take from links". While that's possible I find it easier to temporarily forbid all undyed cloth (and dyed below a certain quality) per lua script when ordering some clothes to make sure the clothier is forced to use only the best input materials. Being able do do that using this plugin would be even easier :)
Logged

Umbra

  • Bay Watcher
    • View Profile

Finally! I wanted this kind of tool for a loooooong time now, you are awesome!
Logged

burchalka

  • Bay Watcher
    • View Profile

If only I could assign that masterful steel mitten to specific military dwarf from this plugin - it would be awesome.
Logged

robertheinrich

  • Bay Watcher
    • View Profile

As for allowing to melt items: this here should tell you if an item is metal. You'd probably have to narrow this down to certain item types as well (weapons, armor, crafts, ...). Ask in the dfhack thread or the IRC channel, chances are somebody already looked close enough at DF's UI code and will be able to tell you what checks exactly need to be made ensure an item is eligible for melting:

Code: [Select]
bool isMetal(df::item* i)
{
    MaterialInfo matinfo;
    if (i && matinfo.decode(i))
    {
        if (matinfo.material->flags.is_set(df::material_flags::IS_METAL))
            return true;
    }
    return false;
}
Logged

Nameless Archon

  • Bay Watcher
    • View Profile

It needs to be said that your plugins are a centerpiece of my tutorial stream, wherein I demonstrate their use for viewers, because they rock.

Keep up the good work, man, you're doing Armok's will.
Logged

Itnetlolor

  • Bay Watcher
  • Screw physics...
    • View Profile
    • Steam ID

Sweet. DF Management has gotten that much better. Nice work. Looking forward to the next versions.

Edwardspoonhands

  • Escaped Lunatic
    • View Profile

I don't get it. I get errors for every plugin when I run the game after copying the files into the plugin folder. "Dwarf Fortress.exe - Entry Point Not Found" "The procedure entry point [...] could not be located in the dynamic link library SDL.dll." I use LNP with the newest versions of the game and DFhack, so that might not be it.

EDIT: Shit, nevermind I didn't have the newest version of DFhack afterall. Thanks for making this.
« Last Edit: April 17, 2013, 03:29:01 am by Edwardspoonhands »
Logged

Intrinsic

  • Bay Watcher
    • View Profile

Maybe ctrl-shift-s for stocks? a bit long though ;p

And i notice no zone plugin, did you mean to include the newer version but forgot?
Logged

falconne

  • Bay Watcher
    • View Profile

Maybe ctrl-shift-s for stocks? a bit long though ;p

And i notice no zone plugin, did you mean to include the newer version but forgot?

Actually I decided it would be easier if people downloaded the new zone plugin from Robert's thread, because that version also requires a lua script. I just need to update my summary thread to point to his post.

And yeah, ctrl-shift-s might be a good default... I had ctrl-z when i was making the plugin but for some reason that key combination is unreliable in my environment.
Logged
Utility plugins for DFHack, for improving Dwarf Fortress' user interface.

robertheinrich

  • Bay Watcher
    • View Profile

The downside is that I can't build for Linux and OS X users while you can. And it's the other way round, the zone plugin doesn't require the lua scripts, it would run just fine without them. The lua scripts require the new version of the plugin because it now contains a couple API functions to control autobutcher behavior per script.
Logged
Pages: [1] 2 3 ... 5