duplicate inv items

Started by Captain Mostly, Thu 05/06/2003 21:19:25

Previous topic - Next topic

Captain Mostly

is there any way to tell the inventory to display duplicate items seperatly (i.e. not show the item just once in the inventory list if it appears twice or more)?

If not, would it be possible to build into a custom GUI a feature that displays "X2" next to items you have twice (or "X3" or 4 or however many the player has)...

Proskrito

Do you mean as the coins in MI2 or the orichalcum bullets in FOA? if so, if i.e. your coins inventory is #6, you could modify the amount of coins by modifying the variable character[EGO].inv[6], like, if you wantto add 60 coins to the inventory, you could write: character[EGO].inv[6]+=60; , and then , when you look to the inventory object, write something like: Display("I have %d coins",character[EGO].inv[6]); and it would say the coins you have.
If you werent asking that, i think you should make different inventory items for each one.

Scummbuddy

You could just create another inventory item with the same graphic.  The coding does not follow the name used, just the inventory number it corresponds with on the inventory screen.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Captain Mostly

thanks for the help... it's all so tricky though!

Captain Mostly

is it possible to have part of a GUI that displays a number when the pointer is over an inventory object?

i.e.

if I had 15 peas, and I pointed to them in the inventory, would it be possible to have a GUI label display the number of peas I had automatically, without me having to click?

Proskrito

yes, it would be something like:

(within the repeatedly_execute function):
string buffer;
StrFormat(buffer,"%d",character[EGO].inv[GetInvAt(mouse.x,mouse.y)]);
SetLabelText(GUI,label#,buffer);

(or this, that is the same but a bit cleaner:)

int invitem,invitemamount;
string buffer;
invitem=GetInvAt(mouse.x,mouse.y);
invitemamount=character[EGO].inv[invitem];
StrFormat(buffer,"%d",invitemamount]);
SetLabelText(GUI,label#,buffer);

change label# with the label you want to display it

Note that the "normal" inventory items will display a "1"

Pumaman

A feature like this was requested by Chrille a while back, I've added it to the tracker now to make sure it doesn't get forgotten:

http://www.agsforums.com/tracker.php?action=detail&id=68

SMF spam blocked by CleanTalk