function CompN1()
adv=df.global.world.units.active[1]
--for k,v in pairs(df.global.world.units.active) do
--if adv.relations.group_leader_id==adv.id then
local sx,sy,sz
sx=adv.pos.x
sy=adv.pos.y
sz=adv.pos.z
print("Current coords:"..sx.." "..sy.." "..sz)
tx,ty,tz=sx,sy-3,sz
print("Warp to coords:"..tx.." "..ty.." "..tz)
adv.path.dest.x=tx
adv.path.dest.y=(ty)
adv.path.dest.z=tz
adv.old_pos.x=tx
adv.old_pos.y=ty
adv.old_pos.z=tz
--end
--end
end
function CompS1()
adv=df.global.world.units.active[1]
--for k,v in pairs(df.global.world.units.active) do
--if v.relations.group_leader_id==adv.id then
local sx,sy,sz
sx=adv.pos.x
sy=adv.pos.y
sz=adv.pos.z
print("Current coords:"..sx.." "..sy.." "..sz)
tx,ty,tz=sx,sy+3,sz
print("Warp to coords:"..tx.." "..ty.." "..tz)
adv.path.dest.x=tx
adv.path.dest.y=(ty)
adv.path.dest.z=tz
adv.old_pos.x=tx
adv.old_pos.y=ty
adv.old_pos.z=tz
--end
--end
end
function CompE1()
adv=df.global.world.units.active[1]
--for k,v in pairs(df.global.world.units.active) do
--if v.relations.group_leader_id==adv.id then
local sx,sy,sz
sx=adv.pos.x
sy=adv.pos.y
sz=adv.pos.z
print("Current coords:"..sx.." "..sy.." "..sz)
tx,ty,tz=sx+3,sy,sz
print("Warp to coords:"..tx.." "..ty.." "..tz)
adv.path.dest.x=tx
adv.path.dest.y=(ty)
adv.path.dest.z=tz
adv.old_pos.x=tx
adv.old_pos.y=ty
adv.old_pos.z=tz
--end
--end
end
function CompW1()
adv=df.global.world.units.active[1]
--for k,v in pairs(df.global.world.units.active) do
--if v.relations.group_leader_id==adv.id then
local sx,sy,sz
sx=adv.pos.x
sy=adv.pos.y
sz=adv.pos.z
print("Current coords:"..sx.." "..sy.." "..sz)
tx,ty,tz=sx-3,sy,sz
print("Warp to coords:"..tx.." "..ty.." "..tz)
adv.path.dest.x=tx
adv.path.dest.y=(ty)
adv.path.dest.z=tz
adv.old_pos.x=tx
adv.old_pos.y=ty
adv.old_pos.z=tz
--end
--end
end
Here's a rough draft of my 2 player controls
You kinda need to Hotkey them on to make them work but you can totally have you and a bud walk around in adventure mode with this... or walk around in fort mode.
keybinding set Shift-I "dfuse CompN1"
keybinding set Shift-J "dfuse CompW1"
keybinding set Shift-L "dfuse CompE1"
keybinding set Shift-K "dfuse CompS1"
Though each movement takes up of 3 tiles and hitting walls will cause them to path around it.