Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Merchants stopped coming, items appear in stocks but not on map - delete items  (Read 1094 times)

Marianne

  • Bay Watcher
    • View Profile

Hey,

I have this bug:
http://www.bay12forums.com/smf/index.php?topic=159261.0
(didn't want to necro this old thread)

And I already used the lua scripts by PatrikLundell. But I wasn't happy with the result.

Now I just used the dfhack command: fix/stuck-merchants and after this a new caravan arrived. The problem is that the old trader items are still there. And my dwarves can't take all of them to dump. So it seems they can't gather those invisible/bugged items.

Is there a way to use this command:

Quote
function claimmerchantstuff ()
  for i = 0, #df.global.world.units.all - 1 do
    if df.global.world.units.all .flags1.merchant and
      df.global.world.units.all .flags1.dead and
      df.global.world.units.all .flags3.scuttle then
      dfhack.println ("Scuttling merchant: " ..  tostring (i))
      
      for _, v in ipairs (df.global.world.units.all .inventory) do
        if v.mode == 0 then  --  hauled
         v.item.flags.dump = true
      end
      end
   end
  end
end

claimmerchantstuff()

in a way to delete all the merchant items left on the map? I have no idea of how to script. But in my view it should be possible to remove those items like fix/stuck-merchants just removed the bugged merchant.

Quote
Removing unit 2476: Shem Rodumnish (dwarf), civ 68 (Bubnusurvad, dwarf)

Any ideas? And much thanks to PatrikLundell and the others who came up with scripts way before the dfhack command was there.

I think I found a "solution" - autodump is taking all the "invisible items" to the place where the cursor is, so I just have to get my magma dump ready and good buy fps-killer-items. ;) :*
« Last Edit: February 04, 2018, 03:35:37 pm by Marianne »
Logged

PatrikLundell

  • Bay Watcher
    • View Profile

That version of the claimmerchantstuff script was intended to be used with the autodump command and subsequent destruction of the stuff under the cursor with autodump destroy-here after any things that had been marked for dumping but shouldn't be destroyed had been carried to safety.

I have a better version of claimmerchantstuff that drops the items to the ground (which makes them visible) at the border tile the merchant was at (nominally) as well as dump mark them, allowing you to just let the dorfs haul them off. (You can still use autodump + autodump destroy-here if you want to).

Spoiler (click to show/hide)
Logged

Marianne

  • Bay Watcher
    • View Profile

Thank you, I will test it the next time I come over this bug. :/
Logged

timotheos

  • Bay Watcher
    • View Profile

Does anyone have a non- dfhack solution to this problem? I don't want to install dfhack as I know i'll just end up cheating other stuff with it as well and that's no fun.

The only other solution i can see is from me 2 years ago which is also annoying. (also has it really been 2 years since I played this regularly?)
Logged

Loci

  • Bay Watcher
    • View Profile

Does anyone have a non- dfhack solution to this problem?

Save prior to the caravan's arrival, then reload until the caravan successfully trades at the depot. This doesn't "fix" the problem if you've already got a stuck caravan, but it does prevent the stuck caravan in the first place.
Logged

timotheos

  • Bay Watcher
    • View Profile

Urgh I hate dfhack. I'll do it the other way and just retire/unretire
Logged