Bay 12 Games Forum

Please login or register.

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

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

Libash_Thunderhead

  • Bay Watcher
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #60 on: December 04, 2016, 09:22:43 pm »

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

Oh, just noticed dead units are also units. Maybe something like this works better.


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

PatrikLundell

  • Bay Watcher
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #61 on: December 05, 2016, 03:37:07 am »

All of my bugged merchants were marked as dead, so excluding the dead ones could very well result in no units being found at all.
Logged

Hetairos

  • Bay Watcher
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #62 on: February 08, 2017, 03:19:56 pm »

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 ()

Necroing the thread to report the script worked with my fort. One friendly macedwarf appeared on the map's border and promptly left, while "Dismissing merchant" was printed thrice. The spring wave of migrants has arrived, and I'll see if the caravan shows up as well when autumn comes.

I was going to create a magnificent structure for whoever finds or makes a fix for this and saves my fortress, so please let me know what would you like :D

PatrikLundell

  • Bay Watcher
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #63 on: February 08, 2017, 03:27:08 pm »

Glad to hear it helps some people out. There are probably several issues with similar symptoms, though.
I'd like you to create the magnificent structure you'd like to create ;)
Logged

Hetairos

  • Bay Watcher
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #64 on: February 09, 2017, 04:29:38 pm »

I was afraid that would be the answer. Very well then, I'll try to come up with something.

Caravan is confirmed as working too.

PatrikLundell

  • Bay Watcher
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #65 on: February 10, 2017, 05:16:33 am »

Good to hear that things actually seem to work.

If you don't want to come up with something yourself, I've got two silly, one fairly large, and one near trivial projects for you:
1. Conquer the circus and wall it off.
2. Drain the magma sea and build mostly vertical walls (as opposed to the normal inverted pyramids) along the edges.
3. Secure one or all caverns with walls at the edges, optionally with drawbridges to small "compartments" at the edges to let creatures of choice in (in my case I use airlocks with cages and repeating mine cart driven menacing spear traps).
4. Build an image of Urist. I typically do that on top of my recessed courtyard to act as a roof.

AAAAAAAAAA
AABBBBBBAA
ABCCCCCCBA
ABCCCCCCBA
ABCbCCbCBA
ADCCCCCCDA
ADDDDDDDDA
ADDCbbCDDA
ADDDDDDDDA
AADDDDDDAA
AAAADDDAAA
AAAAADDAAA
AAAAAAAAAA


It's hard to distinguish from the description above, but it's the Urist on the home page http://www.bay12games.com/dwarves/. I use whatever materials are at hand (sometimes bringing a suitable stone for the eyes). The letters indicate different materials (primarily to get different colors), where lower case 'b' indicates I sometimes use a different colored material for these (or two than for the main parts).
Logged

Puffin4Tom

  • Escaped Lunatic
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #66 on: March 21, 2017, 05:35:56 pm »

I too would like to jump in here to say that the scripts PatrikLundell posted worked perfectly to fix my bug. I had the same problem where the find merchant unit id script returned three ids that I was unable to teleport or do anything with, but now it has all been fixed. This was an incredibly annoying bug, and to express my gratitude I will be taking you up on your suggestion of a Urist mosaic, to be placed in my new dining room. Many thanks!
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #67 on: May 09, 2017, 06:13:52 pm »

To anyone experiencing this bug: does this script also work?

I'm looking to include at least one of these scripts in DFHack, but I'm not sure if that one alone is enough or if I should also include PatrikLundell's. (The one I linked to should cause the caravans to appear, if it works.)
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.

RocheLimit

  • Bay Watcher
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #68 on: May 10, 2017, 05:33:32 am »

I have made use of both scripts and found that they seem to work for different problems.

Since using dismissmerchants to start my caravans back up, they stopped working again for a few seasons.  I tried running unitretrieval and got nothing but a handful of cavern animals; dismissmerchants, however, once more fixed the problem.

I'd say the biggest difference is the unitretrieval script works on units that failed to enter the map while the dismissmerchants script works on units that failed to leave.

lethosor

  • Bay Watcher
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #69 on: May 10, 2017, 08:33:58 am »

I'd say the biggest difference is the unitretrieval script works on units that failed to enter the map while the dismissmerchants script works on units that failed to leave.
Oh, I thought this thread was about units that failed to enter in the first place, and dismissmerchants was getting rid of those. I'll work on including both scripts, then.
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.

RocheLimit

  • Bay Watcher
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #70 on: May 10, 2017, 10:07:24 am »

Oh, I thought this thread was about units that failed to enter in the first place, and dismissmerchants was getting rid of those. I'll work on including both scripts, then.

You know, looking back at the first post I believe that's how it started.  From the sound of the original issue, I believe unitretrieval would work, as their arrival is announced like my own fort's forgotten beasts were and it retrieves them nicely.  The dismissmerchants script came up later, fixing the issue of caravans that were outright missing with no announcement.

Edit: And, after re-reading the entire thread, I now feel a bit like an idiot speaking as if lethosor hadn't been much more active in this thread than myself and would have a much better grasp of what was tried, what worked, and for what problem.  My apologies, lethosor.
« Last Edit: May 10, 2017, 10:26:37 am by RocheLimit »
Logged

knedl

  • Bay Watcher
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #71 on: May 11, 2017, 11:57:33 am »

To anyone experiencing this bug: does this script also work?

I'm looking to include at least one of these scripts in DFHack, but I'm not sure if that one alone is enough or if I should also include PatrikLundell's. (The one I linked to should cause the caravans to appear, if it works.)

I confirm that this one works. It did bring in the human caravan into the map.
Logged

GenJeFT

  • Bay Watcher
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #72 on: May 14, 2017, 11:41:39 am »

I made a tutorial video to help people run the lua scripts. Granted its recorded by someone who is not brilliant with lua but it works.

https://www.youtube.com/watch?v=VgGuYZg8yBQ&feature=youtu.be
Logged

Snafu

  • Bay Watcher
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #73 on: May 14, 2017, 06:00:08 pm »

FWIW use https://ninite.com/ to keep those handy utils such as Notepad++, 7zip, Imgburn etc up to date (or 1st install) with no cruft: take a look

(I've no association with the above - just a very happy user)
Logged

Symmetry

  • Bay Watcher
    • View Profile
Re: A (kludgey) workaround for the disappearing caravan bug
« Reply #74 on: July 02, 2017, 07:23:19 am »

Necro, but "modtools/force -eventType Caravan -civ player" has worked for me
In my case the wagon insta died due to evil rain and everyone ran off horrified.
Logged
Pages: 1 ... 3 4 [5] 6