Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: DCillusion on Sat 08/11/2003 04:14:59

Title: Display Multiple Items
Post by: DCillusion on Sat 08/11/2003 04:14:59
I had a question earlier about having different amounts of the same item (7 coins for example) that was answered beautifully.

However, I'm not sure how to display the amount to the player

Option 1: Coin x "value" reads beside the item in the inv screen.

Option 2: "clicking" on the coin in the inv screen displays the value in a text box.
Title: Re:Display Multiple Items
Post by: Ishmael on Sat 08/11/2003 11:44:44
1: Make a label to the GUI, and in the Global Rep_Ex, put:

string moneynum;
StrFormat(moneynum,"%d",character[EGO].inv[x ]); // I'm not 100% sure of the syntax, so check the manual if this doesn't work. Replace the x with the inv item number
SetLabelText(GUI, LABEL, moneynum); // Replace the GUI with the GUI's name and LABEL with the coin label number.

2: Just use in the Look at Inv:

Display("You have %d coins.", character[EGO].inv[x ]); // here too, replace x with the coin inv item number, also, you can take the spare space after it away