From 59dc3bac9bff84667877ab8f61adbb77f3324418 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Fri, 1 Sep 2023 18:10:26 -0700 Subject: [PATCH] mark set-orientation as available --- changelog.txt | 1 + docs/set-orientation.rst | 2 +- set-orientation.lua | 34 ++-------------------------------- 3 files changed, 4 insertions(+), 33 deletions(-) diff --git a/changelog.txt b/changelog.txt index 5644840043..0e0a118a0a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -30,6 +30,7 @@ Template for new versions: - `devel/scan-vtables`: Scan and dump likely vtable addresses (for memory research) - `hide-interface`: hide the vanilla UI elements for clean screenshots or laid-back fortress observing - `hide-tutorials`: hide the DF tutorial popups; enable in the System tab of `gui/control-panel` +- `set-orientation`: tinker with romantic inclinations (reinstated from back catalog of tools) ## New Features - `exportlegends`: new overlay that integrates with the vanilla "Export XML" button. Now you can generate both the vanilla export and the extended data export with a single click! diff --git a/docs/set-orientation.rst b/docs/set-orientation.rst index c1c549252a..9244627d7a 100644 --- a/docs/set-orientation.rst +++ b/docs/set-orientation.rst @@ -3,7 +3,7 @@ set-orientation .. dfhack-tool:: :summary: Alter a unit's romantic inclinations. - :tags: unavailable fort armok units + :tags: fort armok units This tool lets you tinker with the interest levels your dwarves have towards dwarves of the same/different sex. diff --git a/set-orientation.lua b/set-orientation.lua index 05eedd683f..19583f7913 100644 --- a/set-orientation.lua +++ b/set-orientation.lua @@ -1,34 +1,4 @@ --- Edit a unit's orientation --- Not to be confused with kane_t's script of the same name --@ module = true -local help = [====[ - -set-orientation -=============== -Edit a unit's orientation. -Interest levels are 0 for Uninterested, 1 for Romance, 2 for Marry. - -:unit : - The given unit will be affected. - If not found/provided, the script will try defaulting to the currently selected unit. -:male : - Set the interest level towards male sexes -:female : - Set the interest level towards female sexes -:opposite : - Set the interest level towards the opposite sex to the unit -:same : - Set the interest level towards the same sex as the unit -:random: - Randomise the unit's interest towards both sexes, respecting their ORIENTATION token odds. - -Other arguments: - -:help: - Shows this help page. -:view: - Print the unit's orientation values in the console. -]====] local utils = require 'utils' @@ -48,7 +18,7 @@ rng = rng or dfhack.random.new(nil, 10) -- General function used for rolling weighted tables function weightedRoll(weightedTable) local maxWeight = 0 - for index, result in ipairs(weightedTable) do + for _, result in ipairs(weightedTable) do maxWeight = maxWeight + result.weight end @@ -224,7 +194,7 @@ function main(...) -- Help if args.help then - print(help) + print(dfhack.script_help()) return end