The following script causes the items to become graphically visible (but not viewable) and then get hauled away by your dorfs. It also seems the items get removed from the inventories of the bugged invaders, which is a good sign.
I first looked at the stocks screen to find an item that probably belonged to an invader, zoomed to that location (and noted nothing was visible there, printed the coordinates of that location, and then wrote the script with the hard coded coordinates. The script basically strips all units at that coordinate of their stuff to put them on the ground and dump mark the items.
For some reason the dorfs seem to haul away most of the stuff to stockpiles rather than dumping them, but if the items aren't dump marked some might not be hauled away if there's no stockpile for them.
Obviously, I cannot guarantee there won't be any side effects. I don't fully know what I'm doing... Obviously, the above is the short version, as the script is the end result of investigation and peeking.
function z ()
for i = 0, #df.global.world.units.all - 1 do
if df.global.world.units.all [i].pos.x == 191 and
df.global.world.units.all [i].pos.y == 15 and
df.global.world.units.all [i].pos.z == 172 then
dfhack.print ("Unit: " .. tostring (df.global.world.units.all [i].id) .. " index: " ..tostring (i))
for k, v in ipairs (df.global.world.units.all [i].inventory) do
dfhack.println ("Dumping marking item")
v.item.pos.x = df.global.world.units.all [i].pos.x
v.item.pos.y = df.global.world.units.all [i].pos.y
v.item.pos.z = df.global.world.units.all [i].pos.z
v.item.flags.on_ground = true
v.item.flags.in_inventory = false
v.item.flags.forbid = false
v.item.flags.dump = true
end
end
end
end
z ()