dfhack icon indicating copy to clipboard operation
dfhack copied to clipboard

modtools/extra-gamelog: Sparring vs Combat

Open Bumber64 opened this issue 2 years ago • 5 comments

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.

Bumber64 avatar Sep 25 '22 21:09 Bumber64

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).

lethosor avatar Sep 25 '22 22:09 lethosor

Do we have the means to detect reports or messages before they print?

Bumber64 avatar Sep 27 '22 00:09 Bumber64

Nope

lethosor avatar Sep 27 '22 13:09 lethosor

we might be able to accomplish something similar by maintaining a separate log file.

Moth-Tolias avatar Sep 27 '22 16:09 Moth-Tolias

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.

Bumber64 avatar Sep 28 '22 16:09 Bumber64