okay if I remember warmist made a companion option to allow you to order them to do jobs.
at the time I didn't do much with this due to there was no way to mass order commands.
(like telling one to go dig means you need to chaperone the guy to dig out a tunnel and not like say designate a path and just order him.)
so I didn't do much with this. since r3 is out best drop the code.
function getLastJobLink()
local st=df.global.world.job_list
while st.next~=nil do
st=st.next
end
return st
end
function AddNewJob(job)
local nn=getLastJobLink()
local nl=df.job_list_link:new()
nl.prev=nn
nn.next=nl
nl.item=job
job.list_link=nl
end
function MakeDig(unit,pos,job_type)
local nj=df.job:new()
nj.id=df.global.job_next_id
df.global.job_next_id=df.global.job_next_id+1
nj.flags.special=true
nj.job_type=job_type
nj.completion_timer=-1
nj.unk4a=12
nj.unk4b=0
nj.pos:assign(pos)
nj.general_refs:insert("#",{new=df.general_ref_unit_workerst,unit_id=unit.id})
AddNewJob(nj)
unit.job.current_job=nj
pos.x=pos.x-1
unit.path.dest:assign(pos)
end
{name="channel",f=function(unit_list,pos)
if not CheckCursor(pos) then
return false
end
for k,unit in pairs(unit_list) do
MakeDig(unit,pos,df.job_type.FellTree)
end
return true
end},