Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: agentbauer on Tue 19/05/2009 21:01:57

Title: Global Messages as voice in AGS 2.72
Post by: agentbauer on Tue 19/05/2009 21:01:57
It might sound stupid, but I have a problem with the global messages.

I want the Narrator to say the global messages. But I don't know, how I can do this?

I already added the MP3 files named as NARR1, NARR2, etc. in the Speech folder. But I get only the text displayed....

Title: Re: Global Messages as voice in AGS 2.72
Post by: Khris on Tue 19/05/2009 21:17:06
How are you making AGS display the text? Using Display?
AFAIK, only Say & dialog script lines can have voices.
Title: Re: Global Messages as voice in AGS 2.72
Post by: agentbauer on Tue 19/05/2009 21:24:32
Yes, for example.

DisplayMessage(500);

Well, that would be a problem, if there is no possibility to get the global messages as voice, I will have to use playsound(500);
But that is not a very satisfying solution....
Title: Re: Global Messages as voice in AGS 2.72
Post by: Trent R on Tue 19/05/2009 21:57:11
Which is one reason CJ is updating the Audio system in the next version, but you would have to update to 3.2 when it comes out, and there must be some reason you're still stuck back in 2.72.


~Trent
Title: Re: Global Messages as voice in AGS 2.72
Post by: GarageGothic on Tue 19/05/2009 22:47:08
QuoteHow are you making AGS display the text? Using Display?
AFAIK, only Say & dialog script lines can have voices.

No, Display also supports voice. The question however, is whether DisplayMessage does.

First of all, have you managed to get narrator speech to play when using normal Display (not DisplayMessage) function? If not, you should try setting "game.narrator_speech = NARRATOR;" at the start of your game. Otherwise the game expects the player character to be the speaker and looks for his name in the audio files.

Now, as for global messages, MAYBE you could put "&1 " (and so on) at the beginning of the message itself, but as I said, I don't know if the DisplayMessage function supports audio and I don't have AGS 2.72 installed so  I can't check. But if that doesn't work, here's a workaround:

Display("&1 %s", Game.GlobalMessages[500]);

This should play the file NARR1.mp3 while displaying global message 500. If you number all the narrator's lines to correspond to the message numbers, you could write a small function to do this:

function DisplayNarrator(int message) {
  Display("&%d %s", message, Game.GlobalMessages[message]);
  }


Put that in the global script, import it in the global header, and then call it whenever you need to display/play a narrator message. E.g. "DisplayNarrator(500);"
Title: Re: Global Messages as voice in AGS 2.72
Post by: agentbauer on Wed 20/05/2009 16:06:29
I still use AGS 2.72 because the game I update was progammed in it.
And importing the game into AGS 3.00 was a mess.
So I stayed with AGS 2.72 for that game. My next will use the newest version.

@ GaraceGothic
Thats a good idea, I never tried this!
Thanks!