As @Edgeircanine428 presented here, the game doesn't handle properly when a "topic" is a table (as to introduce text variation instead of saying the same line over and over) and is accompanied by a "modifier". This change to the getmodifiedstring function in stringutil.lua could solve it:
local function getmodifiedstring(topic_tab, modifier)
if type(modifier) == "table" then
local ret = topic_tab
for i,v in ipairs(modifier) do
if ret == nil then
return nil
end
ret = ret[v]
end
return ret
else
if modifier ~= nil and type(topic_tab[modifier]) == "table" then
topic_tab = topic_tab[modifier]
elseif type(topic_tab.GENERIC) == "table" then
topic_tab = topic_tab.GENERIC
end
return (modifier ~= nil and topic_tab[modifier])
or topic_tab.GENERIC
or (#topic_tab > 0 and topic_tab[math.random(#topic_tab)] or nil)
end
end
(Code added in bold.)
Currently this only affects mods that want to extend speech and add variation, but the base game could also benefit from this change.