Jibble

Author Topic: MODULE: QueuedSpeech v4.1 - Updated 1 Oct 2016 (Bugfix edition)  (Read 14633 times)

monkey0506

  • SEND PIZZA.
    • Best Innovation Award Winner 2017, for his work to help AGS games reach the widest possible audience - through popular distribution platforms (Steam, Galaxy) as well as other operating systems (Android, Linux)
    • monkey0506 worked on one or more games that won an AGS Award!
    •  
    • monkey0506 worked on one or more games that was nominated for an AGS Award!
Disregarding the module that SSH made (:P), 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:

Code: Adventure Game Studio
  1. void InitializeBackgroundDialogue()
  2. {
  3.   QueuedSpeech.ClearQueue();
  4.   QueuedSpeech.Looping = true;
  5.   QueuedSpeech.Paused = true; // don't start the queue right away
  6.   cEgo.SayQueued("Gee, I wonder where Bob wondered off to...");
  7.   cEgo.SayQueued("When I find him, I'm gonna knock his block off.", null, 120); // add a delay to this message
  8.   cEgo.SayQueued("That'll show him.");
  9. }
  10.  
  11. function room_Load()
  12. {
  13.   InitializeBackgroundDialogue();
  14. }
  15.  
  16. function hRug_Interact()
  17. {
  18.   QueuedSpeech.Paused = false; // start thinking about Bob
  19. }

Requires AGS 3.4.0.3 or higher!

Download v4.1

25 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!
« Last Edit: 02 Oct 2016, 05:22 by monkey0506 »

Lazarus

  • I'm going as fast as I can!
Re: MODULE: QueuedSpeech
« Reply #1 on: 05 Dec 2005, 10:45 »
I was wondering if this module lets to speech to continue running while the player is interacting with objects etc..

thanks
« Last Edit: 19 Apr 2006, 23:56 by strazer »
*Currently using AGS Editor 2.70 (Build 2.70.601)*

monkey0506

  • SEND PIZZA.
    • Best Innovation Award Winner 2017, for his work to help AGS games reach the widest possible audience - through popular distribution platforms (Steam, Galaxy) as well as other operating systems (Android, Linux)
    • monkey0506 worked on one or more games that won an AGS Award!
    •  
    • monkey0506 worked on one or more games that was nominated for an AGS Award!
Re: MODULE: QueuedSpeech
« Reply #2 on: 05 Dec 2005, 11:28 »
The text will be removed if you interact with an object.  I'll try to get that fixed, but do realize that the view is locked (with Character.LockView) to the character's speech view, so if you have any sort of animation for picking objects up or anything, that wouldn't be played.
« Last Edit: 19 Apr 2006, 23:56 by strazer »

monkey0506

  • SEND PIZZA.
    • Best Innovation Award Winner 2017, for his work to help AGS games reach the widest possible audience - through popular distribution platforms (Steam, Galaxy) as well as other operating systems (Android, Linux)
    • monkey0506 worked on one or more games that won an AGS Award!
    •  
    • monkey0506 worked on one or more games that was nominated for an AGS Award!
Re: MODULE: QueuedSpeech v2.2 BETA
« Reply #3 on: 18 Apr 2006, 23:39 »
New BETA, so I figured I'd let everyone know.

This BETA is primarily for the testing of multiple queues, so let me know how it works for you (you can set the number of queues per game (eQueuedSpeech_MaxQueues) and number of items per queue (eQueuedSpeech_MaxOptions) (come to think of it, that should probably be renamed) in the module header.

Please note (for those who aren't going to read the first post's edit) that looping does not currently work, I'm working on implementing that right now.  And there are no checks to prevent the same player from talking simultaneously in multiple queues, so that could create some confusion.  I'll add something to prevent it.

monkey0506

  • SEND PIZZA.
    • Best Innovation Award Winner 2017, for his work to help AGS games reach the widest possible audience - through popular distribution platforms (Steam, Galaxy) as well as other operating systems (Android, Linux)
    • monkey0506 worked on one or more games that won an AGS Award!
    •  
    • monkey0506 worked on one or more games that was nominated for an AGS Award!
Multiple queues was a foolish idea anyway. :=

Idealistically this should one day be able to take advantage of actual speech files but for now it uses sound files for speech. Looping is functional as displayed in the demo. Also it would be wonderful if the speech could be played in an ambient manner similar to that of PlayAmbientSound...for those wondering the reasoning behind not using PlayAmbientSound as-is stands because that would cause the sound to loop and there's no way of determining when it has finished playing.

Oh, further, I've drastically decreased the default queue size in this module down to only 30 items. You should be able to raise it without problem.
« Last Edit: 08 Jan 2009, 08:48 by monkey_05_06 »

This is part of another problem I'm having but I think it just involves this module. The speech is displaying weird. I am using the smooth parallax scroll module, 640 x 400, and 32 bit color. Here is a screen shot of what happens.




Dave Gilbert

  • Mittens Vassal
  • AGS Baker
  • Eye see you.
    • Lifetime Achievement Award Winner
    • Dave Gilbert worked on one or more games that won an AGS Award!
    •  
    • Dave Gilbert worked on one or more games that was nominated for an AGS Award!
Hello!  Sorry for digging up this old post, but this module is *perfect* for my current project.  I got it working perfectly, but I encountered the same text color issue as JoelPhilippage above.  The game is 640 x 480 and 32 bit color.  Is there around this problem? 

monkey0506

  • SEND PIZZA.
    • Best Innovation Award Winner 2017, for his work to help AGS games reach the widest possible audience - through popular distribution platforms (Steam, Galaxy) as well as other operating systems (Android, Linux)
    • monkey0506 worked on one or more games that won an AGS Award!
    •  
    • monkey0506 worked on one or more games that was nominated for an AGS Award!
I'm sorry, I'm not aware what the problem is! :o

I guess I must have overlooked joel's post (sorry!!). So from the screenshot it looks like the top line is being cut off, correct? I have a job interview to go to ATM but when I get back I shall investigate!!

Dave Gilbert

  • Mittens Vassal
  • AGS Baker
  • Eye see you.
    • Lifetime Achievement Award Winner
    • Dave Gilbert worked on one or more games that won an AGS Award!
    •  
    • Dave Gilbert worked on one or more games that was nominated for an AGS Award!
Hi monkey!  Basically the problem is the weird magenta dots that surround the text.  It looks like an AGS sprite that was badly imported.

Looks like you're using anti-aliased fonts which would create this effect when drawn onto a transparent surface. The easy fix is to just add a "SetGameOption (OPT_ANTIALIASFONTS , 0);" before the DrawingSurface routines in the module (and reset it after the drawing), but for a smoother look, there's also some suggestions mentioned in this thread on how to achieve an antialiased effect on a transparent overlay.

monkey0506

  • SEND PIZZA.
    • Best Innovation Award Winner 2017, for his work to help AGS games reach the widest possible audience - through popular distribution platforms (Steam, Galaxy) as well as other operating systems (Android, Linux)
    • monkey0506 worked on one or more games that won an AGS Award!
    •  
    • monkey0506 worked on one or more games that was nominated for an AGS Award!
You mean like this one? ::)

Dave Gilbert

  • Mittens Vassal
  • AGS Baker
  • Eye see you.
    • Lifetime Achievement Award Winner
    • Dave Gilbert worked on one or more games that won an AGS Award!
    •  
    • Dave Gilbert worked on one or more games that was nominated for an AGS Award!
Looks like you're using anti-aliased fonts which would create this effect when drawn onto a transparent surface. The easy fix is to just add a "SetGameOption (OPT_ANTIALIASFONTS , 0);" before the DrawingSurface routines in the module (and reset it after the drawing), but for a smoother look, there's also some suggestions mentioned in this thread on how to achieve an antialiased effect on a transparent overlay.

That worked, GG.  Thank you!

Do you have the source code for the demo?
Stuart "Sslaxx" Moore.

This module does not allow walking and talking. Has anyone found a solution to this?



Hello!  Sorry for digging up this old post, but this module is *perfect* for my current project.  I got it working perfectly, but I encountered the same text color issue as JoelPhilippage above.  The game is 640 x 480 and 32 bit color.  Is there around this problem? 

I know this thread isn't current anymore, but I have found the solution for the speech color issue. Took me a while to find it, so to save you the hassle...

In line 116 is the command: Overlay *newOverlay = Overlay.CreateGraphical(x, y, sprite.Graphic, true);

You have to change "true" to "false" and it will display the color properly.

monkey0506

  • SEND PIZZA.
    • Best Innovation Award Winner 2017, for his work to help AGS games reach the widest possible audience - through popular distribution platforms (Steam, Galaxy) as well as other operating systems (Android, Linux)
    • monkey0506 worked on one or more games that won an AGS Award!
    •  
    • monkey0506 worked on one or more games that was nominated for an AGS Award!
Bump for new version. In case anybody cares.

As for the transparency issue, as far as I can tell it's only related to fonts with anti-aliasing. From what the manual has to say on the "transparent" parameter for Overlay.CreateGraphical, it doesn't seem a viable "bug-fix" but if anyone confirms and lets me know then I'll swap out the line.

Regarding "walking and talking", I'm not sure what the intended purpose was, but the Overlay will not follow characters around the room. I imagine that would be relatively simple to implement if anyone needs it, so again feel free to let me know.

Excelent work! I've been searching for something like this that works properly for days now, so many of the modules are incompatable with the new AGS, but this one is great!

The hosting account that these files were on is saying the account is suspended - is there anywhere else this module is available?

Dualnames

  • Local Moderator
  • Rottwheelers
  • Pretty Badass
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!
Of course, I believe I've hosted it here: http://duals.agser.me/Modules/QueuedSpeech_v3.0.rar I think that doesn't cover version 3.5. Currently a bit on the army side of things, but I'll have standard access to my harddrive rather shortly, if you can wait by then.
No more military army stuff. I'm alive and back.

Where can I download this 3.5 version? ???
- Luke