Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Hakujin on Thu 05/08/2004 04:46:48

Title: Can you put more than one variable in a speech?
Post by: Hakujin on Thu 05/08/2004 04:46:48
I've looked in the manual and on the forums and haven't found an answer to this. I have a dialogue that's inputting a lot of previous string variables the player entered and spitting them back out in a conversation. The problem is I can only figure out how to use one variable per character speech.

I.E.

string color = "black";
string size = "fat";
string animal = "dog";

DisplaySpeech (GUY, "You brought me a %s,", color);
DisplaySpeech (GUY, "%s,", size);
DisplaySpeech (GUY, "%s for my birthday?", animal);

which comes out:

You brought me a black,
fat,
dog for my birthday?

which looks dumb. I'd like it all in one sentence. Any way to do this? Or am I asking the impossible?

Any pointers would be greatly appreciated.
Title: Re: Can you put more than one variable in a speech?
Post by: Gilbert on Thu 05/08/2004 06:08:17
You can use as many as you want actually, eg.

DisplaySpeech(BLAH, "I put an %s into a %s.", name1, name2)
Title: Re: Can you put more than one variable in a speech?
Post by: Hakujin on Thu 05/08/2004 06:50:19
Wow! So you can! And it's so easy. Thanks a lot Gilbot V7000a. Everything looks much better now.