Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: monkey0506 on Sat 14/08/2004 20:49:34

Title: Getting the character to display score... SOLVED
Post by: monkey0506 on Sat 14/08/2004 20:49:34
Just as a test of the features, I'd like to try and get the character to display the score. There are only two possible scores. 0 or 800. The only way I can find of displaying the score is @SCORE@ and @TOTALSCORE@, but I can't use these in a display message.
Title: Re: Getting the character to display score...
Post by: Scummbuddy on Sat 14/08/2004 21:29:07
i believe you can, but im away from my manual at the moment. I think it has to do with


Display("the score is %i., "variable"); or something... im not exactly sure at the moment.
Title: Re: Getting the character to display score...
Post by: Barbarian on Sat 14/08/2004 21:47:13
As an example of how to display the current score and the possible total score, you could use in a script:

Display("Score: %d out of %d", game.score, game.total_score);

Title: Re: Getting the character to display score...
Post by: monkey0506 on Sun 15/08/2004 01:51:57
Thanks. I knew about the %d thing, but I didn't realize you could use it twice in the same message for two different things.  ;D