Removed removebadthoughts and updated Readme.rst and NEWS.

develop
expwnent 2014-11-30 09:26:04 -05:00
parent 81b75161d6
commit d9ae3cc612
3 changed files with 5 additions and 65 deletions

@ -4,13 +4,14 @@ DFHack Future
typo fix in modtools/reaction-trigger typo fix in modtools/reaction-trigger
modtools/item-trigger should now work with item types modtools/item-trigger should now work with item types
New plugins: New plugins:
- savestock and loadstock: two commands for saving and loading savestock and loadstock: two commands for saving and loading
stockpile settings to a file. They can be used to migrate stockpile stockpile settings to a file. They can be used to migrate stockpile
settings between worlds and saves. settings between worlds and saves.
New scripts: New scripts:
- remove-stress [all]: set selected or all units unit to -1,000,000 stress remove-stress [all]: set selected or all units unit to -1,000,000 stress
this script replaces removebadthoughts.rb
Misc improvements: Misc improvements:
- cmd-prompt can now access selected items, units, and buildings cmd-prompt can now access selected items, units, and buildings
DFHack 0.40.16-r1 DFHack 0.40.16-r1
Internals: Internals:

@ -2404,27 +2404,9 @@ quicksave
If called in dwarf mode, makes DF immediately auto-save the game by setting a flag If called in dwarf mode, makes DF immediately auto-save the game by setting a flag
normally used in seasonal auto-save. normally used in seasonal auto-save.
removebadthoughts
=================
This script remove negative thoughts from your dwarves. Very useful against
tantrum spirals.
The script can target a single creature, when used with the ``him`` argument,
or the whole fort population, with ``all``.
To show every bad thought present without actually removing them, run the
script with the ``-n`` or ``--dry-run`` argument. This can give a quick
hint on what bothers your dwarves the most.
Individual dwarf happiness may not increase right after this command is run,
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 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. 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 setfps
====== ======

@ -1,43 +0,0 @@
# remove bad thoughts for the selected unit or the whole fort
dry_run = $script_args.delete('--dry-run') || $script_args.delete('-n')
$script_args << 'all' if dry_run and $script_args.empty?
seenbad = Hash.new(0)
clear_mind = lambda { |u|
u.status.recent_events.each { |e|
next if DFHack::UnitThoughtType::Value[e.type].to_s[0, 1] != '-'
seenbad[e.type] += 1
e.age = 0x1000_0000 unless dry_run
}
}
summary = lambda {
seenbad.sort_by { |thought, cnt| cnt }.each { |thought, cnt|
puts " #{thought} #{cnt}"
}
count = seenbad.values.inject(0) { |sum, cnt| sum+cnt }
puts "Removed #{count} bad thought#{'s' if count != 1}." if count > 0 and not dry_run
}
case $script_args[0]
when 'him'
if u = df.unit_find
clear_mind[u]
summary[]
else
puts 'Please select a dwarf ingame'
end
when 'all'
df.unit_citizens.each { |uu|
clear_mind[uu]
}
summary[]
else
puts "Usage: removebadthoughts [--dry-run] <him|all>"
end