Hi,
I wrote a small utility that helps me with the annoying menu of current rumor system. Hope Toady fixes that soon, until then I will use this.
Issue: In the current system after a relatively small adventuring your talk menu for "Bring up specific incident or rumor" gets filled up with lots of information. I had like 200+ pages of kea, kestrel , dingoes etc. Finding a specific kill of a megabeast, colossus, titan was annoying.
Requirements: dfhack , dfusion plugin
tested in version 0.42.03
Code commented for usage, refer below.
Next Todo:
If possible automate running of this every time we choose the rumor menu. I will look into that, or someone can redirect me on how to.
This just does the basic feature I needed it to do, maybe you can play around to improve it further. Share your changes too.
-- Improve "Bring up specific incident or rumor" menu in Adventure mode
--@ module = true
--[[=begin
rumors
============
Improve "Bring up specific incident or rumor" menu in Adventure mode
=end]]
--========================
-- Author : 1337G4mer on bay12 and reddit
-- Version : 0.2
-- Description : A small utility based on dfhack to improve the rumor UI in adventure mode.
--
-- Usage: Save this code as rumors.lua file in your /hack/scripts/ folder
-- In game when you want to boast about your kill to someone. Start conversation and choose
-- the menu "Bring up specific incident or rumor"
-- type rumors in dfhack window and hit enter. Or do the below keybind and use that directly from DF window.
-- Optional One time setup : run below command at dfhack command prompt once to setup easy keybind for this
-- keybinding add Ctrl-A@dungeonmode/ConversationSpeak rumors
--
-- Prior Configuration: (you can skip this if you want)
-- Set the three boolean values below and play around with the script as to how you like
-- improveReadability = will move everything in one line
-- addKeywordSlew = will add a keyword for filtering using slew, making it easy to find your kills and not your companion's
-- shortenString = will further shorten the line to = slew "XYZ" ( "n time" ago in " Region")
--=======================
function rumorUpdate()
improveReadability = true
addKeywordSlew = true
shortenString = true
for i, choice in ipairs(df.global.ui_advmode.conversation.choices) do
if choice.choice.type == 118 then
titleLength = #choice.title
if improveReadability then
if titleLength == 3 then
inputTitleStr = choice.title[0].value..' '..choice.title[1].value..choice.title[2].value
choice.title[0].value = inputTitleStr
choice.title[1].value = ''
choice.title[2].value = ''
else
inputTitleStr = choice.title[0].value..' '..choice.title[1].value
choice.title[0].value = inputTitleStr
choice.title[1].value = ''
end
end
if shortenString then
summaryStr = string.gsub(inputTitleStr, "Summarize the conflict in which","")
occurStr = string.gsub(summaryStr, "This occurred +","")
if titleLength == 3 then
choice.title[0].value = occurStr
choice.title[1].value = ''
choice.title[2].value = ''
else
choice.title[0].value = occurStr
choice.title[1].value = ''
end
end
if addKeywordSlew then
if string.find(choice.title[0].value, "slew") then
choice.keywords[1].value=("slew")
end
end
end
end
end
rumorUpdate()
I was able to do this because of this awesome community. I have been a lurker for a few years, just created account today to share this. Hope you like it. Go easy as this is my first post
Screenshot :
Edit: Typo and screenshot
Edit: Updated with v 0.2 removed dfusion , Thanks Max and lethosor