diff --git a/assign-minecarts.lua b/assign-minecarts.lua index cb8da7c834..5554e69022 100644 --- a/assign-minecarts.lua +++ b/assign-minecarts.lua @@ -2,31 +2,12 @@ --@ module = true local argparse = require('argparse') -local quickfort = reqscript('quickfort') - --- ensures the list of available minecarts has been calculated by the game -local function refresh_ui_hauling_vehicles() - local qfdata - if #df.global.plotinfo.hauling.routes > 0 then - -- if there is an existing route, move to the vehicle screen and back - -- out to force the game to scan for assignable minecarts - qfdata = 'hv^^' - else - -- if no current routes, create a route, move to the vehicle screen, - -- back out, and remove the route. The extra "px" is in the string in - -- case the user has the confirm plugin enabled. "p" pauses the plugin - -- and "x" retries the route deletion. - qfdata = 'hrv^xpx^' - end - quickfort.apply_blueprint{mode='config', data=qfdata} -end function get_free_vehicles() - refresh_ui_hauling_vehicles() local free_vehicles = {} - for _,minecart in ipairs(df.global.plotinfo.hauling.vehicles) do - if minecart and minecart.route_id == -1 then - table.insert(free_vehicles, minecart) + for _,vehicle in ipairs(df.global.world.vehicles.active) do + if vehicle and vehicle.route_id == -1 then + table.insert(free_vehicles, vehicle) end end return free_vehicles @@ -136,7 +117,7 @@ local function all(quiet) end end -local function do_help() +local function do_help(_) print(dfhack.script_help()) end diff --git a/changelog.txt b/changelog.txt index 29e7426c96..f4890d1d1b 100644 --- a/changelog.txt +++ b/changelog.txt @@ -15,14 +15,15 @@ that repo. ## New Scripts - `diplomacy`: view or alter diplomatic relationships -- `exportlegends`: reinstated: export extended legends information for external browsing -- `modtools/create-item`: reinstated: commandline and API interface for creating items -- `light-aquifers-only`: reinstated: convert heavy aquifers to light +- `exportlegends`: (reinstated\) export extended legends information for external browsing +- `modtools/create-item`: (reinstated) commandline and API interface for creating items +- `light-aquifers-only`: (reinstated) convert heavy aquifers to light - `necronomicon`: search fort for items containing the secrets of life and death - `fix/stuck-instruments`: fix instruments that are attached to invalid jobs, making them unusable - `gui/mod-manager`: automatically restore your list of active mods when generating new worlds - `gui/autodump`: point and click item teleportation and destruction interface - `gui/sandbox`: creation interface for units, trees, and items +- `assign-minecarts`: (reinstated) quickly assign minecarts to hauling routes ## Fixes - `quickfort`: properly allow dwarves to smooth, engrave, and carve beneath passable tiles of buildings diff --git a/docs/assign-minecarts.rst b/docs/assign-minecarts.rst index abd7ff856f..6512e4f79d 100644 --- a/docs/assign-minecarts.rst +++ b/docs/assign-minecarts.rst @@ -3,10 +3,10 @@ assign-minecarts .. dfhack-tool:: :summary: Assign minecarts to hauling routes. - :tags: unavailable fort productivity + :tags: fort productivity -This script allows you to assign minecarts to hauling routes without having to -use the in-game interface. +This script allows you to quickly assign minecarts to hauling routes without +having to go through the in-game interface. Note that a hauling route must have at least one stop defined before a minecart can be assigned to it.