Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mark set-orientation as available #815

Merged
merged 1 commit into from
Sep 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
2 changes: 1 addition & 1 deletion docs/set-orientation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
34 changes: 2 additions & 32 deletions set-orientation.lua
Original file line number Diff line number Diff line change
@@ -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 <UNIT ID>:
The given unit will be affected.
If not found/provided, the script will try defaulting to the currently selected unit.
:male <INTEREST>:
Set the interest level towards male sexes
:female <INTEREST>:
Set the interest level towards female sexes
:opposite <INTEREST>:
Set the interest level towards the opposite sex to the unit
:same <INTEREST>:
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'

Expand All @@ -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

Expand Down Expand Up @@ -224,7 +194,7 @@ function main(...)

-- Help
if args.help then
print(help)
print(dfhack.script_help())
return
end

Expand Down