Displaying game.variables

Started by Darth Mandarb, Thu 15/01/2004 09:56:42

Previous topic - Next topic

Darth Mandarb

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[

Ishmael

#1
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?
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Darth Mandarb

Worked like a charm!

Thanks a lot TK!

])]V[

SMF spam blocked by CleanTalk