Global Message

Started by ktalebian, Thu 21/12/2006 07:14:22

Previous topic - Next topic

ktalebian

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

Creator

#1
I think you're trying to make a character besides the player say something right, if so:

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


Put the character's script name where ... is

Ashen

#2
You can also use the Script-O-Name (and probably should, as it's easier to type). I.e.:
Code: ags

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...
I know what you're thinking ... Don't think that.

Khris

It's cNpc.Say("..."); :=

ktalebian

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!

Ashen

#5
Sorry, that's what happens when I read a reply, but not the actual question...

What you want is in the Manual: Game.GlobalMessage, e.g.:
Code: ags

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

Will have the player say Global Message 527.

To randomly select from a couple of messages:
Code: ags

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.
I know what you're thinking ... Don't think that.

SMF spam blocked by CleanTalk