Game authors and players, please read this thread!

Author Topic: Getting global messages to display as speech  (Read 567 times)  Share 

remixor

  • The Idle Thumb
Getting global messages to display as speech
« on: 01 May 2003, 05:49 »
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.
Writer, Idle Thumbs!! - "We're probably all about video games!"
News Editor, Adventure Gamers

miguel

  • Onions?
  • miguel worked on a game that was nominated for an AGS Award!
Re:Getting global messages to display as speech
« Reply #1 on: 01 May 2003, 10:50 »

ThunderStorm

  • Don't ask me why.
    • I can help with AGS tutoring
    •  
    • I can help with translating
    •  
Re:Getting global messages to display as speech
« Reply #2 on: 01 May 2003, 11:41 »
There's an option "Always display text as speech" in the game options tab.

scotch

  • Mittens Baronet
Re:Getting global messages to display as speech
« Reply #3 on: 01 May 2003, 12:10 »
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)

miguel

  • Onions?
  • miguel worked on a game that was nominated for an AGS Award!
Re:Getting global messages to display as speech
« Reply #4 on: 01 May 2003, 12:37 »
thanks for that scotch, I will use it myself

Scummbuddy

  • Mittens Knight
  • Give Stylish Confetti to BoZo - Wheee!
    • I can help with AGS tutoring
    •  
    • I can help with animation
    •  
    • I can help with backgrounds
    •  
    • I can help with characters
    •  
    • I can help with proof reading
    •  
    • I can help with scripting
    •  
    • I can help with story design
    •  
    • I can help with voice acting
    •  
Re:Getting global messages to display as speech
« Reply #5 on: 02 May 2003, 01:21 »
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.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

remixor

  • The Idle Thumb
Re:Getting global messages to display as speech
« Reply #6 on: 02 May 2003, 10:26 »
Thanks a ton, scotch.  I never would have thought of that but it makes total sense  ;D
Writer, Idle Thumbs!! - "We're probably all about video games!"
News Editor, Adventure Gamers