Drag and drop equip with more than one inventory?

Cheapshampoo

New member
I'm looking for a way to have a second inventory open with my main inventory for equips. I want it to be a drag and drop equip system where I can drag a helmet, chest, pants, etc. into their slots both ways and have a script to read whats in the slot. I tried adding a second inventory but once I drop an equip on it, it disappears. I've also ruined my main inventory and had to restart my game from a backup because I couldn't undo it.

attached png for an example.inv.png
 
Do you really need a second Inventory or could it be another ItemCollection within the same Inventory?

Drag&Drop uses conditions&actions to move things around. By default we use the "smart" condition and action. But that might not always work depending on the setup.
You may have to setup some conditions and actions specific to your use case. Learn more here:

Although from what you explained I would have assumed the smart drop condition action would have done the trick, maybe there is something else that was preventing the item from moving. Or perhaps you aren't using the smart move for placing items on the second inventory.

Could you send me a screenshot of your Drop handler inspector?
 
Sorry I haven't got back sooner. I cant replicate what I did before. I've been trying new. I made an inventory that should be like the others in the list. Equip.png

Maybe I'm missing something because it wont show when I open the main inventory.

I've tried doing this in the script.
equip2.png

Thanks for any help!
 
Make sure your ItemSlotCollectionView is bound to the panel. (Check the equipment feature scene for a simple working example)

Also make sure your panels are set as non-selectable of you are opening multiple ones at the same time.

PS: I will be on holiday starting this afternoon so I won't be able to answer messages for awhile
 
I think this is what I need to get info from specific slots. I'm just not sure how to use it. I can't figure out what m_Inventory is, and what the ID would be.
Code:
var equipmentItemCollection = m_Inventory.GetItemCollection(m_EquipmentItemCollectionID) as ItemSlotCollection;

And then this would work to get attributes like a def int, or a string?
Code:
itemInSlot = equipmentItemCollection.GetItemInfoAtSlot(slotName);


Happy Holidays!
 
Last edited:
I've made some good progress the last couple days.

I got far enough that I can drop items into specific slots on my equip inventory, but once i drag it out of the slot, it will go into any other slot.
I've tired making some Item Restriction Set object to place in the Inventory script of slots, but that doesn't work.
inv2.png

inv.png
itemviewrestriction.png
I used this Item view slot category restriction to restrict from my main inventory to the equip slots.

think I'm getting there!
 

Attachments

  • animatorerror.png
    animatorerror.png
    103.3 KB · Views: 7
Last edited:
Top