if only we could teleport a unit, imagine the number of hair pulling cases we could solve, legit cases like a stupid dorf that build something the wrong side of a wall. Is it legit? Sure you can say it is part of the fun, but having to fall back to trick like suspending work etc. to make it work the right side seems more to me like fighting the interface, don't you think?
Others examples include your most precious armorsmith that decides to pasture an animal (you can't disable this behavior, any dwarf can do that) and get killed, unless you teleport him back 10 tiles away. Cheating again? No, fixing a miserable loophole in DF.
I can go a long way in how useful teleporting a creature would be. Liaison stuck, etc. But you get the idea. I think this will be a great feature to have that would save tons of hours for many players.
Well warping folks is easy, getting them to not horribly clutter the area with knee high invisible blocks is hard. good thing old dfusion warp isn't that hard to port over.
function tools.warp(unit)
print("Self or at position? (s or anything else):");
local r=getline()
local unit
if r=="s" or r=="S" then
unit=df.global.world.units.other[0][0]
else
if unit==nil then
unit=getCreatureAtPos(getxyz())
end
end
local sx,sy,sz
sx=unit.pos.x
sy=unit.pos.y
sz=unit.pos.z
print("Current coords:"..sx.." "..sy.." "..sz)
print("Jump where (coordinates in form 'dx dy dz' or 'c' for cursor):")
r=getline()
local tx,ty,tz
if r=="c" then
tx,ty,tz=getxyz()
else
lp=string.gmatch(r,"%-?%d+")
--local d
--d=lp()
tx=sx+tonumber(lp())
ty=sy+tonumber(lp())
tz=sz+tonumber(lp())
end
print("Warp to coords:"..tx.." "..ty.." "..tz)
unit.pos.x=tx
unit.pos.y=ty
unit.pos.z=tz
end
tools.menu:add("warp",tools.warp)
edit: here's the codes for a warp, this works both in adventure mode and fort mode, you need to have the pointer on top of the unit you want... and also to make sure the unit not sharing the same tile as someone else.