From 56e25bfa1292b1adbdd83f65da871659ae176cb5 Mon Sep 17 00:00:00 2001 From: expwnent Date: Tue, 25 Jun 2013 19:06:15 -0400 Subject: [PATCH] Documented invasion-now, moved it from devel scripts, and documented digSmart in readme. --- Readme.rst | 30 ++++++++++++++++++++++++++++++ scripts/devel/invasion-now.lua | 18 ------------------ scripts/invasion-now.lua | 29 +++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 18 deletions(-) delete mode 100644 scripts/devel/invasion-now.lua create mode 100644 scripts/invasion-now.lua diff --git a/Readme.rst b/Readme.rst index fde9fe036..d0050a818 100644 --- a/Readme.rst +++ b/Readme.rst @@ -1026,6 +1026,23 @@ Options: :down: down stairs :clear: clear designation +digSmart +-------- +Automatically digs out specified veins as they are discovered. It runs once every time a dwarf finishes a dig job. It will only dig out appropriate tiles that are adjacent to the finished dig job. To add a vein type, use `digSmart 1 [type]`. This will also enable the plugin. To remove a vein type, use `digSmart 0 [type] 1` to disable, then remove, then re-enable. + +`digSmart 0` disable + +`digSmart 1` enable + +`digSmart 0 MICROCLINE COAL_BITUMINOUS 1` disable plugin, remove microcline and bituminous coal from monitoring, then re-enable the plugin + +`digSmart CLEAR` remove all inorganics from monitoring + +`digSmart digAll1` ignore the monitor list and dig any vein + +`digSmart digAll0` disable digAll mode + +See `help digSmart` for details. filltraffic ----------- @@ -2089,6 +2106,19 @@ To skip a row in your design, use a single ``;``. The script takes the plan filename, starting from the root df folder. +invasion-now +============ + +Triggers an invasion, or several in the near future. + +`invasion-now civName` trigger an invasion from the civilization with the id civName, starting in about ten ticks + +`invasion-now civName start` trigger an invasion from civName in a number of ticks between 10*start and 11*start-1 (inclusive) + +`invasion-now civName start end` trigger an invasion from civName in about 10*start ticks, and continue triggering invasions every ten ticks afterward until about 10*end ticks have passed + +Probably fails if the start time of a triggered invasion is later than the start of the next year. + superdwarf ========== Similar to fastdwarf, per-creature. diff --git a/scripts/devel/invasion-now.lua b/scripts/devel/invasion-now.lua deleted file mode 100644 index a2b29231f..000000000 --- a/scripts/devel/invasion-now.lua +++ /dev/null @@ -1,18 +0,0 @@ --- invasion-now civ_id delay : schedules an invasion in the near future - -args = {...} -num = tonumber(args[1]) - -if ( num ~= nil ) then - time = tonumber(args[2]) or 1 - time2 = tonumber(args[3]) or time - for i = time,time2 do - df.global.timed_events:insert('#',{ - new = df.timed_event, - type = df.timed_event_type.CivAttack, - season = df.global.cur_season, - season_ticks = df.global.cur_season_tick+i, - entity = df.historical_entity.find(num) - }) - end -end diff --git a/scripts/invasion-now.lua b/scripts/invasion-now.lua new file mode 100644 index 000000000..6328120a9 --- /dev/null +++ b/scripts/invasion-now.lua @@ -0,0 +1,29 @@ +-- invasion-now civName start end : schedules an invasion in the near future, or several + +args = {...} +civName = args[1] + +if ( civName ~= nil ) then + --find the civ with that name + evilEntity = nil; + for _,candidate in ipairs(df.global.world.entities.all) do + if candidate.entity_raw.code == civName then + evilEntity = candidate + break + end + end + if ( evilEntity == nil ) then + do return end + end + time = tonumber(args[2]) or 1 + time2 = tonumber(args[3]) or time + for i = time,time2 do + df.global.timed_events:insert('#',{ + new = df.timed_event, + type = df.timed_event_type.CivAttack, + season = df.global.cur_season, + season_ticks = df.global.cur_season_tick+i, + entity = evilEntity + }) + end +end