Unfortunately, it can be almost impossible to totally prevent parties, unless you religiously dedicate yourself to micromanagement.
Though it
does require testing, I believe I have a method to stop parties. Check out
my post in the DFHack thread and Warmist's reply.
To summarize:
The
siren.lua script in the DFHack utility will stop parties in progress (as well as wake sleeping units and cancel all breaks), but it gives negative thoughts.
Examining the code, I found the part which stops parties and simplified it:
-- Stop parties
for _,v in ipairs(df.global.ui.parties) do
v.timer = 0
end
This does
not add a negative thought. It merely shortens the duration of all parties to "0", so they end
immediately. As I said, it needs testing. But I
believe this should work as a separate lua script in DFHack. (Let's call it '
partycancel.lua'.)
As for the problem of "religiously dedicating oneself to micromanagement", I may have a solution to that as well. It seems zwei is considering adding to
SoundSense the ability to call an external DFHack lua script via "dfhack-run". If this is added, it would be a simple matter to call said 'partycancel.lua' script after SoundSense recognizes a party logPattern such as:
"They have organized a wedding reception at (.+)\."
"The (.+) has organized a party at (.+)\."
Specifically, it might soon be possible to tell SoundSense to call "dfhack-run partycancel.lua" every time it detects that a party has started. This would involve using notepad to change a few lines in the
social.xml file (or replacing it with a modded version) in the
"social" folder inside the
soundpack.zip file for SoundSense. Normally, that file tells SoundSense to play a sound to announce parties.