diff --git a/NEWS b/NEWS index db69494d3..c84421599 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,7 @@ DFHack Future stockpile settings to a file. They can be used to migrate stockpile settings between worlds and saves. New scripts: + - remove-stress [all]: set selected or all units unit to -1,000,000 stress Misc improvements: - cmd-prompt can now access selected items, units, and buildings diff --git a/Readme.rst b/Readme.rst index a4965d54b..e2456d7d3 100644 --- a/Readme.rst +++ b/Readme.rst @@ -2422,6 +2422,10 @@ but in the short term your dwarves will get much more joyful. Internals: the thoughts are set to be very old, so that the game remove them quickly after you unpause. +remove-stress +============= +Sets stress to -1,000,000; the normal range is 0 to 500,000 with very stable or very stressed dwarves taking on negative or greater values respectively. Applies to the selected unit, or use "remove-stress all" to apply to all units. + setfps ====== diff --git a/scripts/remove-stress.lua b/scripts/remove-stress.lua new file mode 100644 index 000000000..d0ff637ce --- /dev/null +++ b/scripts/remove-stress.lua @@ -0,0 +1,14 @@ +-- Sets stress to negative one million +-- With unit selected, affects that unit. Use "remove-stress all" to affect all units. + +--By Putnam; http://www.bay12forums.com/smf/index.php?topic=139553.msg5820486#msg5820486 + +local args = {...} + +if args[1]=='all' then + for k,v in ipairs(df.global.world.units.active) do + v.status.current_soul.personality.stress_level=-1000000 + end +else + dfhack.gui.getSelectedUnit().status.current_soul.personality.stress_level=-1000000 +end \ No newline at end of file