Trouble with custom inventory

0 favourites
  • 9 posts
From the Asset Store
Supports keyboard, mouse and gamepads. Supports several gamepads at once.
  • Capx link

    I'm working on an inventory system, and after a traditional slot based system, my friend suggested to try a simpler circle inventory where items are locked into the circle but can be dragged around freely.

    It took me a while to debug this, but I'm running into one last problem here. The test item would either be stuck in the top-left tip, is draggable, but would lock back to original position, or the item would be entirely invisible after pickup and I would find out it was an an odd co-ords, like 70 and -262.

    I've got this down to a static pos but draggable item. Anybody want to help me fix this?

  • Okay, I've gotten a little further. I managed to be able to set a default x/y when picked up, but I can't get the test item to lock to the inventory circle if it goes outside of it.

    Reupload my capx, the one with a semi-working inventory.

  • Anybody got a solution?

  • I'm confused. I can't see a circle inventory or draggable items. Please explain what the problem is more clearly as I can't work it out from playing this game. I walk around and he picks up items and they go in the inventory.

  • My bad, I forgot to fix something in the capx.

    Re-download it.

    Pickup the item (the one that looks like a chunk of wood). Click the icon that is a set of graph bars, and click the green arrow icon until you reach the inventory. Items can be dragged around, but I need them to be reset to the center of the circle if they go outside the edge.

  • Just use the logic you are using for assigning to slots and say that when item is dropped, if not occupying a slot, set position to inside circle.

  • I need this this to function on the gui screen, and not when the player drops an item.

    They can be dragged around freely on the gui. But, I need the items locked to the circle, where they will be reset back to the center of the circle if they leave/overlap the outside edges.

    I figured one way of doing this is setting a ton of image points on the circle's edge, and checking if 'item x' overlaps with image point n's x/y, but that would be extremely cumbersome to do.

    I've also tried "is overlapping/is not overlapping" checks, but they don't work as the item is always overlapping the main gui sprite. The circle is a separate sprite overlaid on the gui, and it's a layer above the main gui's layer.

    I've also tried setting the inventory overlay to the same layer as the inventory gui, and lowering the item layer (topmost) to what used to be the inventory overlay's layer. Still nothing.

    I've also tried setting an animation if it goes outside of the circle, this works fine but when I try a condition check if "outsideframe" animation is playing, nothing happens. Sure, I've it "works", but it doesn't reset as I expect it to, even when I strip the event down to it's bare minimums to work.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Any help on this?

  • I really don't understand how your game works, but maybe you could use the clamp expression to prevent things going out of the circle edges.

    Or you could just use the distance expression to compare the distance of the sprite to the center of the circle.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)