Forum rules - please read before posting.

Carry multiple items 2/5 ?

edited July 2015 in Technical Q&A
Is there a way to carry multiple items in a manner: 2 out of 5 found, like 2/5 and when you find the same item one more time you make it  3/5?

Like on this picture?
image

I know I can set global variables of 5 integer and then remove old item and add the new one with a new picture of 1/5 then 2/5 and so on when I find objects. But is there an easier way, with out making 5 more images with numbers of objects found?

Cheers

Comments

  • You can carry multiple instances of the same item by checking "Can carry multiple" in the item's properties box, but you can't limit it.  The number you're carrying will appear in the menu.

    To have the "/5", assuming you were using Unity UI, you'd have to have that text in a separate Text component and set it's value manually, based on the item that's in it's slot.  Something like this:

    MenuElement menuElement = PlayerMenus.GetElementWithName ("Inventory", "InventoryBox");
    MenuInventoryBox menuInventoryBox = (MenuInventoryBox) menuElement;
    InvItem item = menuInventoryBox.GetItem (2); // slot 2
    if (item.id == 4) // Item with ID of 4
    {
      myLabel.text = "/5";
    }
  • Chris I'm using AC UI source for my inventory.
  • Then you would have to amend the GetCount () function within MenuInventoryBox.cs
  • Thanks Chris :)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.