--'site create' is a long running script that mess with the raid option similar to site explore and site reclaim this one lets the player throw citizens out into the wild and hope they make something.
--this script probably works best as an extreme exile script as you're not getting those citizens back when you use this.
-- probably best to set this up with captains if your coord settings landed the expedition into a ocean or end up too close to your fort which can happen if you have it set under 2 world tiles radius away from the player site
--this also has a world tile counter to see how many world tiles spaces away the coords are. best expand up to 3+ world tiles away and not in an ocean or deep in the mountain for this to work.
local dlg=require("gui.dialogs")
function migrate(C,C2)
local si2=df.global.gview.view.child.child.army_controller
local si=df.global.gview.view.child.child.army_controller[0].site_id
for fo,rm in pairs (si2) do
if rm.goal==2 then
if rm.data.goal_site_invasion.invasion_intent==5 then
local startx=rm.data.goal_site_invasion.source_abs_smm_x
local starty=rm.data.goal_site_invasion.source_abs_smm_y
local startid = df.global.plotinfo.main.fortress_site.id
rm.data.goal_create_new_site.source_abs_smm_x=startx
rm.data.goal_create_new_site.source_abs_smm_y=starty
rm.data.goal_create_new_site.desired_parent_stid=startid
rm.data.goal_create_new_site.flag[0]=false
rm.data.goal_create_new_site.flag[1]=true
rm.data.goal_create_new_site.flag[2]=false
rm.goal=14
rm.flag.site_realized_over_goal=true
rm.flag.done_for_dwarf_mode=true
rm.pos_x=startx+(C*3)
rm.pos_y=starty+(C2*3)
end
end
end
end
function fill(tbl,low,high,title)
for v =low, high do
table.insert (tbl,{title..v.." "..(v/16),nil,v,search_key =v})
end
end
function bob()
local Ark={}
fill(Ark,-160,0,"west")
fill(Ark,0,160,"east")
local f=function(Name,C)
bob2(C[3])
end
dlg.showListPrompt("Chart ","here a list of local numbers around -160= west to 160=east embark tiles on the x axis ",COLOR_WHITE,Ark,f,nil,nil,true)
end
function bob2(Ca)
local Ark2={}
fill(Ark2,-160,0,"north")
fill(Ark2,0,160,"south")
local f=function(Name,C)
migrate(Ca,C[3])
end
dlg.showListPrompt("Chart part 2 ","here a list of local numbers around -160= north to 160=south embark tiles on the y axis ",COLOR_WHITE,Ark2,f,nil,nil,true)
end
bob()
so since last time I re-wrote the script to now show off how many spaces you are world tile wise so counting by 20 wouldn't lead to all those extra 4s adding up to a 16
still uses the explore mission to kick off the site creation switch so best have a world with some places to explore.
edit: it seems my old scripts for site-reclaim and site-explore are using outdated df structures and need to be swap out.
local si2=df.global.gview.view.child.child.army_controller
local si=df.global.gview.view.child.child.army_controller[0].site_id
for fo,rm in pairs (si2) do
if rm.goal==2 then
if rm.data.goal_site_invasion.invasion_intent==5 then
rm.data.goal_site_invasion.invasion_intent=2
end
end
end
local si2=df.global.gview.view.child.child.army_controller
local si=df.global.gview.view.child.child.army_controller[0].site_id
for fo,rm in pairs (si2) do
if rm.goal==2 then
rm.data.goal_site_invasion.invasion_intent=5
end
end