From 627f0368306273e21abe35d938d8fd7d43583553 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Mon, 24 Sep 2012 19:13:33 +0400 Subject: [PATCH] Implement a special command parsing mode with one verbatim argument. Intended for script expressions, e.g. rb_eval. --- README.rst | 87 +++++++++----- Readme.html | 304 +++++++++++++++++++++++++++++------------------ library/Core.cpp | 28 ++++- 3 files changed, 277 insertions(+), 142 deletions(-) diff --git a/README.rst b/README.rst index 73147d061..5202b92a2 100644 --- a/README.rst +++ b/README.rst @@ -148,6 +148,19 @@ for context ``foo/bar/baz``, possible matches are any of ``@foo/bar/baz``, ``@fo Commands ======== +DFHack command syntax consists of a command name, followed by arguments separated +by whitespace. To include whitespace in an argument, quote it in double quotes. +To include a double quote character, use ``\"`` inside double quotes. + +If the first non-whitespace character of a line is ``#``, the line is treated +as a comment, i.e. a silent no-op command. + +If the first non-whitespace character is ``:``, the command is parsed in a special +alternative mode: first, non-whitespace characters immediately following the ``:`` +are used as the command name; the remaining part of the line, starting with the first +non-whitespace character *after* the command name, is used verbatim as the first argument. +This is intended for commands like ``rb_eval`` that evaluate script language statements. + Almost all the commands support using the 'help ' built-in command to retrieve further help without having to look at this document. Alternatively, some accept a 'help'/'?' option on their command line. @@ -1636,8 +1649,8 @@ digfort A script to designate an area for digging according to a plan in csv format. This script, inspired from quickfort, can designate an area for digging. -Your plan should be stored in a .csv file like this: -:: +Your plan should be stored in a .csv file like this:: + # this is a comment d;d;u;d;d;skip this tile;d d;d;d;i @@ -1656,8 +1669,8 @@ superdwarf ========== Similar to fastdwarf, per-creature. -To make any creature superfast, target it ingame using 'v' and: -:: +To make any creature superfast, target it ingame using 'v' and:: + superdwarf add Other options available: ``del``, ``clear``, ``list``. @@ -1748,16 +1761,6 @@ focus on the current one. Shift-Enter has an effect equivalent to pressing Enter re-entering the mechanisms ui. -Power Meter -=========== - -Front-end to the power-meter plugin implemented by the gui/power-meter script. Bind to a -key and activate after selecting Pressure Plate in the build menu. - -The script follows the general look and feel of the regular pressure plate build -configuration page, but configures parameters relevant to the modded power meter building. - - Rename ====== @@ -1786,11 +1789,25 @@ The script lists other rooms owned by the same owner, or by the unit selected in list, and allows unassigning them. +============= +Behavior Mods +============= + +These plugins, when activated via configuration UI or by detecting certain +structures in RAWs, modify the game engine behavior concerning the target +objects to add features not otherwise present. + + Siege Engine ============ -Front-end to the siege-engine plugin implemented by the gui/siege-engine script. Bind to a -key and activate after selecting a siege engine in 'q' mode. +The siege-engine plugin enables siege engines to be linked to stockpiles, and +aimed at an arbitrary rectangular area across Z levels, instead of the original +four directions. Also, catapults can be ordered to load arbitrary objects, not +just stones. + +The configuration front-end to the plugin is implemented by the gui/siege-engine +script. Bind it to a key and activate after selecting a siege engine in 'q' mode. The main mode displays the current target, selected ammo item type, linked stockpiles and the allowed operator skill range. The map tile color is changed to signify if it can be @@ -1799,7 +1816,7 @@ yellow for partially blocked. Pressing 'r' changes into the target selection mode, which works by highlighting two points with Enter like all designations. When a target area is set, the engine projectiles are -aimed at that area, or units within it, instead of the vanilla four directions. +aimed at that area, or units within it. After setting the target in this way for one engine, you can 'paste' the same area into others just by pressing 'p' in the main page of this script. The area to paste is kept until you quit @@ -1813,17 +1830,23 @@ menu. .. admonition:: DISCLAIMER - Siege engines are a very interesting feature, but currently nearly useless + Siege engines are a very interesting feature, but sadly almost useless in the current state because they haven't been updated since 2D and can only aim in four directions. This is an attempt to bring them more up to date until Toady has time to work on it. Actual improvements, e.g. like making siegers bring their own, are something only Toady can do. -========= -RAW hacks -========= +Power Meter +=========== + +The power-meter plugin implements a modified pressure plate that detects power being +supplied to gear boxes built in the four adjacent N/S/W/E tiles. + +The configuration front-end is implemented by the gui/power-meter script. Bind it to a +key and activate after selecting Pressure Plate in the build menu. -These plugins detect certain structures in RAWs, and enhance them in various ways. +The script follows the general look and feel of the regular pressure plate build +configuration page, but configures parameters relevant to the modded power meter building. Steam Engine @@ -1855,7 +1878,7 @@ The magma version also needs magma. .. admonition:: ISSUE Since this building is a machine, and machine collapse - code cannot be modified, it would collapse over true open space. + code cannot be hooked, it would collapse over true open space. As a loophole, down stair provides support to machines, while being passable, so use them. @@ -1866,7 +1889,7 @@ is extracted from the workshop raws. .. admonition:: ISSUE Like with collapse above, part of the code involved in - machine connection cannot be modified. As a result, the workshop + machine connection cannot be hooked. As a result, the workshop can only immediately connect to machine components built AFTER it. This also means that engines cannot be chained without intermediate short axles that can be built later than both of the engines. @@ -1879,8 +1902,13 @@ on repeat). A furnace operator will come, possibly bringing a bar of fuel, and perform it. As a result, a "boiling water" item will appear in the 't' view of the workshop. -**NOTE**: The completion of the job will actually consume one unit -of the appropriate liquids from below the workshop. +.. note:: + + The completion of the job will actually consume one unit + of the appropriate liquids from below the workshop. This means + that you cannot just raise 7 units of magma with a piston and + have infinite power. However, liquid consumption should be slow + enough that water can be supplied by a pond zone bucket chain. Every such item gives 100 power, up to a limit of 300 for coal, and 500 for a magma engine. The building can host twice that @@ -1928,9 +1956,12 @@ Add Spatter =========== This plugin makes reactions with names starting with ``SPATTER_ADD_`` -produce contaminants on the items instead of improvements. +produce contaminants on the items instead of improvements. The produced +contaminants are immune to being washed away by water or destroyed by +the ``clean items`` command. -Intended to give some use to all those poisons that can be bought from caravans. +The plugin is intended to give some use to all those poisons that can +be bought from caravans. :) To be really useful this needs patches from bug 808, ``tweak fix-dimensions`` and ``tweak advmode-contained``. diff --git a/Readme.html b/Readme.html index be6856fb6..7aebeb13a 100644 --- a/Readme.html +++ b/Readme.html @@ -432,72 +432,78 @@ access DF memory and allow for easier development of new tools.

  • Visualizer and data export
  • -
  • Job management
      -
    • job
    • -
    • job-material
    • -
    • job-duplicate
    • -
    • workflow
        -
      • Function
      • -
      • Constraint examples
      • +
      • Job management
      • -
      • Fortress activity management
          -
        • seedwatch
        • -
        • zone
            -
          • Usage with single units
          • -
          • Usage with filters
          • -
          • Mass-renaming
          • -
          • Cage zones
          • -
          • Examples
          • +
          • Fortress activity management
          • -
          • Other
          • -
          • Scripts
              -
            • fix/*
            • -
            • gui/*
            • -
            • quicksave
            • -
            • setfps
            • -
            • growcrops
            • -
            • removebadthoughts
            • -
            • slayrace
            • -
            • magmasource
            • +
            • Scripts
            • -
            • In-game interface tools
                -
              • Dwarf Manipulator
              • -
              • Liquids
              • -
              • Mechanisms
              • -
              • Power Meter
              • -
              • Rename
              • -
              • Room List
              • -
              • Siege Engine
              • +
              • In-game interface tools
              • -
              • RAW hacks
                  -
                • Steam Engine @@ -627,6 +633,16 @@ for context foo/bar/baz, possible matches are

                  Commands

                  +

                  DFHack command syntax consists of a command name, followed by arguments separated +by whitespace. To include whitespace in an argument, quote it in double quotes. +To include a double quote character, use \" inside double quotes.

                  +

                  If the first non-whitespace character of a line is #, the line is treated +as a comment, i.e. a silent no-op command.

                  +

                  If the first non-whitespace character is :, the command is parsed in a special +alternative mode: first, non-whitespace characters immediately following the : +are used as the command name; the remaining part of the line, starting with the first +non-whitespace character after the command name, is used verbatim as the first argument. +This is intended for commands like rb_eval that evaluate script language statements.

                  Almost all the commands support using the 'help <command-name>' built-in command to retrieve further help without having to look at this document. Alternatively, some accept a 'help'/'?' option on their command line.

                  @@ -1782,15 +1798,16 @@ thread: mapexport

                  Export the current loaded map as a file. This will be eventually usable with visualizers.

                  -

                  dwarfexport -----------= -Export dwarves to RuneSmith-compatible XML.

                  +
                  +
                  +

                  dwarfexport

                  +

                  Export dwarves to RuneSmith-compatible XML.

                  -

                  Job management

                  +

                  Job management

                  -

                  job

                  +

                  job

                  Command for general job query and manipulation.

                  Options:
                  @@ -1809,7 +1826,7 @@ in a workshop, or the unit/jobs screen.
                  -

                  job-material

                  +

                  job-material

                  Alter the material of the selected job.

                  Invoked as:

                  @@ -1827,7 +1844,7 @@ over the first available choice with the matching material.
                • -

                  job-duplicate

                  +

                  job-duplicate

                  Duplicate the selected job in a workshop:
                    @@ -1838,7 +1855,7 @@ instantly duplicates the job.
                  -

                  workflow

                  +

                  workflow

                  Manage control of repeat jobs.

                  Usage:

                  @@ -1862,7 +1879,7 @@ Otherwise, enables or disables any of the following options:

                  -

                  Function

                  +

                  Function

                  When the plugin is enabled, it protects all repeat jobs from removal. If they do disappear due to any cause, they are immediately re-added to their workshop and suspended.

                  @@ -1873,7 +1890,7 @@ the amount has to drop before jobs are resumed; this is intended to reduce the frequency of jobs being toggled.

                  -

                  Constraint examples

                  +

                  Constraint examples

                  Keep metal bolts within 900-1000, and wood/bone within 150-200.

                   workflow amount AMMO:ITEM_AMMO_BOLTS/METAL 1000 100
                  @@ -1912,15 +1929,15 @@ command.
                   
                  -

                  Fortress activity management

                  +

                  Fortress activity management

                  -

                  seedwatch

                  +

                  seedwatch

                  Tool for turning cooking of seeds and plants on/off depending on how much you have of them.

                  See 'seedwatch help' for detailed description.

                  -

                  zone

                  +

                  zone

                  Helps a bit with managing activity zones (pens, pastures and pits) and cages.

                  Options:

                  @@ -2019,7 +2036,7 @@ for war/hunt). Negatable.
                  -

                  Usage with single units

                  +

                  Usage with single units

                  One convenient way to use the zone tool is to bind the command 'zone assign' to a hotkey, maybe also the command 'zone set'. Place the in-game cursor over a pen/pasture or pit, use 'zone set' to mark it. Then you can select units @@ -2028,7 +2045,7 @@ and use 'zone assign' to assign them to their new home. Allows pitting your own dwarves, by the way.

                  -

                  Usage with filters

                  +

                  Usage with filters

                  All filters can be used together with the 'assign' command.

                  Restrictions: It's not possible to assign units who are inside built cages or chained because in most cases that won't be desirable anyways. @@ -2046,14 +2063,14 @@ are not properly added to your own stocks; slaughtering them should work).

                  Most filters can be negated (e.g. 'not grazer' -> race is not a grazer).

                  -

                  Mass-renaming

                  +

                  Mass-renaming

                  Using the 'nick' command you can set the same nickname for multiple units. If used without 'assign', 'all' or 'count' it will rename all units in the current default target zone. Combined with 'assign', 'all' or 'count' (and further optional filters) it will rename units matching the filter conditions.

                  -

                  Cage zones

                  +

                  Cage zones

                  Using the 'tocages' command you can assign units to a set of cages, for example a room next to your butcher shop(s). They will be spread evenly among available cages to optimize hauling to and butchering from them. For this to work you need @@ -2064,7 +2081,7 @@ would make no sense, but can be used together with 'nick' or 'remnick' and all the usual filters.

                  -

                  Examples

                  +

                  Examples

                  zone assign all own ALPACA minage 3 maxage 10
                  Assign all own alpacas who are between 3 and 10 years old to the selected @@ -2090,7 +2107,7 @@ on the current default zone.
                  -

                  autonestbox

                  +

                  autonestbox

                  Assigns unpastured female egg-layers to nestbox zones. Requires that you create pen/pasture zones above nestboxes. If the pen is bigger than 1x1 the nestbox must be in the top left corner. Only 1 unit will be assigned per pen, regardless @@ -2119,7 +2136,7 @@ frames between runs.

                  -

                  autobutcher

                  +

                  autobutcher

                  Assigns lifestock for slaughter once it reaches a specific count. Requires that you add the target race(s) to a watch list. Only tame units will be processed.

                  Named units will be completely ignored (to protect specific animals from @@ -2227,7 +2244,7 @@ autobutcher.bat

                  -

                  autolabor

                  +

                  autolabor

                  Automatically manage dwarf labors.

                  When enabled, autolabor periodically checks your dwarves and enables or disables labors. It tries to keep as many dwarves as possible busy but @@ -2241,14 +2258,14 @@ while it is enabled.

                  -

                  Other

                  +

                  Other

                  -

                  catsplosion

                  +

                  catsplosion

                  Makes cats just multiply. It is not a good idea to run this more than once or twice.

                  -

                  dfusion

                  +

                  dfusion

                  This is the DFusion lua plugin system by warmist/darius, running as a DFHack plugin.

                  See the bay12 thread for details: http://www.bay12forums.com/smf/index.php?topic=69682.15

                  Confirmed working DFusion plugins:

                  @@ -2272,7 +2289,7 @@ twice.

                  -

                  Scripts

                  +

                  Scripts

                  Lua or ruby scripts placed in the hack/scripts/ directory are considered for execution as if they were native DFHack commands. They are listed at the end of the 'ls' command output.

                  @@ -2281,7 +2298,7 @@ only be listed by ls if called as 'ls -a'. This is intended as a way to hide scripts that are obscure, developer-oriented, or should be used as keybindings.

                  Some notable scripts:

                  -

                  fix/*

                  +

                  fix/*

                  Scripts in this subdirectory fix various bugs and issues, some of them obscure.

                  • fix/dead-units

                    @@ -2307,22 +2324,29 @@ caused by autodump bugs or other hacking mishaps.

                  -

                  gui/*

                  +

                  gui/*

                  Scripts that implement dialogs inserted into the main game window are put in this directory.

                  -

                  quicksave

                  +

                  quicksave

                  If called in dwarf mode, makes DF immediately auto-save the game by setting a flag normally used in seasonal auto-save.

                  -

                  setfps

                  +

                  setfps

                  Run setfps <number> to set the FPS cap at runtime, in case you want to watch combat in slow motion or something :)

                  +
                  +

                  siren

                  +

                  Wakes up sleeping units, cancels breaks and stops parties either everywhere, +or in the burrows given as arguments. In return, adds bad thoughts about +noise and tiredness. Also, the units with interrupted breaks will go on +break again a lot sooner.

                  +
                  -

                  growcrops

                  +

                  growcrops

                  Instantly grow seeds inside farming plots.

                  With no argument, this command list the various seed types currently in use in your farming plots. @@ -2334,7 +2358,7 @@ growcrops plump 40

                  -

                  removebadthoughts

                  +

                  removebadthoughts

                  This script remove negative thoughts from your dwarves. Very useful against tantrum spirals.

                  With a selected unit in 'v' mode, will clear this unit's mind, otherwise @@ -2347,7 +2371,7 @@ you unpause.

                  it removed.

                  -

                  slayrace

                  +

                  slayrace

                  Kills any unit of a given race.

                  With no argument, lists the available races.

                  With the special argument 'him', targets only the selected creature.

                  @@ -2373,7 +2397,7 @@ slayrace elve magma
                  -

                  magmasource

                  +

                  magmasource

                  Create an infinite magma source on a tile.

                  This script registers a map tile as a magma source, and every 12 game ticks that tile receives 1 new unit of flowing magma.

                  @@ -2387,13 +2411,50 @@ magmasource here To remove all placed sources, call magmasource stop.

                  With no argument, this command shows an help message and list existing sources.

                  +
                  +

                  digfort

                  +

                  A script to designate an area for digging according to a plan in csv format.

                  +

                  This script, inspired from quickfort, can designate an area for digging. +Your plan should be stored in a .csv file like this:

                  +
                  +# this is a comment
                  +d;d;u;d;d;skip this tile;d
                  +d;d;d;i
                  +
                  +

                  Available tile shapes are named after the 'dig' menu shortcuts: +d for dig, u for upstairs, d downstairs, i updown, +h channel, r upward ramp, x remove designation. +Unrecognized characters are ignored (eg the 'skip this tile' in the sample).

                  +

                  Empty lines and data after a # are ignored as comments. +To skip a row in your design, use a single ;.

                  +

                  The script takes the plan filename, starting from the root df folder.

                  +
                  +
                  +

                  superdwarf

                  +

                  Similar to fastdwarf, per-creature.

                  +

                  To make any creature superfast, target it ingame using 'v' and:

                  +
                  +superdwarf add
                  +
                  +

                  Other options available: del, clear, list.

                  +

                  This plugin also shortens the 'sleeping' and 'on break' periods of targets.

                  +
                  +
                  +

                  drainaquifer

                  +

                  Remove all 'aquifer' tag from the map blocks. Irreversible.

                  +
                  +
                  +

                  deathcause

                  +

                  Focus a body part ingame, and this script will display the cause of death of +the creature.

                  +
                  -

                  In-game interface tools

                  +

                  In-game interface tools

                  These tools work by displaying dialogs or overlays in the game window, and are mostly implemented by lua scripts.

                  -

                  Dwarf Manipulator

                  +

                  Dwarf Manipulator

                  Implemented by the manipulator plugin. To activate, open the unit screen and press 'l'.

                  This tool implements a Dwarf Therapist-like interface within the game UI. The @@ -2428,13 +2489,13 @@ cursor onto that cell instead of toggling it. directly to the main dwarf mode screen.

                  -

                  Liquids

                  +

                  Liquids

                  Implemented by the gui/liquids script. To use, bind to a key and activate in the 'k' mode.

                  While active, use the suggested keys to switch the usual liquids parameters, and Enter to select the target area and apply changes.

                  -

                  Mechanisms

                  +

                  Mechanisms

                  Implemented by the gui/mechanims script. To use, bind to a key and activate in the 'q' mode.

                  Lists mechanisms connected to the building, and their links. Navigating the list centers the view on the relevant linked buildings.

                  @@ -2442,15 +2503,8 @@ the view on the relevant linked buildings.

                  focus on the current one. Shift-Enter has an effect equivalent to pressing Enter, and then re-entering the mechanisms ui.

                  -
                  -

                  Power Meter

                  -

                  Front-end to the power-meter plugin implemented by the gui/power-meter script. Bind to a -key and activate after selecting Pressure Plate in the build menu.

                  -

                  The script follows the general look and feel of the regular pressure plate build -configuration page, but configures parameters relevant to the modded power meter building.

                  -
                  -

                  Rename

                  +

                  Rename

                  Backed by the rename plugin, the gui/rename script allows entering the desired name via a simple dialog in the game ui.

                    @@ -2466,23 +2520,33 @@ It is also possible to rename zones from the 'i' menu.

                    The building or unit are automatically assumed when in relevant ui state.

                  -

                  Room List

                  +

                  Room List

                  Implemented by the gui/room-list script. To use, bind to a key and activate in the 'q' mode, either immediately or after opening the assign owner page.

                  The script lists other rooms owned by the same owner, or by the unit selected in the assign list, and allows unassigning them.

                  +
                  +
                  +

                  Behavior Mods

                  +

                  These plugins, when activated via configuration UI or by detecting certain +structures in RAWs, modify the game engine behavior concerning the target +objects to add features not otherwise present.

                  -

                  Siege Engine

                  -

                  Front-end to the siege-engine plugin implemented by the gui/siege-engine script. Bind to a -key and activate after selecting a siege engine in 'q' mode.

                  +

                  Siege Engine

                  +

                  The siege-engine plugin enables siege engines to be linked to stockpiles, and +aimed at an arbitrary rectangular area across Z levels, instead of the original +four directions. Also, catapults can be ordered to load arbitrary objects, not +just stones.

                  +

                  The configuration front-end to the plugin is implemented by the gui/siege-engine +script. Bind it to a key and activate after selecting a siege engine in 'q' mode.

                  The main mode displays the current target, selected ammo item type, linked stockpiles and the allowed operator skill range. The map tile color is changed to signify if it can be hit by the selected engine: green for fully reachable, blue for out of range, red for blocked, yellow for partially blocked.

                  Pressing 'r' changes into the target selection mode, which works by highlighting two points with Enter like all designations. When a target area is set, the engine projectiles are -aimed at that area, or units within it, instead of the vanilla four directions.

                  +aimed at that area, or units within it.

                  After setting the target in this way for one engine, you can 'paste' the same area into others just by pressing 'p' in the main page of this script. The area to paste is kept until you quit DF, or select another area manually.

                  @@ -2492,22 +2556,27 @@ the script. Shift-ESC retains the current viewport, and also exits from the 'q' menu.

                  DISCLAIMER

                  -

                  Siege engines are a very interesting feature, but currently nearly useless +

                  Siege engines are a very interesting feature, but sadly almost useless in the current state because they haven't been updated since 2D and can only aim in four directions. This is an attempt to bring them more up to date until Toady has time to work on it. Actual improvements, e.g. like making siegers bring their own, are something only Toady can do.

                  +
                  +

                  Power Meter

                  +

                  The power-meter plugin implements a modified pressure plate that detects power being +supplied to gear boxes built in the four adjacent N/S/W/E tiles.

                  +

                  The configuration front-end is implemented by the gui/power-meter script. Bind it to a +key and activate after selecting Pressure Plate in the build menu.

                  +

                  The script follows the general look and feel of the regular pressure plate build +configuration page, but configures parameters relevant to the modded power meter building.

                  -
                  -

                  RAW hacks

                  -

                  These plugins detect certain structures in RAWs, and enhance them in various ways.

                  -

                  Steam Engine

                  +

                  Steam Engine

                  The steam-engine plugin detects custom workshops with STEAM_ENGINE in their token, and turns them into real steam engines.

                  -

                  Rationale

                  +

                  Rationale

                  The vanilla game contains only water wheels and windmills as sources of power, but windmills give relatively little power, and water wheels require flowing water, which must either be a real river and thus immovable and @@ -2518,14 +2587,14 @@ it can be done just by combining existing features of the game engine in a new way with some glue code and a bit of custom logic.

                  -

                  Construction

                  +

                  Construction

                  The workshop needs water as its input, which it takes via a passable floor tile below it, like usual magma workshops do. The magma version also needs magma.

                  ISSUE

                  Since this building is a machine, and machine collapse -code cannot be modified, it would collapse over true open space. +code cannot be hooked, it would collapse over true open space. As a loophole, down stair provides support to machines, while being passable, so use them.

                  @@ -2535,20 +2604,26 @@ is extracted from the workshop raws.

                  ISSUE

                  Like with collapse above, part of the code involved in -machine connection cannot be modified. As a result, the workshop +machine connection cannot be hooked. As a result, the workshop can only immediately connect to machine components built AFTER it. This also means that engines cannot be chained without intermediate short axles that can be built later than both of the engines.

                  -

                  Operation

                  +

                  Operation

                  In order to operate the engine, queue the Stoke Boiler job (optionally on repeat). A furnace operator will come, possibly bringing a bar of fuel, and perform it. As a result, a "boiling water" item will appear in the 't' view of the workshop.

                  -

                  NOTE: The completion of the job will actually consume one unit -of the appropriate liquids from below the workshop.

                  +
                  +

                  Note

                  +

                  The completion of the job will actually consume one unit +of the appropriate liquids from below the workshop. This means +that you cannot just raise 7 units of magma with a piston and +have infinite power. However, liquid consumption should be slow +enough that water can be supplied by a pond zone bucket chain.

                  +

                  Every such item gives 100 power, up to a limit of 300 for coal, and 500 for a magma engine. The building can host twice that amount of items to provide longer autonomous running. When the @@ -2567,7 +2642,7 @@ decrease it by further 4%, and also decrease the whole steam use rate by 10%.

                  -

                  Explosions

                  +

                  Explosions

                  The engine must be constructed using barrel, pipe and piston from fire-safe, or in the magma version magma-safe metals.

                  During operation weak parts get gradually worn out, and @@ -2576,7 +2651,7 @@ toppled during operation by a building destroyer, or a tantruming dwarf.

                  -

                  Save files

                  +

                  Save files

                  It should be safe to load and view engine-using fortresses from a DF version without DFHack installed, except that in such case the engines won't work. However actually making modifications @@ -2587,10 +2662,13 @@ being generated.

                  -

                  Add Spatter

                  +

                  Add Spatter

                  This plugin makes reactions with names starting with SPATTER_ADD_ -produce contaminants on the items instead of improvements.

                  -

                  Intended to give some use to all those poisons that can be bought from caravans.

                  +produce contaminants on the items instead of improvements. The produced +contaminants are immune to being washed away by water or destroyed by +the clean items command.

                  +

                  The plugin is intended to give some use to all those poisons that can +be bought from caravans. :)

                  To be really useful this needs patches from bug 808, tweak fix-dimensions and tweak advmode-contained.

                  diff --git a/library/Core.cpp b/library/Core.cpp index 735359a7f..8a8d39e06 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -126,8 +126,34 @@ struct Core::Private void Core::cheap_tokenise(string const& input, vector &output) { string *cur = NULL; + size_t i = 0; - for (size_t i = 0; i < input.size(); i++) { + // Check the first non-space character + while (i < input.size() && isspace(input[i])) i++; + + // Special verbatim argument mode? + if (i < input.size() && input[i] == ':') + { + // Read the command + std::string cmd; + i++; + while (i < input.size() && !isspace(input[i])) + cmd.push_back(input[i++]); + if (!cmd.empty()) + output.push_back(cmd); + + // Find the argument + while (i < input.size() && isspace(input[i])) i++; + + if (i < input.size()) + output.push_back(input.substr(i)); + + return; + } + + // Otherwise, parse in the regular quoted mode + for (; i < input.size(); i++) + { unsigned char c = input[i]; if (isspace(c)) { cur = NULL;