Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Fri 09/02/2007 23:15:14

Title: Displaying Variables in Speech
Post by: on Fri 09/02/2007 23:15:14
Hey all, I'm looking for a way to display Global Variables (which I admittedly know very little about) in a speech. When examining the credit card, I want the character (EGO) to say "I have {DOLLARS} left on my card." Is there a way to do that?
Title: Re: Displaying Variables in Speech
Post by: Maverick on Sat 10/02/2007 00:00:37
Yes it is possible and you can read more about it  HERE  (http://www.adventuregamestudio.co.uk/manual/StringFormats.htm) in the manual.

You can use something like this where MyCash is your variable

Display("I have %d Dollars left on my card.",MyCash);


If you need more help on global variables  THIS  (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=19801.msg241299#msg241299)thread should do the trick.
Title: Re: Displaying Variables in Speech
Post by: Khris on Sat 10/02/2007 05:35:07
cEgo.Say("I have $%d left on my card.", GetGlobalInt(x));
Title: Re: Displaying Variables in Speech
Post by: Da_Elf on Sat 10/02/2007 14:05:48
i used a graphical variable for that rather than a global one
Title: Re: Displaying Variables in Speech
Post by: monkey0506 on Sun 11/02/2007 03:26:34
Display("You have %d dollars left.", GetGraphicalVariable("money"));
cEgo.Say("I have %d dollars left.", GetGraphicalVariable("money"));
player.Say("I have %d dollars left.", GetGraphicalVariable("money"));