Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Darth Mandarb on Thu 15/01/2004 09:56:42

Title: Displaying game.variables
Post by: Darth Mandarb on Thu 15/01/2004 09:56:42
There are certain variables in AGS like:

game.num_inv_displayed
game.num_inv_items
game.roomscript_finished
game.room_height
game.room_width
game.score

Is it possible to display these variables in game?  Like, for example, you could have an information screen that says:
Background Width : %game.room_width
(and %game.room_width would be the actual width of the room)?

Specifically I want to display (at the bottom of my inv. gui) the number of items you're carrying.  I'm guessing I need to use game.num_inv_items to do this, but how is my question.

I have tried
%game.num_inv_items
%game.num_inv_items%
%num_inv_items
-and-
%num_inv_items%

All to no avail :(

So somebody PLEASE!!! slap the obvious on me ;)

thanks!

])]V[
Title: Re:Displaying game.variables
Post by: Ishmael on Thu 15/01/2004 11:22:02
Could this do it:

string buffer;
StrFormat(buffer, "Carrying %d items.", game.num_inv_items);
SetLabelText(GUI,LABEL,buffer);

-or, if it don't work-

int numinv = game.num_inv_items;
string buffer;
StrFormat(buffer, "Carrying %d items.", numinv);
SetLabelText(GUI,LABEL,buffer);

Does it help?
Title: Re:Displaying game.variables
Post by: Darth Mandarb on Thu 15/01/2004 18:25:51
Worked like a charm!

Thanks a lot TK!

])]V[