Disregarding the
module that SSH made (

), I've modulized
Scorporius's queued background speech code:
1 October 2016: Thanks
cat for pointing out some heinous coding on my part, I've uploaded v4.1 with a bugfix. Everything else is the same, see thread for details.
27 January 2015: I have updated this module to v4.0, with a revised interface and dynamic queue sizing. This allows you to add basically as many items to the queue as you want at one time (*current maximum is actually 1000000, but queue is dynamically sized to preserve memory). The new version also has improved handling if the character speaking in the background starts moving - they will be released from their speech view and continue their movement.
Example:void InitializeBackgroundDialogue()
{
QueuedSpeech.ClearQueue();
QueuedSpeech.Looping = true;
QueuedSpeech.Paused = true; // don't start the queue right away
cEgo.SayQueued("Gee, I wonder where Bob wondered off to...");
cEgo.SayQueued("When I find him, I'm gonna knock his block off.", null, 120); // add a delay to this message
cEgo.SayQueued("That'll show him.");
}
function room_Load()
{
InitializeBackgroundDialogue();
}
function hRug_Interact()
{
QueuedSpeech.Paused = false; // start thinking about Bob
}
Requires AGS 3.4.0.3 or higher!Download v4.125 January 2013 Four years later... Updated the module to work with the new-style audio clips. If you want to use the old-style audio system then just stick to v3.0 because v3.5 isn't backwards compatible. See the included documentation for full changelog. Notably, the Character.SayQueued method now requires an AudioClip* for voice speech, instead of formatting it into the message string.
08 January 2009 After nearly a full three years since the last update to this thread...I figure it's time to get this download back up. And I had a bit of fun toying around with making a demo. Hijacked RON sprites and all. Oh, and Microsoft SAM speeching!