Bay 12 Games Forum

Please login or register.

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

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

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?

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.

Got ya.

And an oddity here, i have 3 miners atm, but when i look in your stocks screen it only shows 2! If i check the usual stocks screen it shows 3. This 3rd miner just came in on a migration wave with his own pick so maybe that has something todo with it? I have tried saving and doing a full restart of DF.

Edit: decided to check my hunters which game in over a few waves, and none of their crossbows are showing.
Also a woodcutter, his axe isn't showing. BUT! if i unset him as a woodcutter so he drops it it then will show up in your stocks screen.
« Last Edit: April 17, 2013, 09:37:47 am by Intrinsic »
Logged
Start Duelyst with a bonus 100gold, use referral code: Buttfungus
Enter during signup or ingame under Settings.

falconne

  • Bay Watcher
    • View Profile

And an oddity here, i have 3 miners atm, but when i look in your stocks screen it only shows 2! If i check the usual stocks screen it shows 3. This 3rd miner just came in on a migration wave with his own pick so maybe that has something todo with it? I have tried saving and doing a full restart of DF.

Edit: decided to check my hunters which game in over a few waves, and none of their crossbows are showing.
Also a woodcutter, his axe isn't showing. BUT! if i unset him as a woodcutter so he drops it it then will show up in your stocks screen.

Probably something wrong with my ownership checks.... I made a few guesses and assumptions that are probably wrong. Can you send me the save?


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.

Ah so if I include the dll without the lua script it's not going to crash? Then I might do that with instructions to point people at your post to get the autobutcher gui. I'll include OS X and Linux versions so you can pick them up too.
« Last Edit: April 17, 2013, 06:39:04 pm by falconne »
Logged
Utility plugins for DFHack, for improving Dwarf Fortress' user interface.

robertheinrich

  • Bay Watcher
    • View Profile

Ah so if I include the dll without the lua script it's not going to crash? Then I might do that with instructions to point people at your post to get the autobutcher gui. I'll include OS X and Linux versions so you can pick them up too.

Yeah, zone.plug.dll will run fine without the lua scripts. If you want to build it so that it exports the lua API functions make sure that you update the file CMakeLists.txt with this here "DFHACK_PLUGIN(zone zone.cpp LINK_LIBRARIES lua)". But even if you don't do that people will still be able to use the modified GUI filters for pits, cages, pastures etc, just not the autobutcher GUI script.
« Last Edit: April 17, 2013, 07:54:41 pm by robertheinrich »
Logged

Intrinsic

  • Bay Watcher
    • View Profile

And an oddity here, i have 3 miners atm, but when i look in your stocks screen it only shows 2! If i check the usual stocks screen it shows 3. This 3rd miner just came in on a migration wave with his own pick so maybe that has something todo with it? I have tried saving and doing a full restart of DF.

Edit: decided to check my hunters which came in over a few waves, and none of their crossbows are showing.
Also a woodcutter, his axe isn't showing. BUT! if i unset him as a woodcutter so he drops it it then will show up in your stocks screen.

Probably something wrong with my ownership checks.... I made a few guesses and assumptions that are probably wrong. Can you send me the save?

It's uploading to DFFD now as it was bigger than i could send to your gmail address, the save is uncompressed so i could get it under 50mb. I have crappy upload speed(yey UK ISPs) so it could take a while i'll update the post with a link when able.

And when i said miners above i meant the miner's picks :)

Save link: http://dffd.wimbli.com/file.php?id=7584

Edit: Feature request. One thing that always bugged me with the normal stocks screen is if i wanted to know who had an item i had to zoom to them check, and then dig my way back through the stocks screen to check on the next item etc. Is it possible on your stocks screen to have the name of the Dwarf who currently has the item in his Inventory listed in the panel(or top/bottom border) on the right please it would be a major time saver :)
« Last Edit: April 18, 2013, 03:40:31 am by Intrinsic »
Logged
Start Duelyst with a bonus 100gold, use referral code: Buttfungus
Enter during signup or ingame under Settings.

robertheinrich

  • Bay Watcher
    • View Profile

And an oddity here, i have 3 miners atm, but when i look in your stocks screen it only shows 2! If i check the usual stocks screen it shows 3. This 3rd miner just came in on a migration wave with his own pick so maybe that has something todo with it? I have tried saving and doing a full restart of DF.

Edit: decided to check my hunters which game in over a few waves, and none of their crossbows are showing.
Also a woodcutter, his axe isn't showing. BUT! if i unset him as a woodcutter so he drops it it then will show up in your stocks screen.

Probably something wrong with my ownership checks.... I made a few guesses and assumptions that are probably wrong. Can you send me the save?

Took a look at your checks and it's a very simple problem:
Code: [Select]
if (item->pos.x == -30000)
   continue;

Items which never had a map position have pos.x,y,z == -30000. This applies to the pick in question because it was brought by a migrant and never touched the ground. This also applies to all worn clothes and held items brought on embark or by migrants, booze inside barrels and so on. So this check skips over a lot of legit items in the fortress.

As for the other checks... they surprised me a bit. I think it's ok to skip stuff owned by traders, part of buildings or constructions (which vanilla shows) to remove some clutter. But why do you skip spider_web and hostile? Mass-forbidding spider webs in freshly revealed caverns so that dumb weavers don't try to get them is a common practice. Same for dumping weapons and maybe armor owned by invaders caught in cage traps if you want to use them as training dummies (though I'm not 100% sure if their equip even has this flag set or simply no ownership).
« Last Edit: April 18, 2013, 06:45:49 am by robertheinrich »
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist

I thought workers would destroy forbidden webs?
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 :::

robertheinrich

  • Bay Watcher
    • View Profile

I thought workers would destroy forbidden webs?
I think anything (except web collectors) destroys them, forbidden or not. Workers, soldiers, pets, ... I know that I could solve the problem with putting looms and weavers inside a burrow but I'm too lazy for that and just forbid them and import silk from caravans.
Logged

falconne

  • Bay Watcher
    • View Profile

As for the other checks... they surprised me a bit. I think it's ok to skip stuff owned by traders, part of buildings or constructions (which vanilla shows) to remove some clutter. But why do you skip spider_web and hostile? Mass-forbidding spider webs in freshly revealed caverns so that dumb weavers don't try to get them is a common practice. Same for dumping weapons and maybe armor owned by invaders caught in cage traps if you want to use them as training dummies (though I'm not 100% sure if their equip even has this flag set or simply no ownership).

Initially it was an easy way to prevent unrevealed items from showing up, but then I added a check for unrevealed tiles first, so I should go back and allow those. The items with a -30000 position might be a bit tricky though, as I can't check if they are on unrevealed tiles (that's why I skip over them). Would it be possible for an invader on an unrevealed tile to be carrying something that doesn't have a valid position yet?
Logged
Utility plugins for DFHack, for improving Dwarf Fortress' user interface.

robertheinrich

  • Bay Watcher
    • View Profile

Most cave inhabitants don't carry things. But those animal people sometimes have blowguns. I don't have any on the map I'm currently playing so I can't check if they have some clothes, too. You should probably do some checks on the owner/holder when an item is in inventory. And skip those where the holder is on an unrevealed tile or on a revealed tile but invisible (sneaking thieves, hiding necromancers) to avoid accidentally showing their equip and revealing their position to the player if he zooms there.

Hm or maybe if the item isn't carried by somebody of the player's civilization check if the holder is sitting inside a cage? I think that's the only way to disarm invaders anyways. You already skip items which belong to traders which I think is a good idea. There's no need to display all that stuff the player can't access. And in certain situations there are lots of foreign creatures on the map. During sieges or if you use embark anywhere and have a human town (possibly friendly) on your map and so on. All their equip would show up.
« Last Edit: April 18, 2013, 08:15:28 am by robertheinrich »
Logged

Intrinsic

  • Bay Watcher
    • View Profile

The save i uploaded has plenty of cave people from 3 different races. Items they have: blowguns, blowdarts, spears, shields, but no clothing it seems.
Logged
Start Duelyst with a bonus 100gold, use referral code: Buttfungus
Enter during signup or ingame under Settings.

robertheinrich

  • Bay Watcher
    • View Profile

Yeah, just to confirm that: the animal people in Intrinsic's save carry weapons which all have invalid map positions.
Logged

falconne

  • Bay Watcher
    • View Profile

I'll go through those this weekend and fix them. I wanted to err on the side of caution and not display anything you're not supposed to see yet. And you're right, the correct thing to do is to also check if the item is in a creature inventory or container, then check if the container is on a unrevealed tile... I had been taking the approach of not wanting to use too much processing time to check all these, but only a fraction of the items will fall into this category.
« Last Edit: April 18, 2013, 12:43:29 pm by falconne »
Logged
Utility plugins for DFHack, for improving Dwarf Fortress' user interface.

falconne

  • Bay Watcher
    • View Profile

I've just uploaded a new version of this plugin. It fixes bugs with certain items not showing up and adds a couple of new features.

Note that the hotkeys have changed... I've made the flag toggling use Ctrl-hotkeys, so that I can use more sensible Shift-hotkeys for the dump and forbid actions (the OP has been updated with new screenshots of these).

There is "Trade" flag indicating 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. There's now a "Mark for Trade" option that 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.

The "valid for trade" check in the plugin may be a bit too restrictive when it comes to containers... I've noticed that the base game lets you mark bins for trade even when they contained items still owned by a dwarf. I wanted to stay cautious about that for now so the plugin won't mark a container if it contains any owned items. The next version will probably allow that, once I confirm it really is ok to do so.

Let me know if you notice any bugs.
Logged
Utility plugins for DFHack, for improving Dwarf Fortress' user interface.

Intrinsic

  • Bay Watcher
    • View Profile

It see's my migrants stuff now great job!
Logged
Start Duelyst with a bonus 100gold, use referral code: Buttfungus
Enter during signup or ingame under Settings.

Intrinsic

  • Bay Watcher
    • View Profile

Bug found! It seems to reveal hidden thiefs/snatchers etc. ie search for Large on the stocks screen and see what pops up ;p
Logged
Start Duelyst with a bonus 100gold, use referral code: Buttfungus
Enter during signup or ingame under Settings.
Pages: 1 [2] 3 4 5