Open Bumber64 opened 2 years ago
It's a bit tricky to do this - the script is only designed to write additional messages to the gamelog, not to modify messages that have already been written. If any tool is behaving like tail
and just watching for changes to the end of the file, they'll only see the original messages created by DF, even if we go back and edit them (and editing them is risky if DF maintains an open file that's writing to the same file).
Do we have the means to detect reports or messages before they print?
Nope
we might be able to accomplish something similar by maintaining a separate log file.
We could just write to DF's gamelog and have SoundSense configured to ignore combat stuff that we don't print.
However, that would add a bunch of bloat to the gamelog if we don't simplify the messages. Shortest message would be the sound to play, requiring the relevant regex's to be passed along to DFHack. Otherwise, we can do some abbreviation of text that doesn't provide any info.
Identify which reports are sparring/combat/hunting and add this info when printing to gamelog.txt, so utilities like SoundSense can more easily filter them out.
Could put [S], [C], or [H] in front of the relevant lines.