Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: ktalebian on Thu 21/12/2006 07:14:22

Title: Global Message
Post by: ktalebian on Thu 21/12/2006 07:14:22
Hi
How can I make the global messages look like someone's line? Because when I run a global message, it shows it in the white background! I want it to look like as if it is being said by that character.
thx
Title: Re: Global Message
Post by: Creator on Thu 21/12/2006 07:56:20
I think you're trying to make a character besides the player say something right, if so:

character[...].Say("INSERT TEXT HERE");

Put the character's script name where ... is
Title: Re: Global Message
Post by: Ashen on Thu 21/12/2006 11:05:39
You can also use the Script-O-Name (and probably should, as it's easier to type). I.e.:

cNpc.Say("Insert text here");

This is exactly the same as character[NPC].Say but, as I said, quicker to type. Either way will work, though.

EDIT: Thanks, Khris. Damn sticky capslock being right above the shift key...
Title: Re: Global Message
Post by: Khris on Thu 21/12/2006 11:17:25
It's cNpc.Say("..."); :=
Title: Re: Global Message
Post by: ktalebian on Thu 21/12/2006 19:02:56
I know that! But I wanted to use the global messages. Like, when the character interacts with something that would not do anything, u would put some different things that he can say and randomly select one. And if I want to change the sayings, all I have to do is to change the global messages. But if I use character.say(), then it would not be universal!
Title: Re: Global Message
Post by: Ashen on Thu 21/12/2006 19:36:29
Sorry, that's what happens when I read a reply, but not the actual question...

What you want is in the Manual: Game.GlobalMessage (http://www.adventuregamestudio.co.uk/manual/Game.GlobalMessages.htm), e.g.:

player.Say(Game.GlobalMessage[527]);

Will have the player say Global Message 527.

To randomly select from a couple of messages:

int Mess = 500+Random(5);
player.Say(Game.GlobalMessage[Mess]);


Will randomly display one of messages 500-505.

(For earlier versions, use GetMessageText.)

There's no more direct way, AFAIK. Out of curiousity, why are you using Global Messages anyway? There can't be that many cases where they're easier to use for speech than just scripting it.