Howdy, Stranger!

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

2 questions regarding the Inventory system [Sugarcube]

edited October 2016 in Help! with 2.0
I am currently using this inventory system: https://twinery.org/wiki/twine2:add_an_inventory_system

1.) I was wondering how to add items to an inventory if you allow for multiples of the same item? As an example:

I have 1 potion in my inventory, and then pick up another potion. The inventory should now have 2 potions.

2.) Is there a way to make two separate inventories using the code in the link above? This is because I'd like to make a separate inventory for special items that won't count toward the maximum amount you can have in the inventory. I know I can make a standard array for the special items inventory, but I would also like to use the InvWithLinks macro that would set up a new passage for every special item listed, and I don't know how to do that on my own. /sheepish

I'm using the latest Twine 2 and Sugarcube 2 updates. Thank you!

Comments

  • I think I figured out my question #2 on my own. Simply use the inventory macros in the link I posted above to copy and paste another instance of it on your Javascript passage, but rename the "Inv" and "inventory" variables there to whatever other variable you want.

    Just confirming if this is right, but it's working for me so far!
  • Coraline wrote: »
    1.) I was wondering how to add items to an inventory if you allow for multiples of the same item?
    That inventory system does not support quantities, being more of a key item type of inventory—i.e. either you have an item or you do not. So, you cannot add multiple instances of the exact same item.

    Coraline wrote: »
    2.) Is there a way to make two separate inventories using the code in the link above? This is because I'd like to make a separate inventory for special items that won't count toward the maximum amount you can have in the inventory.

    […]

    I think I figured out my question #2 on my own. Simply use the inventory macros in the link I posted above to copy and paste another instance of it on your Javascript passage, but rename the "Inv" and "inventory" variables there to whatever other variable you want.
    That should work, yes.
  • Thanks for that!
Sign In or Register to comment.