Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: remixor on Thu 01/05/2003 05:49:19

Title: Getting global messages to display as speech
Post by: remixor on Thu 01/05/2003 05:49:19
Hi, another question from your resident AGS idiot.

I'm trying to get global messages to display as character speech, but I can't figure out how to to do that other than to check the "Always display as speech" option, which I don't want to check in case I need to display messages as text boxes.  I tried "DisplaySpeech" but that requires a string input, not an integer referring to a message.  How can I get around this?  I assume it's a simple solution I just can't figure out.
Title: Re:Getting global messages to display as speech
Post by: miguel on Thu 01/05/2003 10:50:57
I think you´ll have to input text using displayspeech, I had to do it.
It should be an option to declare global messages to be displayed as speech or normal messages, don´t you think?
Title: Re:Getting global messages to display as speech
Post by: ThunderStorm on Thu 01/05/2003 11:41:50
There's an option "Always display text as speech" in the game options tab.
Title: Re:Getting global messages to display as speech
Post by: scotch on Thu 01/05/2003 12:10:17
Put this in your global script:

function SayMessage(int person, int message) {
 string buffer;
GetMessageText (message, buffer);
DisplaySpeech(person, buffer);
}

and this in your script header:

import function SayMessage(int , int);

Then you can use the function like
SayMessage(0, 998);

which should make character 0 say 'You run your hands up and down you clothes.' (unless you changed that message of course)
Title: Re:Getting global messages to display as speech
Post by: miguel on Thu 01/05/2003 12:37:12
thanks for that scotch, I will use it myself
Title: Re:Getting global messages to display as speech
Post by: Scummbuddy on Fri 02/05/2003 01:21:10
Or, you could select that option to use all messages like text, and then when you would actually need the text box, create it as a gui or something, and have it called for.
Title: Re:Getting global messages to display as speech
Post by: remixor on Fri 02/05/2003 10:26:24
Thanks a ton, scotch.  I never would have thought of that but it makes total sense  ;D