Bay 12 Games Forum

Please login or register.

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

Author Topic: A (kludgey) workaround for the disappearing caravan bug  (Read 35002 times)

lethosor

  • Bay Watcher
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #45 on: November 08, 2016, 12:23:18 am »

Try this (where UNIT_ID is one of those IDs)

:lua ~df.unit.find(UNIT_ID).pos

and also this, with the 'k' cursor active:

:lua df.global.cursor:assign(xyz2pos(pos2xyz(df.unit.find(UNIT_ID).pos)))

Then move the cursor to the left and right one tile and see if there's anything interesting where you wound up.
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.

PatrikLundell

  • Bay Watcher
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #46 on: November 08, 2016, 06:20:01 am »

Hm, it seems my latest human caravan went AWOL and I've got some invisible stuff that isn't mine in my stocks screen. Poking around, I have a number of merchant tagged creatures in the units lists. All of them are both in the "all" and "bad" lists, and 3 of them are in the "active" list. Curiously, all of them have the "dead" flag set and none of them reacts to teleportation.
It can be noted that I haven't seen any dead merchants in this game, and as far as I know all the caravans have left the embark without incident.
I've shared my save via dropbox. It's a 0.43.03 LNP r07 game using Phoebus and DFHack (obviously): https://www.dropbox.com/s/wnphddsutlpztfk/region1.zip?dl=0
The missing caravan was the summer human one, and it's currently late autumn.
The merchant id:s are in the range 36913-36938, with 17, 22, 30, 31, 33, 34, 36, and 37 missing (I haven't looked to see what those are).
They show up in the "all" and "bad" lists in the range 600 - 621, with the same index in both lists, while the 3 active units are in the range 210-212 in that list.

However, running lethosor's first lua command gives the position of the cursor (where the units should have been teleported, but don't show up). Moving the cursor away and running the second command moves the cursor back to where the units were teleported.

The save is made before I messed around with things, though, so any merchants should be stuck in their "original" positions.

Thus, my case seems to match Dunamisdeios' case, where units are teleported but don't show up.

By toggling the "dead" flag on all the merchants the 3 in the active list show up after teleportation (I didn't check to see if they became visible just with a change of the flag), but none of the others. The three just stand there, however, without moving, but toggling the "rider" flag got them moving and they moved to the map edge, where they just remained standing.
It can also be noted that some of the ones that were NOT in the active list had the "left" flag set, but the "active" ones did not.
Disabling the "incoming" flag on the 3 visible merchants did not seem to cause them to leave.
Setting the "left" flag cause the units to disappear, not be teleported, and no longer remain in the "active" list.
Toggling the "left" flag on units in the all list not also in the active list had no effect.

And lethosor's second script moved the cursor to where the invisible lost goods are.

Various ramblings and poking around, but no solution.
Logged

wierd

  • Bay Watcher
  • I like to eat small children.
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #47 on: November 08, 2016, 06:28:24 am »

You might try "full-heal -r" on them first. If you can get them to show up in the unit list under "others", you can select them there, even if you cant find a corpse. Failing that, you can give it "-unit UNIT_ID" to specify the unit to heal/resurrect.

The teleport script might work after that.

« Last Edit: November 08, 2016, 06:30:06 am by wierd »
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #48 on: November 08, 2016, 06:45:45 am »

It was worth an attempt to try full-heal, but it didn't change anything, unfortunately. The recalled units don't show up on the other units screen either, even after becoming visible on the map.
Logged

Kathe

  • Bay Watcher
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #49 on: November 08, 2016, 12:07:50 pm »

:lua for _, unit in pairs(df.global.world.units.active) do if dfhack.units.isMerchant(unit) then print('merchant',unit.id) end end

This printed the ID's for four merchants.

Here's something interesting. I was unable to teleport those units even after I had the unit ID's in front of me. It did not return an error. Nothing happened at all. It acted like I had teleported something, but did not.

I tried them individually using teleport -unit #. It did work for other, visible units in my fort.

Maybe the fault is it not with lethosor's script (maybe it's not even with me!).


Same results here. That printed the id's for 2 merchants, one for each "bugged" item location. Invoking teleport for those 2 id's didn't move anything, but I tried invoking teleport for other, visible units on the map and it worked.

The save is here: https://www.dropbox.com/s/c2iy5rd1ejd87ut/region1-00314-07-01.rar?dl=0
It's LNP 0.43.03 -r1 with Phoebus.
That's about 2 and a half years after the bug appeared and merchants stopped coming.
« Last Edit: November 08, 2016, 12:10:07 pm by Kathe »
Logged

Dunamisdeos

  • Bay Watcher
  • Duggin was the hero we needed.
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #50 on: November 08, 2016, 07:33:04 pm »

It says that all merchants are at the location I teleported them to! However there is nothing there.

Forsooth!
Logged
FACT I: Post note art is best art.
FACT II: Dunamisdeos is a forum-certified wordsmith.
FACT III: "All life begins with Post-it notes and ends with Post-it notes. This is the truth! This is my belief!...At least for now."
FACT IV: SPEECHO THE TRUSTWORM IS YOUR FRIEND or BEHOLD: THE FRUIT ENGINE 3.0

PatrikLundell

  • Bay Watcher
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #51 on: November 09, 2016, 02:56:37 am »

It says that all merchants are at the location I teleported them to! However there is nothing there.

Forsooth!
Looks like my situation. Only merchants in the "active" list would show up, and then only after I've toggled the "dead" flag.
I've dismissed the 3 merchants that were in the "active" list by setting the "left" flag in the hope that it would allow a new caravan. Unfortunately, the gobbos decided to invade, so the next chance to see if it has any useful effect is in a year. Thus, as far as I know, my meddling can just as well have made things worse.

Edit:
Ive looked at Kathe's save, and it looks very much like the same situation I have. A bunch of merchants are in the "all" and "bad" lists, with two in the "active" list as well. Like in my case, those two can be made to show up by "reviving" them, and like in my case, both of them were "riding".

Edit2: I've looked at the invisible items that the caravan brought. It seems at least one item is in the inventory of a hauler merchant animal (together with a long list of other items), rather than on the ground. That animal is, of course, one of those merchants not in the active list, but has a position that's the same as that the stock screen zooms to. It can be noted that the merchant animal had the "scuttle" flag set, so the items ought to have been dropped.
« Last Edit: November 09, 2016, 04:49:10 am by PatrikLundell »
Logged

Kathe

  • Bay Watcher
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #52 on: November 09, 2016, 12:22:03 pm »

What a mess...I guess the last thing to do is retiring and reclaiming and see if that works. It's just that I don't look forward to recreating all of those work orders..
Logged

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #53 on: November 09, 2016, 01:05:48 pm »

Since it is native thing, you can use macro to record all your usual work orders and leave them for later. Something to do now, since it'll come in useful anyway.

Dunamisdeos

  • Bay Watcher
  • Duggin was the hero we needed.
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #54 on: November 09, 2016, 01:19:26 pm »

It says that all merchants are at the location I teleported them to! However there is nothing there.

Forsooth!
Looks like my situation. Only merchants in the "active" list would show up, and then only after I've toggled the "dead" flag.
I've dismissed the 3 merchants that were in the "active" list by setting the "left" flag in the hope that it would allow a new caravan. Unfortunately, the gobbos decided to invade, so the next chance to see if it has any useful effect is in a year. Thus, as far as I know, my meddling can just as well have made things worse.

Edit:
Ive looked at Kathe's save, and it looks very much like the same situation I have. A bunch of merchants are in the "all" and "bad" lists, with two in the "active" list as well. Like in my case, those two can be made to show up by "reviving" them, and like in my case, both of them were "riding".

Edit2: I've looked at the invisible items that the caravan brought. It seems at least one item is in the inventory of a hauler merchant animal (together with a long list of other items), rather than on the ground. That animal is, of course, one of those merchants not in the active list, but has a position that's the same as that the stock screen zooms to. It can be noted that the merchant animal had the "scuttle" flag set, so the items ought to have been dropped.

How do you go about setting their flags to "left"? This might solve it for me.
Logged
FACT I: Post note art is best art.
FACT II: Dunamisdeos is a forum-certified wordsmith.
FACT III: "All life begins with Post-it notes and ends with Post-it notes. This is the truth! This is my belief!...At least for now."
FACT IV: SPEECHO THE TRUSTWORM IS YOUR FRIEND or BEHOLD: THE FRUIT ENGINE 3.0

PatrikLundell

  • Bay Watcher
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #55 on: November 09, 2016, 01:57:43 pm »

@Dunamisdeos:
- gui/gm-editor df.global.world.units.active
- go into the indices whose id:s correspond to the merchants
- go into flags and toggle the left flag.

I used a script to get the indices.
I wouldn't recommend doing that, however, as I still have no idea if it works: the description above was mainly aimed at people who might actually understand how things work/should work. For all I know, it might screw up things permanently instead. My first human caravan after the bugged one was blocked by a gobbo siege, a second siege arrived in winter, and the elven caravan just arrived. It's slow going with all the sieges, and I suspect the siege risk for the coming summer is > 50%.
The fact that the "scuttled" goods are still tied up with units that were marked as "left" originally isn't a good indication.
If I knew how to remove the goods from the bugged merchants in a proper manner I'd make a script to scuttle them at their indicated location.
Logged

Dunamisdeos

  • Bay Watcher
  • Duggin was the hero we needed.
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #56 on: November 09, 2016, 07:28:51 pm »

I was able to locate the merchants through the gm editor and toggle the flags!

Now to see if it works.



I got migrants for the first time in like 4 years! I believe this method was successful. I'll update if the caravan shows up too.
« Last Edit: November 09, 2016, 08:54:30 pm by Dunamisdeos »
Logged
FACT I: Post note art is best art.
FACT II: Dunamisdeos is a forum-certified wordsmith.
FACT III: "All life begins with Post-it notes and ends with Post-it notes. This is the truth! This is my belief!...At least for now."
FACT IV: SPEECHO THE TRUSTWORM IS YOUR FRIEND or BEHOLD: THE FRUIT ENGINE 3.0

PatrikLundell

  • Bay Watcher
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #57 on: November 10, 2016, 03:15:57 am »

Congratulations!

I'd forgotten about the migrants, as I play dead civs.

Edit:
I keep getting sieged, so I can't verify things with my own game, but I applied a script to Kathe's save, and without it no caravan arrived, but with it it did, so it might actually work.

The script:
Code: [Select]
-- Dismisses bugged merchants.
--[====[

dismissmerchants
=================

]====]

function dismissmerchants ()
  for i = 0, #df.global.world.units.active - 1 do
    if df.global.world.units.active [i].flags1.merchant then
   if df.global.world.units.active [i].flags1.dead and
   not df.global.world.units.active [i].flags1.left then
    dfhack.println ("Dismissing merchant ")
df.global.world.units.active [i].flags1.left = true      
   end
end
  end
end

dismissmerchants ()

Edit2: And I've gotten a new human caravan, so it seems to have worked for me as well.

Edit 3: It seems I'm able to dump the invisible dead merchant goods by marking them for dumping and having the dorf strip the merchants of their stuff. I assume it would be possible to mark the goods and then use the DFHack auto dumping, although I haven't tried. It takes forever to carry all the junk to the dump zone, though.
I used the following script for dump marking:
Code: [Select]
function claimmerchantstuff ()
  for i = 0, #df.global.world.units.all - 1 do
    if df.global.world.units.all [i].flags1.merchant and
   df.global.world.units.all [i].flags1.dead and
   df.global.world.units.all [i].flags3.scuttle then
   dfhack.println ("Scuttling merchant: " ..  tostring (i))
   
   for _, v in ipairs (df.global.world.units.all [i].inventory) do
     if v.mode == 0 then  --  hauled
   v.item.flags.dump = true
end
   end
end
  end 
end

claimmerchantstuff()

Note that this was done a few years after the event, so the merchant ownership flag had decayed. Thus, you might have to wait for it to decay before the dorfs might start to dump stuff, or change the script to reset the merchant ownership flag.
« Last Edit: November 11, 2016, 01:33:11 pm by PatrikLundell »
Logged

Dunamisdeos

  • Bay Watcher
  • Duggin was the hero we needed.
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #58 on: November 16, 2016, 07:27:44 pm »

Hmmmmmm I have not gotten any more caravans from my home city. I'll give it a few more years.
Logged
FACT I: Post note art is best art.
FACT II: Dunamisdeos is a forum-certified wordsmith.
FACT III: "All life begins with Post-it notes and ends with Post-it notes. This is the truth! This is my belief!...At least for now."
FACT IV: SPEECHO THE TRUSTWORM IS YOUR FRIEND or BEHOLD: THE FRUIT ENGINE 3.0

Libash_Thunderhead

  • Bay Watcher
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #59 on: November 25, 2016, 03:59:52 am »

Oh sweet Armok I don't kow how many merchants are stuck outside the map!
The unit list does't show them all.
I have to wait for them to go berserk one by one.

Edit*
Never mind. I hacked some magma over them.
« Last Edit: November 26, 2016, 05:25:01 am by Libash_Thunderhead »
Logged
Pages: 1 2 3 [4] 5 6