Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: An invisible army has been stuck on the edge of my map for a year.  (Read 1135 times)

Pyrite

  • Bay Watcher
    • View Profile

So my last siege was really shorthanded. Like a half dozen goblins and a beak dog. That siege didn't go out of effect until the next season, and now there's a bunch of iron and copper armor in my stocks screen that's forbidden (and I can't unforbid it) and when I zoom to any piece of it it takes me to the edge of the map, where nothing is.

I'm running lazy newb pack DF v. 43.03 and I've tried the fix-unit-occupancy command in DFhack, but it says 'no occupancy issues found'

I found this thread,

http://www.bay12forums.com/smf/index.php?topic=159297.0

but it relies on a python script and when I tried to run it in python I got a syntax error: invalid syntax.

Is there a better way to either banish these guys from my stocks screen or pull them onto my map so I can deal with them?
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: An invisible army has been stuck on the edge of my map for a year.
« Reply #1 on: November 13, 2016, 07:42:07 am »

If you look at the last post in the referenced thread (as of this writing), you'll find two lua scripts I've used to deal with the (probably) similar missing merchant issue.
The second script dump mark the AWOL merchant haulers' haul inventory, and my dorfs are occasionally running to the map's edge to strip another item off the invisible merchants (it's slow because my fortress is almost crushed by the burden of dealing with invaders and THEIR stuff time and time again).

Now, you'd need to somehow identify the invaders, which I would guess are marked as dead and appear in the all and bad lists, but not in the active list (that's the case for the merchant haulers anyway). Obviously they're not merchants, and and I assume you'd want to strip them of everything. One way of identifying the invaders would probably be to use their civ id, since you shouldn't have any members of that civ as visitors.
Logged

Pyrite

  • Bay Watcher
    • View Profile
Re: An invisible army has been stuck on the edge of my map for a year.
« Reply #2 on: November 13, 2016, 03:08:07 pm »

One way of identifying the invaders would probably be to use their civ id, since you shouldn't have any members of that civ as visitors.

How do I determine this?
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: An invisible army has been stuck on the edge of my map for a year.
« Reply #3 on: November 14, 2016, 02:25:10 am »

You'd need to peek around with gui/gm-editor in the structures. If you provide the save I can try to see if I can manage to do it (certainly no guarantees, though).
Logged

Pyrite

  • Bay Watcher
    • View Profile
Re: An invisible army has been stuck on the edge of my map for a year.
« Reply #4 on: November 14, 2016, 06:05:42 pm »

Here's the save.

http://dffd.bay12games.com/file.php?id=12565

I've verified that the problem goes away if I retire and unretire the fort, but then I have to deal with all my chests and cabinets uprooting and all my wooden bins and barrels rotting away. I'm looking into this as an alternative solution.

Also, I remembered that I had a couple of trolls from a previous siege still in cages. Wish I'd kept any from that siege, but I didn't. I think they're from the same civ. I released the troll into my target practice range and verified that he's from civ 79.

While I'd love to make the invisible siegers go away or attack, I really don't want to get their equipment for free if they don't attack me.
« Last Edit: November 14, 2016, 06:10:27 pm by Pyrite »
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: An invisible army has been stuck on the edge of my map for a year.
« Reply #5 on: November 15, 2016, 05:05:33 am »

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.

Code: [Select]
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 ()
Logged

Pyrite

  • Bay Watcher
    • View Profile
Re: An invisible army has been stuck on the edge of my map for a year.
« Reply #6 on: November 15, 2016, 01:40:45 pm »

OK, I understand how to find the bugged, invisible creatures now with cprobe at least, but I really don't want to just take their stuff and leave them on the map. Is there any way I can bring the goblins fully into reality so they attack my fortress like normal?
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: An invisible army has been stuck on the edge of my map for a year.
« Reply #7 on: November 15, 2016, 02:55:49 pm »

Not to my knowledge. Both bugged merchants and your siegers are marked as dead. When I tried to "revive" my bugged merchants (by setting the dead flag to false) only the 3 who were on the active list appeared (graphically, but not in any of the units lists), and wouldn't leave (even after I "dismounted" them). None of your invaders are in the active list. Unfortunately, I have no idea how to get rid of them either.
My preference would have been to dismiss the bugged units and have them take their stuff with them.

My guess is that the invaders would probably attack normally if both marked as "not dead" and somehow put back into the active list (and probably withdrawn from the "bad" list). There are a bunch of other flags that may or may not have to be toggled as well.
Logged

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: An invisible army has been stuck on the edge of my map for a year.
« Reply #8 on: November 16, 2016, 06:00:21 am »

    if df.global.world.units.all .pos.x == 191 and
      df.global.world.units.all .pos.y == 15 and
      df.global.world.units.all .pos.z == 172 then
These are the coordinates where it zooms to from stocks screen, correct? How is z determined, current z-level or Nth z-level on map, counting from bottom?

PatrikLundell

  • Bay Watcher
    • View Profile
Re: An invisible army has been stuck on the edge of my map for a year.
« Reply #9 on: November 16, 2016, 07:33:42 am »

    if df.global.world.units.all .pos.x == 191 and
      df.global.world.units.all .pos.y == 15 and
      df.global.world.units.all .pos.z == 172 then
These are the coordinates where it zooms to from stocks screen, correct? How is z determined, current z-level or Nth z-level on map, counting from bottom?
Correct. Zooming to the location and typing "lua showall(df.global.cursor) would give those coordinates.
It's the N:th from the bottommost level of the embark (as far as you can zoom down, which is also the level you cannot designate for digging). The DF arrays/data structures start at 0 (as is the standard for C).
Logged