Author Topic: Adding Sound based on Message Buffer - help appreciated  (Read 5993 times)

RiC David

  • Newcomer
  • Posts: 18
  • Karma: +0/-0
    • View Profile
    • Email
Adding Sound based on Message Buffer - help appreciated
« on: July 15, 2014, 10:30:04 PM »
[TL;DR Note]  While writing this, I managed to find a file containing the message2sound script so you can skip ahead to the 'Fake Edit' if you don't want to hear me set the stage, so to speak

Hi,

After playing a Brogue 1.7.3 mod that added sound based on message buffer events, I really want to learn how to either apply that mod to newer versions of the game or put such a script together myself and before I go any further I'd appreciate if you could tell me whether this is too complex a task for a programming novice such as myself.

I've been nosing around the files of the modded Brogue (LazyCat's 1.7.3 fork - found here: http://skylink.dl.sourceforge.net/project/brogueaudio/Brogue-AUDIO_v9x.zip) but have yet to find the elusive file that details the process. The current release of Angband (3.5.0) includes optional event based sound and also an easy to understand/modify config file; it will say things like "hit_good = goodhit.mp3" which tells me how it tells the game which sound file to play but not all importantly how it tell the game to run these scripts when message events occur.

In the lib/pref folder of Angband are some other promising files such as the message.prf file that tells the game which colour to print the messages in and also mentions that some messages aren't even actually printed and only exist so that sounds can be played when they occur. Another piece of the puzzle but again still no clue as to how they made the game associate messages with file executions.

[Fake Edit]

Further digging has shown me that the current sound functionality is the work of 'Dubtrain' (http://www.dubtrain.com/angband) and is based on 'Craig's Angband Sound Patch' (http://www.chambrook.org/angband/soundfx.php) which in turn is an evolution of Tim Baker's 'AngbandTK' (can't locate this). Craig's patch is a diff file that contains the scripting and man does it look intimidating; that said, some parts seem relatively straight forward like the following which appears to be the core message2sound instruction:

Code: [Select]
@@ -283,6 +292,7 @@
  {
  act = "claws you.";
  do_cut = 1;
+ sound_msg = MSG_MON_CLAW;
  break;
  }

(This would work in conjunction with the sound.cfg file that says "mon_claw = example.mp3")

I'd post the whole file but I see we can't use [spoiler] BBC and nobody's going to want to see pages and pages of coding so all I can do is point you toward the Zip containing the file in question (soundfx-patch.diff) - http://www.chambrook.org/angband/angband-3.0.5-soundfx.zip.

I've probably answered my own question - yes, yes it is far too complex for me to even consider undertaking, but if by any slim chance that intimidating diff file is constructed in some noob friendly manner (say, some GUI that creates the script) then please let me know.

Alternatively, if anyone can tell me where the message2sound script is located in LazyCat's sound mod so I can just transfer this to the latest version of Brogue (1.7.4) then that would be a whole hell of a lot easier; the only reason I want to do all of this is so I can continue playing the updated game with sound!

Thank you so much for reading and I hope I've been clear and informative,

-RiC