Ny way to check the kills on a pet

dwarf-fortress

On my dwarf citizens, I can check their kill list by selecting them with v, opening their status screen with z, and pressing k. Is there any way to view this screen for pets? I have a turret which has earned quite a name for itself, and I'd like to see what it has killed.

Best Answer

Vanilla game

As soon as the pet gains a name, it becomes a historical figure. This means it does show up in the "Legends" mode, and you can copy your save game folder, load it, abandon the fort then start a game in "Legends" mode with this folder to check.

enter image description here

You probably want to write down the name of the pet in question, since you can only search by name, not by race.

Using mods

In fortress mode, you need an extended tool like DFHack, which allows you to write Lua scripts interfacing the internal data of the game while it's running. For example, this little script for DFHack will show you all notable kills of the selected unit.

-- Show the kills of the unit under cursor

local gui = require 'gui'
local dlg = require 'gui.dialogs'
local figures = df.global.world.history.figures
local events = df.global.world.history.events
local creatures = df.global.world.raws.creatures.all

local unit = dfhack.gui.getSelectedUnit(true)

if unit then
    local kills = {}
    if unit.hist_figure_id > 0 then
        local f = figures[unit.hist_figure_id]
        if f.info.kills then
            for _,e in ipairs(f.info.kills.events) do
                -- events[e] is of type history_event_hist_figure_diedst
                local ev = events[e]
                local victim = figures[ev.victim]
                local name = dfhack.TranslateName(victim.name)
                local race = (creatures[victim.race]).caste[victim.caste].caste_name[0]

                table.insert(kills, name .. " (" .. race .. ") in year " .. ev.year)
            end
            -- Show the kills
            dlg.showListPrompt(
                '--- Notable kills ---',
                nil, COLOR_WHITE,
                kills,
                nil, nil, 70
            )
        else
            dlg.showMessage(nil, "This peaceful soul didn't kill anyone. Yet.")
        end
    end
end

Save if as showkills.lua or similar in the hack\scripts\ directory and you'll be able to use it by either calling the script name (showkills) on the DFHack prompt, or binding it to a key combination and using this to call the script.