From 39bcee11d88992d7b627451653b68a77905fc31b Mon Sep 17 00:00:00 2001 From: Japa Date: Sun, 3 Apr 2016 11:09:16 +0530 Subject: [PATCH 1/9] fixed a crash in remotefortressreader.cpp that occured if Armok Vision is connected while saving. --- plugins/remotefortressreader.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/remotefortressreader.cpp b/plugins/remotefortressreader.cpp index 362c28cf3..4116dfd33 100644 --- a/plugins/remotefortressreader.cpp +++ b/plugins/remotefortressreader.cpp @@ -1727,6 +1727,12 @@ static command_result GetWorldMap(color_ostream &stream, const EmptyMessage *in, return CR_FAILURE; } df::world_data * data = df::global::world->world_data; + if (!data->region_map) + { + out->set_world_width(0); + out->set_world_height(0); + return CR_FAILURE; + } int width = data->world_width; int height = data->world_height; out->set_world_width(width); @@ -2057,7 +2063,7 @@ static command_result CopyScreen(color_ostream &stream, const EmptyMessage *in, auto tile = out->add_tiles(); tile->set_character(gps->screen[index]); tile->set_foreground(gps->screen[index + 1] | (gps->screen[index + 3] * 8)); - tile->set_background(gps->screen[index]); + tile->set_background(gps->screen[index + 2]); } return CR_OK; From feff83cedc8c34bd3df2bcbb2ed79737b39cf67c Mon Sep 17 00:00:00 2001 From: PeridexisErrant Date: Tue, 10 Nov 2015 13:20:12 +1100 Subject: [PATCH 2/9] Require a short help string for "ls" The linter change will enforce it for scripts. Plugins always include the line, and length will have to be checked manually. --- docs/Contributing.rst | 5 +++++ travis/script-in-readme.py | 19 ++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/docs/Contributing.rst b/docs/Contributing.rst index 809929df6..d29c4acef 100644 --- a/docs/Contributing.rst +++ b/docs/Contributing.rst @@ -137,6 +137,11 @@ there are a few important standards for completeness and consistent style. Trea this section as a guide rather than iron law, match the surrounding text, and you'll be fine. +Each command should have a short (~54 character) help string, which is shown +by the `ls` command. For scripts, this is a comment on the first line +(the comment marker and whitespace is stripped). For plugins it's the second +argument to ``PluginCommand``. Please make this brief but descriptive! + Everything should be documented! If it's not clear *where* a particular thing should be documented, ask on IRC or in the DFHack thread on Bay12 - as well as getting help, you'll be providing valuable feedback that diff --git a/travis/script-in-readme.py b/travis/script-in-readme.py index b8ad67b65..66ea18605 100644 --- a/travis/script-in-readme.py +++ b/travis/script-in-readme.py @@ -13,12 +13,25 @@ def expected_cmd(path): return fname +def check_ls(fname, line): + """Check length & existence of leading comment for "ls" builtin command.""" + line = line.strip() + comment = '--' if fname.endswith('.lua') else '#' + if line.endswith('=begin') or not line.startswith(comment): + print('Error: no leading comment in ' + fname) + return 1 + if len(line.replace(comment, '').strip()) > 53: + print('Error: leading comment too long in ' + fname) + return 1 + return 0 + + def check_file(fname): errors, doclines = 0, [] with open(fname, errors='ignore') as f: - for l in f.readlines(): - if not l.strip(): - continue + lines = f.readlines() + errors += check_ls(fname, lines[0]) + for l in lines: if doclines or l.strip().endswith('=begin'): doclines.append(l.rstrip()) if l.startswith('=end'): From fc9e2fbff7d70025476f62e6c6af36ff0106dbf2 Mon Sep 17 00:00:00 2001 From: PeridexisErrant Date: Tue, 10 Nov 2015 13:21:00 +1100 Subject: [PATCH 3/9] Shorten wrapped "ls" descriptions in scripts --- scripts/adaptation.rb | 2 +- scripts/armoks-blessing.lua | 8 ++++---- scripts/autofarm.rb | 2 +- scripts/autolabor-artisans.lua | 8 ++++++-- scripts/brainwash.lua | 2 +- scripts/deterioratefood.rb | 2 +- scripts/devel/inject-raws.lua | 4 +++- scripts/devel/inspect-screen.lua | 2 +- scripts/devel/list-filters.lua | 2 +- scripts/devel/nuke-items.lua | 2 +- scripts/devel/prepare-save.lua | 2 +- scripts/devel/scanitemother.rb | 2 +- scripts/devel/spawn-unit-helper.rb | 2 +- scripts/devel/test-perlin.lua | 2 +- scripts/digfort.rb | 2 +- scripts/elevate-mental.lua | 2 +- scripts/elevate-physical.lua | 2 +- scripts/fix/blood-del.lua | 5 ++--- scripts/fix/loyaltycascade.rb | 2 +- scripts/fix/population-cap.lua | 2 +- scripts/gaydar.lua | 3 ++- scripts/growcrops.rb | 2 +- scripts/gui/advfort_items.lua | 2 +- scripts/gui/assign-rack.lua | 3 +-- scripts/gui/choose-weapons.lua | 2 +- scripts/gui/clone-uniform.lua | 2 +- scripts/gui/companion-order.lua | 2 +- scripts/gui/gm-unit.lua | 2 +- scripts/gui/guide-path.lua | 2 +- scripts/hfs-pit.lua | 2 +- scripts/make-legendary.lua | 3 +-- scripts/markdown.lua | 2 +- scripts/migrants-now.lua | 2 +- scripts/region-pops.lua | 2 +- scripts/show-unit-syndromes.rb | 5 ++--- scripts/siren.lua | 2 +- scripts/source.rb | 2 +- scripts/starvingdead.rb | 2 +- scripts/warn-starving.lua | 2 +- 39 files changed, 52 insertions(+), 49 deletions(-) diff --git a/scripts/adaptation.rb b/scripts/adaptation.rb index 6d2e63017..50cf80a86 100644 --- a/scripts/adaptation.rb +++ b/scripts/adaptation.rb @@ -1,4 +1,4 @@ -# View or set level of cavern adaptation for the selected unit or the whole fort +# View or set cavern adaptation levels # based on removebadthoughts.rb =begin diff --git a/scripts/armoks-blessing.lua b/scripts/armoks-blessing.lua index 0ae373c31..dfa99daad 100644 --- a/scripts/armoks-blessing.lua +++ b/scripts/armoks-blessing.lua @@ -1,7 +1,4 @@ --- Adjust all attributes, personality, age and skills of all dwarves in play --- without arguments, all attributes, age & personalities are adjusted --- arguments allow for skills to be adjusted as well --- WARNING: USING THIS SCRIPT WILL ADJUST ALL DWARVES IN PLAY! +-- Adjust all attributes of all dwarves to an ideal -- by vjek --[[=begin @@ -12,6 +9,9 @@ Runs the equivalent of `rejuvenate`, `elevate-physical`, `elevate-mental`, and which sets every stat to an ideal - legendary skills, great traits, and easy-to-satisfy preferences. +Without arguments, all attributes, age & personalities are adjusted. +Arguments allow for skills to be adjusted as well. + =end]] function rejuvenate(unit) if unit==nil then diff --git a/scripts/autofarm.rb b/scripts/autofarm.rb index ddfa7aae9..5dcd34679 100644 --- a/scripts/autofarm.rb +++ b/scripts/autofarm.rb @@ -1,4 +1,4 @@ - +# Select cropt to plant based on current stocks =begin autofarm diff --git a/scripts/autolabor-artisans.lua b/scripts/autolabor-artisans.lua index 68b85817c..8a915243b 100644 --- a/scripts/autolabor-artisans.lua +++ b/scripts/autolabor-artisans.lua @@ -1,10 +1,14 @@ --- Executes an autolabor command for each labor where skill level influences output quality. +-- Run an autolabor command for skill-affected labors. --[[=begin autolabor-artisans ================== -Runs `autolabor`, with settings tuned for small but highly skilled workforces. +Runs an `autolabor` command, for all labors where skill level +influences output quality. Examples:: + + autolabor-artisans 0 2 3 + autolabor-artisans disable =end]] local artisan_labors = { diff --git a/scripts/brainwash.lua b/scripts/brainwash.lua index 1950323a8..b28f648f7 100644 --- a/scripts/brainwash.lua +++ b/scripts/brainwash.lua @@ -1,4 +1,4 @@ --- This script will brainwash a dwarf, modifying their personality +-- Brainwash a dwarf, modifying their personality -- usage is: target a unit in DF, and execute this script in dfhack -- by vjek --[[=begin diff --git a/scripts/deterioratefood.rb b/scripts/deterioratefood.rb index 729a9962f..c59171ea5 100644 --- a/scripts/deterioratefood.rb +++ b/scripts/deterioratefood.rb @@ -1,4 +1,4 @@ -# Make food and plants decay, and vanish after a few months +# Food and plants decay, and vanish after a few months =begin deterioratefood diff --git a/scripts/devel/inject-raws.lua b/scripts/devel/inject-raws.lua index cea69eb61..048d4b560 100644 --- a/scripts/devel/inject-raws.lua +++ b/scripts/devel/inject-raws.lua @@ -1,4 +1,4 @@ --- Injects new reaction, item and building defs into the world. +-- Inject new raw definitions into the world --[[=begin devel/inject-raws @@ -9,6 +9,8 @@ This script attempts to inject new raw objects into your world. If the injected references do not match the actual edited raws, your save will refuse to load, or load but crash. +This script can handle reaction, item and building definitions. + The savegame contains a list of the relevant definition tokens in the right order, but all details are read from raws every time. This allows just adding stub definitions, and simply saving and diff --git a/scripts/devel/inspect-screen.lua b/scripts/devel/inspect-screen.lua index 9de6b2532..8f622756f 100644 --- a/scripts/devel/inspect-screen.lua +++ b/scripts/devel/inspect-screen.lua @@ -1,4 +1,4 @@ --- Read the tiles from the screen and display info about them. +-- Read from the screen and display info about the tiles --[[=begin devel/inspect-screen diff --git a/scripts/devel/list-filters.lua b/scripts/devel/list-filters.lua index 5666315fc..7eb2210a9 100644 --- a/scripts/devel/list-filters.lua +++ b/scripts/devel/list-filters.lua @@ -1,4 +1,4 @@ --- List input items for the building currently being built. +-- List input items for the building being built. --[[=begin devel/list-filters diff --git a/scripts/devel/nuke-items.lua b/scripts/devel/nuke-items.lua index d98901142..6b67f81c8 100644 --- a/scripts/devel/nuke-items.lua +++ b/scripts/devel/nuke-items.lua @@ -1,4 +1,4 @@ --- Deletes ALL items not held by units, buildings or jobs. +-- Delete ALL items not held by units, buildings or jobs --[[=begin devel/nuke-items diff --git a/scripts/devel/prepare-save.lua b/scripts/devel/prepare-save.lua index dd1f81e45..c1e71ef7f 100644 --- a/scripts/devel/prepare-save.lua +++ b/scripts/devel/prepare-save.lua @@ -1,4 +1,4 @@ --- Prepare the current save for use with devel/find-offsets. +-- Prepare the current save for devel/find-offsets --[[=begin devel/prepare-save diff --git a/scripts/devel/scanitemother.rb b/scripts/devel/scanitemother.rb index 1f130603f..1bdf58946 100644 --- a/scripts/devel/scanitemother.rb +++ b/scripts/devel/scanitemother.rb @@ -1,4 +1,4 @@ -# list indices in world.item.other[] where current selected item appears +# list selected item's indices in world.item.other[] =begin devel/scanitemother diff --git a/scripts/devel/spawn-unit-helper.rb b/scripts/devel/spawn-unit-helper.rb index 437eb81db..77dadbcdd 100644 --- a/scripts/devel/spawn-unit-helper.rb +++ b/scripts/devel/spawn-unit-helper.rb @@ -1,4 +1,4 @@ -# setup stuff to allow arena creature spawn after a mode change +# Allow arena creature spawn after a mode change df.world.arena_spawn.race.clear df.world.arena_spawn.caste.clear diff --git a/scripts/devel/test-perlin.lua b/scripts/devel/test-perlin.lua index 3b3a6a11a..ee8edc2ab 100644 --- a/scripts/devel/test-perlin.lua +++ b/scripts/devel/test-perlin.lua @@ -1,4 +1,4 @@ --- Generates an image using multiple octaves of perlin noise. +-- Generates an image using perlin noise --[[=begin devel/test-perlin diff --git a/scripts/digfort.rb b/scripts/digfort.rb index 4ae48671e..d83928172 100644 --- a/scripts/digfort.rb +++ b/scripts/digfort.rb @@ -1,4 +1,4 @@ -# designate an area for digging according to a plan in csv format +# designate an area based on a '.csv' plan =begin digfort diff --git a/scripts/elevate-mental.lua b/scripts/elevate-mental.lua index ed4b6b026..9db61ed79 100644 --- a/scripts/elevate-mental.lua +++ b/scripts/elevate-mental.lua @@ -1,4 +1,4 @@ --- This script will elevate all the mental attributes of a unit +-- Elevate all the mental attributes of a unit -- by vjek --[[=begin diff --git a/scripts/elevate-physical.lua b/scripts/elevate-physical.lua index f425473d1..c210b4ffa 100644 --- a/scripts/elevate-physical.lua +++ b/scripts/elevate-physical.lua @@ -1,4 +1,4 @@ --- This script will elevate all the physical attributes of a unit +-- Elevate all the physical attributes of a unit -- by vjek --[[=begin diff --git a/scripts/fix/blood-del.lua b/scripts/fix/blood-del.lua index 88d7d2756..ba32d4ab9 100644 --- a/scripts/fix/blood-del.lua +++ b/scripts/fix/blood-del.lua @@ -1,6 +1,5 @@ ---makes it so that civs won't come with barrels full of blood, ichor, or goo ---author Urist Da Vinci ---edited by expwnent, scamtank +-- Stop traders bringing blood, ichor, or goo +--author Urist Da Vinci; edited by expwnent, scamtank --[[=begin fix/blood-del diff --git a/scripts/fix/loyaltycascade.rb b/scripts/fix/loyaltycascade.rb index 2cf52dd93..561e8b9e4 100644 --- a/scripts/fix/loyaltycascade.rb +++ b/scripts/fix/loyaltycascade.rb @@ -1,4 +1,4 @@ -# script to fix loyalty cascade, when you order your militia to kill friendly units +# Cancels a 'loyalty cascade' when citizens are killed =begin fix/loyaltycascade diff --git a/scripts/fix/population-cap.lua b/scripts/fix/population-cap.lua index 483941982..1261fb504 100644 --- a/scripts/fix/population-cap.lua +++ b/scripts/fix/population-cap.lua @@ -1,4 +1,4 @@ --- Communicates current population to mountainhomes to avoid cap overshooting. +-- Tells mountainhomes your pop. to avoid overshoot --[[=begin diff --git a/scripts/gaydar.lua b/scripts/gaydar.lua index 2dfa60730..66aec2c12 100644 --- a/scripts/gaydar.lua +++ b/scripts/gaydar.lua @@ -1,4 +1,4 @@ -local utils = require('utils') +-- Shows the sexual orientation of units --[[=begin gaydar @@ -8,6 +8,7 @@ the viability of livestock breeding programs. Use ``gaydar -help`` for informat on available filters for orientation, citizenship, species, etc. =end]] +local utils = require('utils') validArgs = utils.invert({ 'all', diff --git a/scripts/growcrops.rb b/scripts/growcrops.rb index 95bd7a81a..c3c143254 100644 --- a/scripts/growcrops.rb +++ b/scripts/growcrops.rb @@ -1,4 +1,4 @@ -# grow crops in farm plots. ex: growcrops helmet_plump 20 +# Instantly grow crops in farm plots =begin growcrops diff --git a/scripts/gui/advfort_items.lua b/scripts/gui/advfort_items.lua index 3727bf9a4..befb12ef5 100644 --- a/scripts/gui/advfort_items.lua +++ b/scripts/gui/advfort_items.lua @@ -1,4 +1,4 @@ - +--Does something with items in adventure mode jobs --[[=begin gui/advfort_items diff --git a/scripts/gui/assign-rack.lua b/scripts/gui/assign-rack.lua index 3b18aa13e..575c09f94 100644 --- a/scripts/gui/assign-rack.lua +++ b/scripts/gui/assign-rack.lua @@ -1,5 +1,4 @@ --- Assign weapon racks to squads. Requires the weaponrack-unassign patch. - +-- Assign weapon racks to squads (needs binpatch) --[[=begin gui/assign-rack diff --git a/scripts/gui/choose-weapons.lua b/scripts/gui/choose-weapons.lua index f545e1d30..39e5fbf77 100644 --- a/scripts/gui/choose-weapons.lua +++ b/scripts/gui/choose-weapons.lua @@ -1,4 +1,4 @@ --- Rewrite individual choice weapons into specific types. +-- Rewrite individual choice weapons to specific types --[[=begin gui/choose-weapons diff --git a/scripts/gui/clone-uniform.lua b/scripts/gui/clone-uniform.lua index 9893c3869..e6ae2fa8a 100644 --- a/scripts/gui/clone-uniform.lua +++ b/scripts/gui/clone-uniform.lua @@ -1,4 +1,4 @@ --- Clone the current uniform template in the military screen. +-- Clone a uniform template in the military screen --[[=begin gui/clone-uniform diff --git a/scripts/gui/companion-order.lua b/scripts/gui/companion-order.lua index 9d901a4c9..60a141d0f 100644 --- a/scripts/gui/companion-order.lua +++ b/scripts/gui/companion-order.lua @@ -1,4 +1,4 @@ - +-- Issue orders to companions in Adventure mode --[[=begin gui/companion-order diff --git a/scripts/gui/gm-unit.lua b/scripts/gui/gm-unit.lua index e25ebf944..3432882cb 100644 --- a/scripts/gui/gm-unit.lua +++ b/scripts/gui/gm-unit.lua @@ -1,4 +1,4 @@ --- Interface powered (somewhat user friendly) unit editor. +-- Interface powered, user friendly, unit editor --[[=begin diff --git a/scripts/gui/guide-path.lua b/scripts/gui/guide-path.lua index aa77c9dea..be90ffb1c 100644 --- a/scripts/gui/guide-path.lua +++ b/scripts/gui/guide-path.lua @@ -1,4 +1,4 @@ --- Show and manipulate the path used by Guide Cart orders. +-- Show/change the path used by Guide Cart orders --[[=begin gui/guide-path diff --git a/scripts/hfs-pit.lua b/scripts/hfs-pit.lua index c335ae2be..7fc571090 100644 --- a/scripts/hfs-pit.lua +++ b/scripts/hfs-pit.lua @@ -1,4 +1,4 @@ --- Creates a pit under the target leading straight to the Underworld. Type '?' for help. +-- Creates a pit to the Underworld under the target -- Based on script by IndigoFenix, @ https://gist.github.com/IndigoFenix/8776696 --[[=begin diff --git a/scripts/make-legendary.lua b/scripts/make-legendary.lua index 6dfc78277..da29cd4c2 100644 --- a/scripts/make-legendary.lua +++ b/scripts/make-legendary.lua @@ -1,5 +1,4 @@ --- This script will modify a skill or the skills of a single unit --- the skill will be increased to 20 (Legendary +5) +-- Make a skill or skills of a unit Legendary +5 -- by vjek --[[=begin diff --git a/scripts/markdown.lua b/scripts/markdown.lua index 8cd225573..14ecdaa2c 100644 --- a/scripts/markdown.lua +++ b/scripts/markdown.lua @@ -1,4 +1,4 @@ --- Save a copy of a text screen in markdown (for reddit among others). Use 'markdown help' for more details. +-- Save a text screen in markdown (eg for reddit) -- This is a derivatiwe work based upon scripts/forum-dwarves.lua by Caldfir and expwnent -- Adapted for markdown by Mchl https://github.com/Mchl --[[=begin diff --git a/scripts/migrants-now.lua b/scripts/migrants-now.lua index b38e38115..aa9ad7b3f 100644 --- a/scripts/migrants-now.lua +++ b/scripts/migrants-now.lua @@ -1,4 +1,4 @@ --- Force a migrant wave (only works after hardcoded waves) +-- Force a migrant wave (only after hardcoded waves) --[[=begin migrants-now diff --git a/scripts/region-pops.lua b/scripts/region-pops.lua index af4d36bde..935cd0f02 100644 --- a/scripts/region-pops.lua +++ b/scripts/region-pops.lua @@ -1,4 +1,4 @@ --- Shows populations of animals in the region, and allows tweaking them. +-- Show or edit regional plant and animal populations --[[=begin region-pops diff --git a/scripts/show-unit-syndromes.rb b/scripts/show-unit-syndromes.rb index 70e72cba7..112b33474 100644 --- a/scripts/show-unit-syndromes.rb +++ b/scripts/show-unit-syndromes.rb @@ -1,6 +1,5 @@ -# Show syndromes affecting units and the remaining and maximum duration -# original author: drayath -# edited by expwnent +# Show syndromes affecting units, including duration +# original author: drayath, edited by expwnent =begin show-unit-syndromes diff --git a/scripts/siren.lua b/scripts/siren.lua index 053290a1c..5bf821141 100644 --- a/scripts/siren.lua +++ b/scripts/siren.lua @@ -1,4 +1,4 @@ --- Wakes up the sleeping, breaks up parties and stops breaks. +-- Wakes up the sleeping, ends breaks and parties --[[=begin siren diff --git a/scripts/source.rb b/scripts/source.rb index 92f1a47a6..e9d7a64f3 100644 --- a/scripts/source.rb +++ b/scripts/source.rb @@ -1,4 +1,4 @@ -# create an infinite magma/water source/drain at the cursor +# create an infinite source/drain of magma/water =begin source diff --git a/scripts/starvingdead.rb b/scripts/starvingdead.rb index 2e9e8f4a8..7ee985a7b 100644 --- a/scripts/starvingdead.rb +++ b/scripts/starvingdead.rb @@ -1,4 +1,4 @@ -# Make undead units weaken after one month, and vanish after six +# Weaken and eventually destroy undead over time =begin starvingdead diff --git a/scripts/warn-starving.lua b/scripts/warn-starving.lua index abf95f9ec..12334bf99 100644 --- a/scripts/warn-starving.lua +++ b/scripts/warn-starving.lua @@ -1,4 +1,4 @@ --- Pauses the game with a warning if a creature is starving, dehydrated, or very drowsy. +-- Pause and warn if a unit is starving -- By Meneth32, PeridexisErrant, Lethosor --@ module = true --[[=begin From 403e9f60b2b2bd31333c2d2bc149d69d859aebc7 Mon Sep 17 00:00:00 2001 From: PeridexisErrant Date: Tue, 10 Nov 2015 13:52:20 +1100 Subject: [PATCH 4/9] More informative "ls" messages Because printing the name of the script doesn't help; it's already on the left! --- scripts/devel/all-bob.lua | 2 +- scripts/forum-dwarves.lua | 6 ++---- scripts/full-heal.lua | 2 +- scripts/modtools/add-syndrome.lua | 2 +- scripts/modtools/anonymous-script.lua | 3 +-- scripts/modtools/create-item.lua | 3 +-- scripts/modtools/create-unit.lua | 2 +- scripts/modtools/equip-item.lua | 1 - scripts/modtools/force.lua | 3 +-- scripts/modtools/interaction-trigger.lua | 3 +-- scripts/modtools/invader-item-destroyer.lua | 3 +-- scripts/modtools/item-trigger.lua | 2 +- scripts/modtools/moddable-gods.lua | 2 +- scripts/modtools/outside-only.lua | 3 +-- scripts/modtools/projectile-trigger.lua | 2 +- scripts/modtools/random-trigger.lua | 3 +-- scripts/modtools/reaction-product-trigger.lua | 3 +-- scripts/modtools/reaction-trigger-transition.lua | 2 +- scripts/modtools/reaction-trigger.lua | 4 ++-- scripts/modtools/skill-change.lua | 2 +- scripts/modtools/spawn-flow.lua | 3 +-- scripts/modtools/syndrome-trigger.lua | 3 +-- scripts/modtools/transform-unit.lua | 2 +- scripts/points.lua | 2 +- scripts/remove-wear.lua | 4 +--- scripts/repeat.lua | 4 ++-- scripts/teleport.lua | 1 - 27 files changed, 28 insertions(+), 44 deletions(-) diff --git a/scripts/devel/all-bob.lua b/scripts/devel/all-bob.lua index 08ab19fbb..163f708dd 100644 --- a/scripts/devel/all-bob.lua +++ b/scripts/devel/all-bob.lua @@ -1,4 +1,4 @@ ---all-bob.lua +-- Changes the first name of all units to "Bob" --author expwnent -- --[[=begin diff --git a/scripts/forum-dwarves.lua b/scripts/forum-dwarves.lua index 23402dd6f..e6b98395a 100644 --- a/scripts/forum-dwarves.lua +++ b/scripts/forum-dwarves.lua @@ -1,7 +1,5 @@ --- scripts/forum-dwarves.lua --- Save a copy of a text screen for the DF forums. Use 'forumdwarves help' for more details. --- original author: Caldfir --- edited by expwnent, Mchl +-- Save a copy of a text screen for the DF forums +-- original author: Caldfir; edited by expwnent, Mchl --[[=begin forum-dwarves diff --git a/scripts/full-heal.lua b/scripts/full-heal.lua index 4759e3e9c..f9388058c 100644 --- a/scripts/full-heal.lua +++ b/scripts/full-heal.lua @@ -1,4 +1,4 @@ ---full-heal.lua +-- Attempts to fully heal the selected unit --author Kurik Amudnil, Urist DaVinci --edited by expwnent diff --git a/scripts/modtools/add-syndrome.lua b/scripts/modtools/add-syndrome.lua index 4c04b05bd..2de2462b1 100644 --- a/scripts/modtools/add-syndrome.lua +++ b/scripts/modtools/add-syndrome.lua @@ -1,4 +1,4 @@ ---modtools/add-syndrome.lua +-- Add or remove syndromes from units --author expwnent --[[=begin diff --git a/scripts/modtools/anonymous-script.lua b/scripts/modtools/anonymous-script.lua index 3aecb918c..73eaefb92 100644 --- a/scripts/modtools/anonymous-script.lua +++ b/scripts/modtools/anonymous-script.lua @@ -1,6 +1,5 @@ ---scripts/modtools/anonymous-script.lua +-- invoke simple lua scripts from strings --author expwnent ---a tool for invoking simple lua scripts without putting them in a file first --[[=begin modtools/anonymous-script diff --git a/scripts/modtools/create-item.lua b/scripts/modtools/create-item.lua index 92d8e25a7..0e4149222 100644 --- a/scripts/modtools/create-item.lua +++ b/scripts/modtools/create-item.lua @@ -1,6 +1,5 @@ ---scripts/modtools/create-item.lua +-- creates an item of a given type and material --author expwnent ---creates an item of a given type and material --[[=begin modtools/create-item diff --git a/scripts/modtools/create-unit.lua b/scripts/modtools/create-unit.lua index 30018a19b..9505ec739 100644 --- a/scripts/modtools/create-unit.lua +++ b/scripts/modtools/create-unit.lua @@ -1,4 +1,4 @@ --- create-unit.lua +-- Creates a unit. Beta; use at own risk. -- Originally created by warmist, edited by Putnam for the dragon ball mod to be used in reactions, modified by Dirst for use in The Earth Strikes Back mod, incorporating fixes discovered by Boltgun then Mifiki wrote the bit where it switches to arena mode briefly to do some of the messy work, then Expwnent combined that with the old script to make it function for histfigs -- version 0.51 -- This is a beta version. Use at your own risk. diff --git a/scripts/modtools/equip-item.lua b/scripts/modtools/equip-item.lua index 359d983d6..bf17fc127 100644 --- a/scripts/modtools/equip-item.lua +++ b/scripts/modtools/equip-item.lua @@ -1,4 +1,3 @@ --- modtools/equip-item.lua -- equip an item on a unit with a particular body part --[[=begin diff --git a/scripts/modtools/force.lua b/scripts/modtools/force.lua index a1f4ed9d7..3b25b0895 100644 --- a/scripts/modtools/force.lua +++ b/scripts/modtools/force.lua @@ -1,7 +1,6 @@ --- scripts/modtools/force.lua +-- Forces an event (caravan, migrants, etc) -- author Putnam -- edited by expwnent --- Forces an event. --[[=begin modtools/force diff --git a/scripts/modtools/interaction-trigger.lua b/scripts/modtools/interaction-trigger.lua index bf3a1c4f7..e611a27fe 100644 --- a/scripts/modtools/interaction-trigger.lua +++ b/scripts/modtools/interaction-trigger.lua @@ -1,6 +1,5 @@ ---scripts/modtools/interaction-trigger.lua +-- triggers scripts based on unit interactions --author expwnent ---triggers scripts when a unit does a unit interaction on another --[[=begin modtools/interaction-trigger diff --git a/scripts/modtools/invader-item-destroyer.lua b/scripts/modtools/invader-item-destroyer.lua index 425d910e2..9b06c944e 100644 --- a/scripts/modtools/invader-item-destroyer.lua +++ b/scripts/modtools/invader-item-destroyer.lua @@ -1,6 +1,5 @@ ---scripts/modtools/invader-item-destroyer.lua +-- delete invader items when they die --author expwnent ---configurably deletes invader items when they die --[[=begin modtools/invader-item-destroyer diff --git a/scripts/modtools/item-trigger.lua b/scripts/modtools/item-trigger.lua index 78c8a4332..7a3f84bf0 100644 --- a/scripts/modtools/item-trigger.lua +++ b/scripts/modtools/item-trigger.lua @@ -1,4 +1,4 @@ ---scripts/modtools/attack-trigger.lua +-- trigger commands based on attacks with certain items --author expwnent --based on itemsyndrome by Putnam --triggers scripts when a unit attacks another with a weapon type, a weapon of a particular material, or a weapon contaminated with a particular material, or when a unit equips/unequips a particular item type, an item of a particular material, or an item contaminated with a particular material diff --git a/scripts/modtools/moddable-gods.lua b/scripts/modtools/moddable-gods.lua index c044d6c0a..9445af7a9 100644 --- a/scripts/modtools/moddable-gods.lua +++ b/scripts/modtools/moddable-gods.lua @@ -1,4 +1,4 @@ ---scripts/modtools/moddable-gods.lua +-- Create gods from the command-line --based on moddableGods by Putnam --edited by expwnent --[[=begin diff --git a/scripts/modtools/outside-only.lua b/scripts/modtools/outside-only.lua index 9572f8932..f4ed1414f 100644 --- a/scripts/modtools/outside-only.lua +++ b/scripts/modtools/outside-only.lua @@ -1,6 +1,5 @@ ---scripts/modtools/outsideOnly.lua +-- enables outside only and inside only buildings --author expwnent ---enables outside only and inside only buildings --[[=begin modtools/outside-only diff --git a/scripts/modtools/projectile-trigger.lua b/scripts/modtools/projectile-trigger.lua index c20e8231f..8e6227e0a 100644 --- a/scripts/modtools/projectile-trigger.lua +++ b/scripts/modtools/projectile-trigger.lua @@ -1,4 +1,4 @@ ---scripts/modtools/projectile-trigger.lua +-- trigger commands when projectiles hit targets --author expwnent --based on Putnam's projectileExpansion --TODO: trigger based on contaminants diff --git a/scripts/modtools/random-trigger.lua b/scripts/modtools/random-trigger.lua index a762d2dc4..b234b85ef 100644 --- a/scripts/modtools/random-trigger.lua +++ b/scripts/modtools/random-trigger.lua @@ -1,5 +1,4 @@ ---scripts/modtools/random-trigger.lua ---triggers random scripts +-- triggers random scripts --[[=begin modtools/random-trigger diff --git a/scripts/modtools/reaction-product-trigger.lua b/scripts/modtools/reaction-product-trigger.lua index 7f423e020..69688ce2c 100644 --- a/scripts/modtools/reaction-product-trigger.lua +++ b/scripts/modtools/reaction-product-trigger.lua @@ -1,6 +1,5 @@ --- scripts/modtools/reaction-product-trigger.lua +-- trigger commands before/after reactions produce items -- author expwnent --- trigger commands just before and after custom reactions produce items --@ module = true --[[=begin diff --git a/scripts/modtools/reaction-trigger-transition.lua b/scripts/modtools/reaction-trigger-transition.lua index 42f75f461..3d0b7ee65 100644 --- a/scripts/modtools/reaction-trigger-transition.lua +++ b/scripts/modtools/reaction-trigger-transition.lua @@ -1,4 +1,4 @@ --- scripts/modtools/reaction-trigger-transition.lua +-- help transition from autoSyndrome -- author expwnent --[[=begin diff --git a/scripts/modtools/reaction-trigger.lua b/scripts/modtools/reaction-trigger.lua index ef20fa2e0..9589a9c4c 100644 --- a/scripts/modtools/reaction-trigger.lua +++ b/scripts/modtools/reaction-trigger.lua @@ -1,6 +1,6 @@ --- scripts/modtools/reaction-trigger.lua +-- trigger commands when custom reactions complete -- author expwnent --- replaces autoSyndrome: trigger commands when custom reactions are completed +-- replaces autoSyndrome --@ module = true --[[=begin diff --git a/scripts/modtools/skill-change.lua b/scripts/modtools/skill-change.lua index 55670fc90..c5cd52889 100644 --- a/scripts/modtools/skill-change.lua +++ b/scripts/modtools/skill-change.lua @@ -1,4 +1,4 @@ ---scripts/modtools/skill-change.lua +-- Sets or modifies a skill of a unit --author expwnent --based on skillChange.lua by Putnam --TODO: update skill level once experience increases/decreases diff --git a/scripts/modtools/spawn-flow.lua b/scripts/modtools/spawn-flow.lua index 594c3d917..6bca9ace4 100644 --- a/scripts/modtools/spawn-flow.lua +++ b/scripts/modtools/spawn-flow.lua @@ -1,6 +1,5 @@ ---scripts/modtools/spawn-flow.lua +-- spawns flows at locations --author expwnent ---spawns flows at locations --[[=begin modtools/spawn-flow diff --git a/scripts/modtools/syndrome-trigger.lua b/scripts/modtools/syndrome-trigger.lua index b03ad5783..f46bbc5ad 100644 --- a/scripts/modtools/syndrome-trigger.lua +++ b/scripts/modtools/syndrome-trigger.lua @@ -1,6 +1,5 @@ ---scripts/modtools/syndrome-trigger.lua +-- triggers scripts when a syndrome is applied --author expwnent ---triggers scripts when units are infected with syndromes --[[=begin modtools/syndrome-trigger diff --git a/scripts/modtools/transform-unit.lua b/scripts/modtools/transform-unit.lua index c1cda390b..2ebdc3c8a 100644 --- a/scripts/modtools/transform-unit.lua +++ b/scripts/modtools/transform-unit.lua @@ -1,4 +1,4 @@ ---scripts/modtools/transform-unit.lua +-- Transforms a unit into another unit type --author expwnent --based on shapechange by Putnam --[[=begin diff --git a/scripts/points.lua b/scripts/points.lua index 1c3c2a99d..b81d4637b 100644 --- a/scripts/points.lua +++ b/scripts/points.lua @@ -1,4 +1,4 @@ --- by Meph +-- Set available points at the embark screen -- http://www.bay12forums.com/smf/index.php?topic=135506.msg4925005#msg4925005 --[[=begin diff --git a/scripts/remove-wear.lua b/scripts/remove-wear.lua index 5e905e39f..e1ed3989a 100644 --- a/scripts/remove-wear.lua +++ b/scripts/remove-wear.lua @@ -1,7 +1,5 @@ --- scripts/remove-wear.lua -- Resets all items in your fort to 0 wear --- original author: Laggy --- edited by expwnent +-- original author: Laggy, edited by expwnent --[[=begin remove-wear diff --git a/scripts/repeat.lua b/scripts/repeat.lua index 2dd84c012..b048584d8 100644 --- a/scripts/repeat.lua +++ b/scripts/repeat.lua @@ -1,5 +1,5 @@ --- scripts/repeat.lua --- repeatedly calls a lua script, eg "repeat -time 1 months -command cleanowned"; to disable "repeat -cancel cleanowned" +-- repeatedly call a lua script +-- eg "repeat -time 1 months -command cleanowned"; to disable "repeat -cancel cleanowned" -- repeat -help for details -- author expwnent -- vaguely based on a script by Putnam diff --git a/scripts/teleport.lua b/scripts/teleport.lua index 2efc0cbe4..8c657061c 100644 --- a/scripts/teleport.lua +++ b/scripts/teleport.lua @@ -1,4 +1,3 @@ --- teleport.lua -- teleports a unit to a location -- author Putnam -- edited by expwnent From 273c22f606f7054ab5321a84c17e669448e48a68 Mon Sep 17 00:00:00 2001 From: PeridexisErrant Date: Tue, 10 Nov 2015 14:37:45 +1100 Subject: [PATCH 5/9] Shorten "ls" help for plugins I think that's all of them. --- docs/Plugins.rst | 2 +- plugins/autochop.cpp | 2 +- plugins/automelt.cpp | 2 +- plugins/cleaners.cpp | 2 +- plugins/cursecheck.cpp | 2 +- plugins/deramp.cpp | 2 +- plugins/devel/kittens.cpp | 2 +- plugins/devel/memview.cpp | 2 +- plugins/devel/rprobe.cpp | 2 +- plugins/dig.cpp | 4 ++-- plugins/fastdwarf.cpp | 2 +- plugins/filltraffic.cpp | 2 +- plugins/follow.cpp | 2 +- plugins/forceequip.cpp | 2 +- plugins/fortplan.cpp | 2 +- plugins/getplants.cpp | 2 +- plugins/hotkeys.cpp | 2 +- plugins/infiniteSky.cpp | 2 +- plugins/lair.cpp | 2 +- plugins/petcapRemover.cpp | 2 +- plugins/resume.cpp | 2 +- plugins/reveal.cpp | 8 ++++---- plugins/ruby/ruby.cpp | 2 +- plugins/seedwatch.cpp | 2 +- plugins/stockflow.cpp | 2 +- plugins/stockpiles/stockpiles.cpp | 2 +- plugins/strangemood.cpp | 2 +- plugins/tiletypes.cpp | 6 +++--- plugins/workNow.cpp | 2 +- 29 files changed, 35 insertions(+), 35 deletions(-) diff --git a/docs/Plugins.rst b/docs/Plugins.rst index 89a6cc5f8..9b86e98be 100644 --- a/docs/Plugins.rst +++ b/docs/Plugins.rst @@ -157,7 +157,7 @@ Usage and related commands: :reveal: Reveal the whole map, except for HFS to avoid demons spawning :reveal hell: Also show hell, but requires ``unreveal`` before unpausing -:reveal demons: Reveals everything and allows unpausing - good luck! +:reveal demon: Reveals everything and allows unpausing - good luck! :unreveal: Reverts the effects of ``reveal`` :revtoggle: Switches between ``reveal`` and ``unreveal`` :revflood: Hide everything, then reveal tiles with a path to the cursor diff --git a/plugins/autochop.cpp b/plugins/autochop.cpp index 1d972c588..73a3da24e 100644 --- a/plugins/autochop.cpp +++ b/plugins/autochop.cpp @@ -791,7 +791,7 @@ DFhackCExport command_result plugin_enable(color_ostream &out, bool enable) DFhackCExport command_result plugin_init ( color_ostream &out, vector &commands) { commands.push_back(PluginCommand( - "autochop", "Allows automatic harvesting of trees based on the number of stockpiled logs", + "autochop", "Auto-harvest trees when low on stockpiled logs", df_autochop, false, "Opens the automated chopping control screen. Specify 'debug' to forcibly save settings.\n" )); diff --git a/plugins/automelt.cpp b/plugins/automelt.cpp index 0aacce233..b4c93e15f 100644 --- a/plugins/automelt.cpp +++ b/plugins/automelt.cpp @@ -299,7 +299,7 @@ DFhackCExport command_result plugin_init ( color_ostream &out, std::vector & parameters) DFhackCExport command_result plugin_init ( color_ostream &out, std::vector &commands) { commands.push_back(PluginCommand( - "clean","Removes contaminants from map tiles, items and creatures.", + "clean","Remove contaminants from tiles, items and creatures.", clean, false, " Removes contaminants from map tiles, items and creatures.\n" "Options:\n" diff --git a/plugins/cursecheck.cpp b/plugins/cursecheck.cpp index e33c85855..82404b288 100644 --- a/plugins/cursecheck.cpp +++ b/plugins/cursecheck.cpp @@ -58,7 +58,7 @@ command_result cursecheck (color_ostream &out, vector & parameters); DFhackCExport command_result plugin_init ( color_ostream &out, std::vector &commands) { commands.push_back(PluginCommand("cursecheck", - "Checks for cursed creatures (vampires, necromancers, zombies, ...).", + "Check for cursed creatures (undead, necromancers...)", cursecheck, false )); return CR_OK; } diff --git a/plugins/deramp.cpp b/plugins/deramp.cpp index dc2651db7..f0171dabc 100644 --- a/plugins/deramp.cpp +++ b/plugins/deramp.cpp @@ -83,7 +83,7 @@ command_result df_deramp (color_ostream &out, vector & parameters) DFhackCExport command_result plugin_init ( color_ostream &out, std::vector &commands) { commands.push_back(PluginCommand( - "deramp", "De-ramp. All ramps marked for removal are replaced with floors.", + "deramp", "Replace all ramps marked for removal with floors.", df_deramp, false, " If there are any ramps designated for removal, they will be instantly\n" " removed. Any ramps that don't have their counterpart will also be removed\n" diff --git a/plugins/devel/kittens.cpp b/plugins/devel/kittens.cpp index fd4ec268d..6317a0a39 100644 --- a/plugins/devel/kittens.cpp +++ b/plugins/devel/kittens.cpp @@ -42,7 +42,7 @@ DFHACK_PLUGIN("kittens"); DFhackCExport command_result plugin_init ( color_ostream &out, std::vector &commands) { commands.push_back(PluginCommand("nyan","NYAN CAT INVASION!",kittens)); - commands.push_back(PluginCommand("ktimer","Measure time between game updates and console lag (toggle).",ktimer)); + commands.push_back(PluginCommand("ktimer","Measure time between game updates and console lag.",ktimer)); commands.push_back(PluginCommand("trackmenu","Track menu ID changes (toggle).",trackmenu)); commands.push_back(PluginCommand("trackpos","Track mouse and designation coords (toggle).",trackpos)); commands.push_back(PluginCommand("trackstate","Track world and map state (toggle).",trackstate)); diff --git a/plugins/devel/memview.cpp b/plugins/devel/memview.cpp index d61775a38..910762029 100644 --- a/plugins/devel/memview.cpp +++ b/plugins/devel/memview.cpp @@ -36,7 +36,7 @@ DFHACK_PLUGIN("memview"); DFhackCExport command_result plugin_init (color_ostream &out, std::vector &commands) { - commands.push_back(PluginCommand("memview","Shows memory in real time. Params: adrr length refresh_rate. If addr==0 then stop viewing",memview)); + commands.push_back(PluginCommand("memview","Shows DF memory in real time.",memview)); memdata.state=STATE_OFF; mymutex=new tthread::mutex; return CR_OK; diff --git a/plugins/devel/rprobe.cpp b/plugins/devel/rprobe.cpp index f20222d8a..71da40600 100644 --- a/plugins/devel/rprobe.cpp +++ b/plugins/devel/rprobe.cpp @@ -45,7 +45,7 @@ DFHACK_PLUGIN("rprobe"); DFhackCExport command_result plugin_init ( color_ostream &out, std::vector &commands) { commands.push_back(PluginCommand( - "rprobe", "Display assorted region information from embark screen", + "rprobe", "Display region information from embark screen", rprobe, false, "Display assorted region information from embark screen\n" )); diff --git a/plugins/dig.cpp b/plugins/dig.cpp index 0d49535ad..5404f2f2d 100644 --- a/plugins/dig.cpp +++ b/plugins/dig.cpp @@ -55,8 +55,8 @@ DFhackCExport command_result plugin_init ( color_ostream &out, std::vector &commands) { commands.push_back(PluginCommand("fastdwarf", - "enable/disable fastdwarf and teledwarf (parameters=0/1)", + "let dwarves teleport and/or finish jobs instantly", fastdwarf, false, "fastdwarf: make dwarves faster.\n" "Usage:\n" diff --git a/plugins/filltraffic.cpp b/plugins/filltraffic.cpp index d78e07046..0f9a7bb6f 100644 --- a/plugins/filltraffic.cpp +++ b/plugins/filltraffic.cpp @@ -44,7 +44,7 @@ DFHACK_PLUGIN("filltraffic"); DFhackCExport command_result plugin_init ( color_ostream &out, std::vector &commands) { commands.push_back(PluginCommand( - "filltraffic","Flood-fill with selected traffic designation from cursor", + "filltraffic","Flood-fill selected traffic designation from cursor", filltraffic, Gui::cursor_hotkey, " Flood-fill selected traffic type from the cursor.\n" "Traffic Type Codes:\n" diff --git a/plugins/follow.cpp b/plugins/follow.cpp index 323b0a498..7b8ad3906 100644 --- a/plugins/follow.cpp +++ b/plugins/follow.cpp @@ -29,7 +29,7 @@ uint8_t prevMenuWidth; DFhackCExport command_result plugin_init ( color_ostream &out, std::vector &commands) { commands.push_back(PluginCommand( - "follow", "Follow the selected unit until camera control is released", + "follow", "Make the screen follow the selected unit", follow, Gui::view_unit_hotkey, " Select a unit and run this plugin to make the camera follow it.\n" " Moving the camera yourself deactivates the plugin.\n" diff --git a/plugins/forceequip.cpp b/plugins/forceequip.cpp index 1f1eb1ce6..da6f1aff4 100644 --- a/plugins/forceequip.cpp +++ b/plugins/forceequip.cpp @@ -216,7 +216,7 @@ const string forceequip_help = DFhackCExport command_result plugin_init ( color_ostream &out, vector &commands) { commands.push_back(PluginCommand( - "forceequip", "Moves local items from the ground into a unit's inventory", + "forceequip", "Move items from the ground into a unit's inventory", df_forceequip, false, forceequip_help.c_str() )); diff --git a/plugins/fortplan.cpp b/plugins/fortplan.cpp index 4187f2d0a..a1934c4ab 100644 --- a/plugins/fortplan.cpp +++ b/plugins/fortplan.cpp @@ -51,7 +51,7 @@ public: std::vector buildings; DFhackCExport command_result plugin_init ( color_ostream &out, vector &commands) { - commands.push_back(PluginCommand("fortplan","Lay out buildings in your fortress based on a Quickfort-style CSV input file.",fortplan,false, + commands.push_back(PluginCommand("fortplan","Lay out buildings from a Quickfort-style CSV file.",fortplan,false, "Lay out buildings in your fortress based on a Quickfort-style CSV input file.\n" "Usage: fortplan [filename]\n")); diff --git a/plugins/getplants.cpp b/plugins/getplants.cpp index ed3272265..87fc35960 100644 --- a/plugins/getplants.cpp +++ b/plugins/getplants.cpp @@ -152,7 +152,7 @@ command_result df_getplants (color_ostream &out, vector & parameters) DFhackCExport command_result plugin_init ( color_ostream &out, vector &commands) { commands.push_back(PluginCommand( - "getplants", "Cut down all of the specified trees or gather specified shrubs", + "getplants", "Cut down trees or gather shrubs by ID", df_getplants, false, " Specify the types of trees to cut down and/or shrubs to gather by their\n" " plant IDs, separated by spaces.\n" diff --git a/plugins/hotkeys.cpp b/plugins/hotkeys.cpp index d7139dd96..6ec281143 100644 --- a/plugins/hotkeys.cpp +++ b/plugins/hotkeys.cpp @@ -354,7 +354,7 @@ DFhackCExport command_result plugin_init ( color_ostream &out, std::vector & params) DFhackCExport command_result plugin_init ( color_ostream &out, std::vector &commands) { - commands.push_back(PluginCommand("lair","Mark the map as a monster lair, preventing item scatter.",lair, false, + commands.push_back(PluginCommand("lair","Mark the map as a monster lair (avoids item scatter)",lair, false, "Usage: 'lair' to mark entire map as monster lair, 'lair reset' to undo the operation.\n")); return CR_OK; } diff --git a/plugins/petcapRemover.cpp b/plugins/petcapRemover.cpp index ee33f6670..c059db4c3 100644 --- a/plugins/petcapRemover.cpp +++ b/plugins/petcapRemover.cpp @@ -36,7 +36,7 @@ DFhackCExport command_result plugin_init ( color_ostream &out, std::vector & params); DFhackCExport command_result plugin_init ( color_ostream &out, vector &commands) { - commands.push_back(PluginCommand("reveal","Reveal the map. 'reveal hell' will also reveal hell. 'reveal demon' won't pause.",reveal,false, + commands.push_back(PluginCommand("reveal","Reveal the map. Args 'hell', 'demon' are risky.",reveal,false, "Reveals the map, by default ignoring hell.\n" "Options:\n" "hell - also reveal hell, while forcing the game to pause.\n" @@ -86,12 +86,12 @@ DFhackCExport command_result plugin_init ( color_ostream &out, vector & parameters) DFhackCExport command_result plugin_init(color_ostream &out, vector& commands) { - commands.push_back(PluginCommand("seedwatch", "Switches cookery based on quantity of seeds, to keep reserves", df_seedwatch)); + commands.push_back(PluginCommand("seedwatch", "Toggles seed cooking based on quantity available", df_seedwatch)); // fill in the abbreviations map, with abbreviations for the standard plants abbreviations["bs"] = "SLIVER_BARB"; abbreviations["bt"] = "TUBER_BLOATED"; diff --git a/plugins/stockflow.cpp b/plugins/stockflow.cpp index 15a013dea..ff87bdddc 100644 --- a/plugins/stockflow.cpp +++ b/plugins/stockflow.cpp @@ -29,7 +29,7 @@ REQUIRE_GLOBAL(world); REQUIRE_GLOBAL(ui); bool fast = false; -const char *tagline = "Allows the fortress bookkeeper to queue jobs through the manager."; +const char *tagline = "Allow the bookkeeper to queue manager jobs."; const char *usage = ( " stockflow enable\n" " Enable the plugin.\n" diff --git a/plugins/stockpiles/stockpiles.cpp b/plugins/stockpiles/stockpiles.cpp index bfba7e1e4..3cd2cb31a 100644 --- a/plugins/stockpiles/stockpiles.cpp +++ b/plugins/stockpiles/stockpiles.cpp @@ -85,7 +85,7 @@ DFhackCExport command_result plugin_init ( color_ostream &out, std::vector & parameters) DFhackCExport command_result plugin_init (color_ostream &out, std::vector &commands) { - commands.push_back(PluginCommand("strangemood", "Force a strange mood to happen.\n", df_strangemood, false, + commands.push_back(PluginCommand("strangemood", "Force a strange mood to happen.", df_strangemood, false, "Options:\n" " -force - Ignore standard mood preconditions.\n" " -unit - Use the selected unit instead of picking one randomly.\n" diff --git a/plugins/tiletypes.cpp b/plugins/tiletypes.cpp index 1a249825c..ae5362e15 100644 --- a/plugins/tiletypes.cpp +++ b/plugins/tiletypes.cpp @@ -58,9 +58,9 @@ DFhackCExport command_result plugin_init ( color_ostream &out, std::vector Date: Tue, 10 Nov 2015 15:59:35 +1100 Subject: [PATCH 6/9] Minor fixes, space no longer required Thanks to 2882422 --- plugins/devel/memview.cpp | 2 +- plugins/reveal.cpp | 2 +- scripts/autofarm.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/devel/memview.cpp b/plugins/devel/memview.cpp index 910762029..07158babc 100644 --- a/plugins/devel/memview.cpp +++ b/plugins/devel/memview.cpp @@ -36,7 +36,7 @@ DFHACK_PLUGIN("memview"); DFhackCExport command_result plugin_init (color_ostream &out, std::vector &commands) { - commands.push_back(PluginCommand("memview","Shows DF memory in real time.",memview)); + commands.push_back(PluginCommand("memview","Shows DF memory in real time.",memview,false,"Shows memory in real time.\nParams: adrr length refresh_rate. If addr==0 then stop viewing.")); memdata.state=STATE_OFF; mymutex=new tthread::mutex; return CR_OK; diff --git a/plugins/reveal.cpp b/plugins/reveal.cpp index 414a2f25b..01c007d05 100644 --- a/plugins/reveal.cpp +++ b/plugins/reveal.cpp @@ -77,7 +77,7 @@ command_result nopause(color_ostream &out, vector & params); DFhackCExport command_result plugin_init ( color_ostream &out, vector &commands) { - commands.push_back(PluginCommand("reveal","Reveal the map. Args 'hell', 'demon' are risky.",reveal,false, + commands.push_back(PluginCommand("reveal","Reveal the map.",reveal,false, "Reveals the map, by default ignoring hell.\n" "Options:\n" "hell - also reveal hell, while forcing the game to pause.\n" diff --git a/scripts/autofarm.rb b/scripts/autofarm.rb index 5dcd34679..1bf07c599 100644 --- a/scripts/autofarm.rb +++ b/scripts/autofarm.rb @@ -1,4 +1,4 @@ -# Select cropt to plant based on current stocks +# Select crops to plant based on current stocks =begin autofarm From eb34ff0cd6669a1ae83a84689472c45089c3e079 Mon Sep 17 00:00:00 2001 From: PeridexisErrant Date: Wed, 11 Nov 2015 14:36:47 +1100 Subject: [PATCH 7/9] Fix typos and missing links in docs --- docs/Plugins.rst | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/Plugins.rst b/docs/Plugins.rst index 9b86e98be..4e1886e8d 100644 --- a/docs/Plugins.rst +++ b/docs/Plugins.rst @@ -275,7 +275,7 @@ One-shot subcommands: Subcommands that persist until disabled or DF quits: -:adamantine-cloth-wear: Prevents adamantine clothing from wearing out while being worn (bug 6481). +:adamantine-cloth-wear: Prevents adamantine clothing from wearing out while being worn (:bug:`6481`). :advmode-contained: Works around :bug:`6202`, custom reactions with container inputs in advmode. The issue is that the screen tries to force you to select the contents separately from the container. This forcefully skips child @@ -1083,7 +1083,7 @@ This plugin adds an option to the :kbd:`q` menu for stckpiles when `enabled `_. At present, -only buildings constructed of an item with the same name as the building +The syntax of the file itself is similar to `digfort` or :forums:`quickfort <35931>`. +At present, only buildings constructed of an item with the same name as the building are supported. All other characters are ignored. For example:: `,`,d,`,` @@ -1881,7 +1882,7 @@ This section of a file would designate for construction a door and some furniture inside a bedroom: specifically, clockwise from top left, a cabinet, a table, a chair, a bed, and a statue. -All of the building designation uses `Planning Mode `, so you do not need to +All of the building designation uses `buildingplan`, so you do not need to have the items available to construct all the buildings when you run fortplan with the .csv file. From 205e5cd37153e3e18c8e73000661cc990d749f9b Mon Sep 17 00:00:00 2001 From: PeridexisErrant Date: Fri, 15 Apr 2016 16:51:24 +1000 Subject: [PATCH 8/9] Un-break script doc checker This handles any number of empty lines above the title, including zero - a harmless case which was breaking the build. --- travis/script-in-readme.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis/script-in-readme.py b/travis/script-in-readme.py index 66ea18605..72b7db86a 100644 --- a/travis/script-in-readme.py +++ b/travis/script-in-readme.py @@ -42,7 +42,7 @@ def check_file(fname): else: print('Error: no documentation in: ' + fname) return 1 - title, underline = doclines[1], doclines[2] + title, underline = [d for d in doclines if d and '=begin' not in d][:2] if underline != '=' * len(title): print('Error: title/underline mismatch:', fname, title, underline) errors += 1 From 856c3b06f4151c603bcfa30c0a5ada4ad73404f1 Mon Sep 17 00:00:00 2001 From: Japa Date: Tue, 19 Apr 2016 19:15:33 +0530 Subject: [PATCH 9/9] Added dig designations to remotefortressreader.cpp --- plugins/proto/RemoteFortressReader.proto | 18 ++++++++++++ plugins/remotefortressreader.cpp | 35 ++++++++++++++++++------ 2 files changed, 45 insertions(+), 8 deletions(-) diff --git a/plugins/proto/RemoteFortressReader.proto b/plugins/proto/RemoteFortressReader.proto index 7321be36c..a08e3f11e 100644 --- a/plugins/proto/RemoteFortressReader.proto +++ b/plugins/proto/RemoteFortressReader.proto @@ -100,6 +100,23 @@ enum BuildingDirection WEST = 3; } +enum TileDigDesignation +{ + /** + * no designation + */ + NO_DIG = 0; + /** + * dig walls, remove stairs and ramps, gather plants, fell trees + */ + DEFAULT_DIG = 1; + UP_DOWN_STAIR_DIG = 2; + CHANNEL_DIG = 3; + RAMP_DIG = 4; + DOWN_STAIR_DIG = 5; + UP_STAIR_DIG = 6; +} + message Tiletype { required int32 id = 1; @@ -168,6 +185,7 @@ message MapBlock repeated int32 tree_x = 21; repeated int32 tree_y = 22; repeated int32 tree_z = 23; + repeated TileDigDesignation tile_dig_designation = 24; } message MatPair { diff --git a/plugins/remotefortressreader.cpp b/plugins/remotefortressreader.cpp index 4116dfd33..317fe53bb 100644 --- a/plugins/remotefortressreader.cpp +++ b/plugins/remotefortressreader.cpp @@ -1149,8 +1149,6 @@ void CopyDesignation(df::map_block * DfBlock, RemoteFortressReader::MapBlock * N NetBlock->set_map_y(DfBlock->map_pos.y); NetBlock->set_map_z(DfBlock->map_pos.z); - bool hasBuilding = false; - for (int yy = 0; yy < 16; yy++) for (int xx = 0; xx < 16; xx++) { @@ -1170,12 +1168,33 @@ void CopyDesignation(df::map_block * DfBlock, RemoteFortressReader::MapBlock * N NetBlock->add_subterranean(designation.bits.subterranean); NetBlock->add_water_salt(designation.bits.water_salt); NetBlock->add_water_stagnant(designation.bits.water_stagnant); - } - - if(hasBuilding) - for (int i = 0; i < df::global::world->buildings.all.size(); i++) - { - + switch (designation.bits.dig) + { + case df::enums::tile_dig_designation::No: + NetBlock->add_tile_dig_designation(TileDigDesignation::NO_DIG); + break; + case df::enums::tile_dig_designation::Default: + NetBlock->add_tile_dig_designation(TileDigDesignation::DEFAULT_DIG); + break; + case df::enums::tile_dig_designation::UpDownStair: + NetBlock->add_tile_dig_designation(TileDigDesignation::UP_DOWN_STAIR_DIG); + break; + case df::enums::tile_dig_designation::Channel: + NetBlock->add_tile_dig_designation(TileDigDesignation::CHANNEL_DIG); + break; + case df::enums::tile_dig_designation::Ramp: + NetBlock->add_tile_dig_designation(TileDigDesignation::RAMP_DIG); + break; + case df::enums::tile_dig_designation::DownStair: + NetBlock->add_tile_dig_designation(TileDigDesignation::DOWN_STAIR_DIG); + break; + case df::enums::tile_dig_designation::UpStair: + NetBlock->add_tile_dig_designation(TileDigDesignation::UP_STAIR_DIG); + break; + default: + NetBlock->add_tile_dig_designation(TileDigDesignation::NO_DIG); + break; + } } }