Forum rules - please read before posting.

Multiple Inventories?

Hi guys.

Can anyone tell me if there is a way to have multiple inventories?

My project requires multiple inventories to work as I desire.
Basically put, my scenes include multiple buildings, some of which are 'trade points' for want of a better word.

The player will enter these points via a hotspot, where I desire to show an individual inventory for this 'trader'.
Hopefully, I can work it out so the player views such an inventory, which contains items he can purchase, which will be added automatically to the player 'storage' inventory. I also desire the inventory to show the item image, price and weight.
I would also like the items available to be random at each visit through the use of variables.

Is this at all possible? If so, how would I go about it?

Or is there a better way to approach this?

If you need more specific info, please ask.
I thought I would just throw the basic concept in first!

Thanks for any advice in advance!
Regards Chris

Comments

  • Good timing.

    As part of AC's upcoming v1.72.0 update, I am overhauling the inventory system - making it much easier to script custom inventory management. As a guided example, I'll also be releasing a "shop system" as a downloadable extra.

    The basic principle involves using Containers to hold a shopkeeper's inventory, with tradable items placed in a specific category in the Inventory Manager. Using properties, each item has a value, which is then compared with the amount of currency (another item) the Player is holding.

    As the desired behaviour will vary with your needs, custom scripting is necessary for this - but not much. You can, for example, extend things to extract other property values (e.g. weight) upon clicking an item.

    Containers are an existing feature, and you can already use a Variable: Check Action followed by a Container: Add or remove Action to modify a Container's contents based on variable values. However, it'd be easier IMO to script that as well.

    PM me if you'd like to be involved in testing.

  • Thanks Chris. I have pm'd.
  • Hi Chris

    When is this update due out?

    Olly
  • It already is - see the release notes here.

  • So, I am going to add a question. How do you connect a container to the UI? I see the option to make an inventory box and a way to set the inventory box type to a container. However, how do I specify which contianer is shown?

    I have more than one inventory shown at different locations on a menu with different items. Like, "guns", "ammo", etc.

  • An InventoryBox element can be mapped to a specific Container in one of two ways:

    1. Through the use of the Container: Open Action, checking Open in set element? and then assigning the names of the Menu and Element names to display it in.
    2. Through scripting, setting the InventoryBox element's OverrideContainer property:

      (AC.PlayerMenus.GetElementWithName ("MyMenu", "MyContainerElement") as MenuInventoryBox).OverrideContainer = myContainer;

    In either case, if your Container is intended to be viewed at all times then you'll need to make it "global" so that it is present in all scenes. A script to aid with this can be found on the wiki here.

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.