Forum rules - please read before posting.

Inventory Offset by Grid Width (row) instead of element number

Hello everyone,

I'm quite far into the development of my game (80% done, argh! I can't believe it!). Anyways, I play through it quite often and I'm always looking to make little improvements. One, is that I'd love to be able to offset the inventory by Grid Width (or by an entire row) rather than a number of elements. This would move an entire row up, rather than off-set all elements by a designated number. Does that make sense? To illustrate:

Currently, Adventure Creator will do the following with 9 items an inventory grid of 4X2:

1234
5678

When shifting down (let's say) it will look like this:

2345
6789

This just offsets all the inventory items. It can be confusing to look at. With that in mind, I want it to look like this when shifting down:

5678
9

If anyone can help with this, that would be superb. I think I saw Chris respond to someone in 2014 about something similar, but I haven't located this feature in Adventure Creator. Let me know. Thanks!

Comments

  • Though the default is 1, you can change the amount by which your inventory is offset via the Offset amount field in the Button menu element that has a Click type of Offset Element Slot.

    However, you will face an additional problem in that shifting only occurs when there's non-empty space left. In your example, shifting twice to the "right" would result in:

    1234
    5678
    6789

    I shall have to think about how the lone "9" might be achieved.

  • edited December 2018

    Thanks for the response! Yeah, I was playing through Thimbleweed Park and Day of the Tentacle again and realized inventory in adventure games don't really "offset", they shift by entire row.

    At the moment, my game has a large inventory box (which pops up in the middle of the screen in the vain of Monkey Island 3) with a grid of 5x4, so there are 20 element spaces. I have it shift by 5 (like you described), and this works well when you have a number of inventory items in multiples of 5. But if the player has, say, 23 inventory items, I want the player to be able to see items 21, 22, and 23 on their own row. Is it possible to create a "Offset by row/column" feature?

    I look forward to any changes. Always, a pleasure. I literally cannot make the game of my dreams without what you have developed here. Great support as always!

  • Is it possible to create a "Offset by row/column" feature?

    I suspect so, but not in this exact manner - since the limitation of the offset amount is set by the element being shifted, not by the Button doing the shifting.

    When shifting by e.g. "5" and only 3 items are left, the InventoryBox will cap the maximum shift about to 3. I will look into the possibility of making the reduction optional.

  • edited December 2018

    Sounds great! I suppose for it to work correctly it would be set up like columns and rows in an excel doc. Item 1 goes to A1, Item two goes to B1... item five to E1... item 20 to E4 (that's for a 5X4 box). Then when there are more items than the maximum, the shift button is acting more like a scroll. So, whether there are X<5 items a row (a row beyond the first 20 items) they will remain in their respective slots. The whole row just moves up. Sounds more like scrolling than shifting.

    And when an item is removed, everything then moves back one spot. This is probably the tricky part.

    Anyway, I look forward to any additions. Thanks for responding!

  • edited March 26

    Since this thread was already discussing exactly what I'd like to implement in a Unity UI Inventory, thought I'd ask here to see if I might've missed anything in an update related to shifting by row, etc. I've searched though the forum and manual, and haven't found anything related in an update yet. Also looked thoroughly in AC's menu manager under "Inventory" for relevant settings.

    If there wasn't an update for this, please feel free to share if there's some other way that would work -- using Unity UI (in Unity 2019.3.1f1 and AC 1.70.4, if needed)

    Have tried setting the amount by which the inventory is offset via the "Offset amount" field, as mentioned above, though also as mentioned it's not exactly the desired result. Many adventure games that have this type of inventory have item shifting by full rows / columns, etc. so it feels that it would be expected by players.

    If more details are helpful, I've a menu that's essentially like the example in the thread's first post, but more like this layout: Screenshot: https://imgur.com/a/8yF6sUF
    1 | 2
    3 | 4
    5 | 6
    7 | 8
    9 | 10
    11|12

    Thank you for any assistance!

  • So you're looking to shift the slots by 12 each time?

    I had thought that by adding "empty" items to the list might allow for it, but AC routinely removes empty slots from the end automatically. Please leave this with me - I shall think on what can be done to enable this.

  • Tried shifting by 12, though that felt like too many at once to achieve an effect that only one row is shifting down/up at a time.

    I then set the "Offset amount" field to 2, and that feels like a more natural way to shift one row down/up at a time (in an inventory that is 2 columns wide, or 2 items across). Believe that amount would be good.

    If possible, it would still be nice to be able to customize the "offset amount" -- though it likely makes things more complex.

    Thank you again for looking into it, and for your assistance! It's appreciated.

  • I'm forgetting myself - uncheck Limit maximum scroll? in the InventoryBox element's properties.

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.
Do NOT follow this link or you will be banned from the site!