How do I fix my drag and drop inventory?

Not favoritedFavorited Favorited 0 favourites
  • 2 posts
From the Asset Store
Inventory Aid
$4.90 USD
Create grid-based game inventories and items easily.
  • Hi everyone.

    I've been trying to figure out what I'm doing wrong for a few days now, and I still haven't gotten an answer :P

    I'm working on an RPG inventory, I created a DRAG & DROP system that works, but there is one big BUT.

    All slots in the inventory are the same Inv_Slot object (highlighted in red), I change the appearance of the slots that are supposed to be slots for weapons, shields, etc.

    What I was able to achieve looks like this, and it works:

    However, a problem arises when I want the right type of equipment to go into the right slot, for example, it's a weapon that is known to go into a weapon slot, when you put it into another slot it goes back into the inventory, or when you put the wrong type of weapon into a slot, the same thing happens.

    I've tried many solutions but can't figure out how to solve it. If someone would be so kind and suggest what I am doing wrong and guide me to the right way of thinking.

    Thank you

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You'll need variables on the invslot for type and also on items for type. Then it is just a case of adding more conditions to your drop event. I would probably split them out by type so they don't become convoluted so one event is for weapon item on dropped so this only handles weapons : on items dropped (items.type=weap), sub events if invslot.type=weap and is not full then drop it, Else if invslot.type not equal weap or is full, then send it back. Then you can create a different event for drop items if item.type=armour etc

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