Bay 12 Games Forum

Dwarf Fortress => DF Dwarf Mode Discussion => Topic started by: Lummox JR on April 15, 2021, 08:45:57 pm

Title: Dwarves moving items from quantum stockpile into bins
Post by: Lummox JR on April 15, 2021, 08:45:57 pm
In my fort I setup a quantum stockpile near my smelters for melt-designated items, and I'm moving them all there via DFHack to save time (since you can't specify melt-designated items only for hauling). However I'm running into a weird situation where my idiot dwarves are grabbing items out of this stockpile and moving them into bins in another stockpile, even though the items they're moving are fine where they are. Even worse, they're often removing the melt designation for a number of these items!

Most of this stuff is goblinite, so it's a lot of useless copper armor, or sometimes iron I want to melt down for making steel. The QSP is defined as follows:

- Will take from links only
- Max bins and barrels: 0
- Wheelbarrows: 0
- Animals: Empty cages only
- Furniture/Siege ammo: All types, metal only, core & total quality Exceptional or below
- Ammo: Same
- Finished goods: Same
- Weapons/Trap components: Same
- Armor: Same

What am I missing? Why aren't my dwarfs respecting that these items are in a stockpile already, and putting them in another?

None of these items are in bins, but they're being put into bins in the other stockpile.
Title: Re: Dwarves moving items from quantum stockpile into bins
Post by: feelotraveller on April 15, 2021, 09:20:42 pm
Placing items in bins (in valid stockpiles) takes priority over leaving items binless in a valid stockpile.  Just the way the game mechanic is designed. Shrug.

The simplest solution in this case is to add give only link(s) from the melt QSP to the smelter(s) used for melting.  Then nothing in the QSP should be taken to another stockpile.

Separately - if the melt designation is being removed that seems like a bug and should be reported on the bug tracker (or added to a report if such already exists). https://bay12games.com/dwarves/mantisbt/view_all_bug_page.php (https://bay12games.com/dwarves/mantisbt/view_all_bug_page.php)
Title: Re: Dwarves moving items from quantum stockpile into bins
Post by: Lummox JR on April 15, 2021, 09:29:17 pm
The simplest solution in this case is to add give only link(s) from the melt QSP to the smelter(s) used for melting.  Then nothing in the QSP should be taken to another stockpile.

I tried that but without any luck. Dwarves were still creating jobs to move items to bins in the other stockpile.
Title: Re: Dwarves moving items from quantum stockpile into bins
Post by: feelotraveller on April 15, 2021, 09:35:41 pm
Perhaps the problem is being caused by moving them to the tile with DFHack (I'm guessing autodump?) so they are not registered as being on the stockpile?
Title: Re: Dwarves moving items from quantum stockpile into bins
Post by: Lummox JR on April 15, 2021, 09:37:53 pm
Perhaps the problem is being caused by moving them to the tile with DFHack (I'm guessing autodump?) so they are not registered as being on the stockpile?

I thought of that, but I can't seem to find any info on how items do get registered as being on a stockpile. Nothing in the items' properties appears to link there, but that's true of other items in stockpiles too.

For moving I'm using a Lua script, which ends up calling the moveToGround() method.
Title: Re: Dwarves moving items from quantum stockpile into bins
Post by: feelotraveller on April 15, 2021, 09:44:10 pm
Some with more DFHack knowledge might be able to help.  But I'm curious what might happen if instead the script moved the items to an empty tile one z-level above the stockpile, so that they 'naturally' fell into it?
Title: Re: Dwarves moving items from quantum stockpile into bins
Post by: Lummox JR on April 15, 2021, 09:52:28 pm
Well, using moveToGround() to move an item up to an open space doesn't let it fall; it just sits there in space. Kinda weird. I think what I'd have to do is channel out above the stockpile and designate a dump next to it, then dump-designate all the items and see what happens.

I have a pretty strong guess it won't fix the issue, but who knows?
Title: Re: Dwarves moving items from quantum stockpile into bins
Post by: feelotraveller on April 15, 2021, 10:07:10 pm
Ah okay.  Does DFHack 'teleport' also use moveToGround()?

Otherwise a minecart QSP (https://dwarffortresswiki.org/index.php/DF2014:Quantum_stockpile#The_Minecart_Stop) would do the trick, at least for testing purposes.

Other than the items not being considered part of the stockpile why else would 'give to workshop' link(s) be ignored?
Title: Re: Dwarves moving items from quantum stockpile into bins
Post by: Lummox JR on April 15, 2021, 10:24:04 pm
Ah okay.  Does DFHack 'teleport' also use moveToGround()?

It does not. It moves creatures by a different approach.

Quote
Otherwise a minecart QSP (https://dwarffortresswiki.org/index.php/DF2014:Quantum_stockpile#The_Minecart_Stop) would do the trick, at least for testing purposes.

The problem with the minecart QSP approach is that the items need to be validly in another stockpile already, so it kind of requires me to have solved the problem in order to solve the problem.

I deeply wish the game would allow stockpiles and hauling to designate flags like melt and dump, or other things like fit.
Title: Re: Dwarves moving items from quantum stockpile into bins
Post by: feelotraveller on April 15, 2021, 10:40:30 pm
Yes the QSP minecart is recursive but a bit of ingenuity would allow the dwarfs to haul things to the feeder stockpile normally and then the behaviour of the dumped items would confirm whether or not it is the moveToGround() using script which is causing the problem.

A matter of confirming or ruling out the moveToGround() script as being the cause of the problem.  If the script is solid the search goes on.  If it is not then writing an alternate script (maybe calling autodump then iterating through the moved items to unforbid them? ... pardon me for not being a scripter or aware of all the difficulties...) is a valid approach.
Title: Re: Dwarves moving items from quantum stockpile into bins
Post by: Lummox JR on April 16, 2021, 12:47:24 am
Tried the dump-from-above approach. After a number of items fell into the pile naturally from being dumped above, I reclaimed and turned on melt for a bunch of them. Shortly thereafter most of them showed a job lined up for them, so they were going to be put back in the other stockpile where they didn't belong.
Title: Re: Dwarves moving items from quantum stockpile into bins
Post by: anewaname on April 16, 2021, 08:18:39 am
This may sound silly, but make sure the quantum stockpile's Additional Options has both settings active. You are already specifying metal-only in the other categories, so leaving these active should cause no problem.
Title: Re: Dwarves moving items from quantum stockpile into bins
Post by: Lummox JR on April 16, 2021, 03:54:59 pm
This may sound silly, but make sure the quantum stockpile's Additional Options has both settings active. You are already specifying metal-only in the other categories, so leaving these active should cause no problem.

I do have both of those active. I still have no idea what they do, however.
Title: Re: Dwarves moving items from quantum stockpile into bins
Post by: anewaname on April 16, 2021, 06:04:21 pm
Wiki section about Additional Options (http://dwarffortresswiki.org/index.php/DF2014:Stockpile#Additional_Options).
Title: Re: Dwarves moving items from quantum stockpile into bins
Post by: Valkyrie on April 29, 2021, 01:27:22 pm
I might be completely off base, but have you tried _not_ having it take-from-links-only?  I would think just dumping stuff onto the tile wouldn't count properly, so it would still be considered "loose" and thus get jobs to properly put it away.  But I could be mis-remembering how that option works.
Title: Re: Dwarves moving items from quantum stockpile into bins
Post by: PatrikLundell on April 29, 2021, 06:07:33 pm
I might be completely off base, but have you tried _not_ having it take-from-links-only?  I would think just dumping stuff onto the tile wouldn't count properly, so it would still be considered "loose" and thus get jobs to properly put it away.  But I could be mis-remembering how that option works.
Dumping "properly" with a dump zone or a minecart causes items to be considered to be in the stockpile (that's how quantum stockpiling works), apart from barrels and pots, which get hauled back to the source stockpile after having been dumped (and possibly transported) by a minecart.
Title: Re: Dwarves moving items from quantum stockpile into bins
Post by: Mohreb el Yasim on July 12, 2021, 11:06:09 am
You could, for testing
desactivate other stockpiles.
Make a quantum stockpile with minecart.
When half of the things is there stop it and dump the rest to an other.
Then see if both or Dfhack only stockpile will be emptied to the reactivated bin piles
Title: Re: Dwarves moving items from quantum stockpile into bins
Post by: ldog on July 25, 2021, 10:04:16 pm
You shouldn't need to touch the QSP settings, as long as they are set to take from links only they can accept everything.
Your other piles for the most part shouldn't be accepting those same items, unless you specifically want them to take from the QSP (and set them to take from it).
Bins are pure evil and should be destroyed and disallowed from all piles. My guess would be place items in bins is some kind of higher priority stockpile task.