The ProblemThere's currently
a bug in the game, where you receive the announcement that a trade caravan has arrived, but the merchants never enter the map. Their items appear on the stocks screen, and zooming to their location takes you to the map edge. The merchants themselves don't appear on the Units screen. Once this happens, unless you savescum to a point in time before the arrival of the phantom caravan, you probably never get a caravan from that civilization again, and if it's the dwarves, you also stop getting migrants, since the caravan never leaves your fortress to report back to the mountainhomes.
This is bad.
-----
The SolutionFortunately, there's a way around it. Unfortunately, it's a bit of a pain in the butt. You will need:
- dfhack
- Python, Excel, Bash, or some other utility that lets you automate fiddling around with text
- Some patience
Step 1: Save your game, and back up your saveThis method involves savescumming at least once.
Step 2: Teleport every single unit onto your map at onceWe want to teleport the merchants onto the map, so they can load properly and go home (or be killed, if they've already been bugged for long enough that they go insane). We're going to do this via dfhack's
teleport script, which teleports a unit to wherever your cursor is. The syntax for this script is:
teleport -unit [unit ID #]
Unfortunately, we don't know the unit ID #'s of the merchants we're trying to rescue, and we can't check with teleport's
-showunitid argument, because they're not on the map. So instead we're going to teleport every single unit onto the map at once. There's a dfhack script called
multicmd that lets you run more than one command at once. We want to build a dfhack query that looks like the following:
multicmd teleport -unit 1; teleport -unit 2; teleport -unit 3......; teleport -unit n
...where
n is the highest unit ID # you're teleporting in. In my game,
n=4000 was enough, but I've heard ID's as high as the 13000's reported; it probably depends on how long you've been playing your particular fort and how many units have been generated in thiat time.
Obviously, typing out 4000+ instances of that command is going to be prohibitively tedious, so you're going to need to build this query in some automated way. I did it with the following Python scriptlet:
toPrint = 'multicmd '
for i in range(1,4000): # Change these numbers to choose which ID's to teleport
toPrint += ('teleport -unit '+str(i)+'; ')
print(toPrint)
This prints the query you want to run into the Python terminal; just copy+paste it into the dfhack terminal and you're good to go.
Fleeting Flames, in
my help thread, suggests another solution using Excel:
Python is a great tool, but instead of learning it it is probably faster to use table calculation software such as excel or openoffice to generate 3 columns for "teleport text" <iterated unit id> "teleport text", select all, drag downwards with mouse, then copy all into notepad, run replace to remove the tabs and then save it and then tell dfhack to run it as script at fort startup or key command or what have you.
I'm sure the creative minds of these forums can come up with a few other clever ways to build the query. If doing all the units at once crashes or hangs something, you might have to teleport in batches (i.e., teleport the units from 1-1000 in one query, then the ones from 1001-2000 in the next, and so on). However you manage to do it, at the end of this step, you should have teleported every unit on the map to some easy-to-inspect location.
Note that this step will throw a lot of error messages in dfhack (one for each unit ID # you try to teleport that isn't actually a unit). I just ignored them.
Step 3: Find your merchants' unit ID #'sSo now you've teleported your merchants onto the map. Great, that's what we're trying to do, right? Well, yes, but you've also teleported every single citizen, Forgotten Beast, and Demon into the same spot, so you probably don't want to keep this save. Our goal here is to find our merchants and figure out their unit ID #'s.
First, unpause for a few frames. I found that once you teleported the merchants onto the map, they stayed as invisible phantoms for a few seconds of game time before properly loading in.
Once the merchants load in properly (probably !!on fire!!, bleeding from every orifice, and running from an Orthoclase Fluffy Wambler which Undulates Rhythmically), pause the game again, hover your cursor over the merchants and their pack animals, and query their unit ID #'s in dfhack with the following command:
teleport -showunitid
In my experience, all merchants from the same caravan will have ID's very close to one another (typically all within a range of about 100). You can either record this whole range, or painstakingly record the unit ID # of each individual merchant. I recommend the former.
Step 4: Reload and teleport in only the merchants- Crash out of Dwarf Fortress without saving, and reload your game from before the teleport shenanigans.
- Rebuild your dfhack query so that it only teleports the unit ID #'s (or small-ish range of ID's) that correspond to your phantom merchants.
- Run the command.
- Unpause and wait a few frames.
- Your merchants should appear out of thin air at the location of your cursor.
Step 5: ProfitIn my game, it had been long enough that all of the merchants had gone insane. A couple of them went berserk and my military killed them; the rest succumbed to melancholy and wandered slowly off the map.
However, the very next fall, a new Dwarven caravan, the outpost liaison, and a migrant wave appeared for the first time in several in-game years.
-----
Hope this is helpful to any of you who are stuck dealing with this bug. Extra special thanks to Daris, without whose advice I would never have realized that the merchants could be teleported onto the map.
Let me know if you have any questions about anything in this post and I'll try to clarify.