|
Post by athellboy on Jul 24, 2018 4:48:23 GMT
Hey there, I have a problem to show both sword and bow in the equipment slot and can switch between them. As I notice I should change Inventory prefab and add these 2 weapons in the Item Manager. These are my settings which I created according to other Inventory prefabs. Inventory prefab: imgur.com/7ts3wqpInventory settings: imgur.com/2PISbvuimgur.com/Jpvw7odEquip Area 1: imgur.com/zdxUBdjEquip Area 2: imgur.com/Wrmkbc5Item Manager settings: imgur.com/OvooxElimgur.com/FUtFBg6I think the problem is because of Control Area By Input, because it just accepts 1 equip area. I tried to change it to equip area for each SlotsSelector but switching doesn't work correctly.
|
|
|
Post by athellboy on Jul 26, 2018 10:53:42 GMT
Anyone ?
|
|
|
Post by Invector on Jul 26, 2018 13:53:35 GMT
Each EquipmentArea has a unique EquipPointName in the examples we have LeftArm and RightArm Inside the EquipmentArea we have EquipSlots which can filter a ItemType
But since the Bow is a LeftArm weapon, you need to make sure your EquipSlot of the LeftArm EquipmentArea has the ItemType of "Archery"
|
|
|
Post by athellboy on Jul 26, 2018 18:39:04 GMT
Each EquipmentArea has a unique EquipPointName in the examples we have LeftArm and RightArm Inside the EquipmentArea we have EquipSlots which can filter a ItemType But since the Bow is a LeftArm weapon, you need to make sure your EquipSlot of the LeftArm EquipmentArea has the ItemType of "Archery" It is, as you see in images.
|
|
|
Post by Invector on Jul 26, 2018 19:12:14 GMT
Right... you could try add another ControlAreaByID having one for the left and another for the right, this could probably work
|
|
|
Post by athellboy on Jul 26, 2018 19:36:47 GMT
Right... you could try add another ControlAreaByID having one for the left and another for the right, this could probably work If you mean ControlAreaByInput (I don't think so there is any script which its name is ControlAreaByID ), I've changed it. I mean I added EquipArea to SlotsSelector as a member and remove that unique EquipArea. So each SlotSelector has its EquipArea. It assigns weapons to the slots correctly but after changing weapon by numbers, slots in UI are changed and just one of them is in there so I can't change weapon by numbers anymore.
I just added another ControlAreaByInput but is same as above.
|
|
|
Post by Invector on Jul 26, 2018 23:47:02 GMT
So... let me see if I understood what you're trying to do
You want 2 equipmentAreas with 1 equipSlot each? 1 for sword and another for bow and switch between those 2 weapons using input?
The thing is when you equip a 2hand weapon the system will unequip the weapon of the other slot (I know, it sucks) We're actually thinking about a solution to keep the other weapon equipped in the slot but somehow hidden while the 2 weapon is equipped.
|
|
|
Post by athellboy on Jul 27, 2018 5:26:55 GMT
So... let me see if I understood what you're trying to do You want 2 equipmentAreas with 1 equipSlot each? 1 for sword and another for bow and switch between those 2 weapons using input? The thing is when you equip a 2hand weapon the system will unequip the weapon of the other slot (I know, it sucks) We're actually thinking about a solution to keep the other weapon equipped in the slot but somehow hidden while the 2 weapon is equipped. Yup, exactly.
|
|
|
Post by Invector on Jul 27, 2018 15:26:46 GMT
That's something that sucks with Inventories, for each game the inventory works on a different way so it's hard to do something very modular for that.
We did our inventory as an example for this project based on a specific RPG game which doesn't work very well for shooter games, so you will need to modify the vItemManager to fit your gameplay style, it's like halfway there... but the rest of the way you will need to customize to fit your game design.
What you want basically is something that the Inventory as it is out of the box can't do, I will try something here though but I can't promise anything especially because I can't modify the inventory to fit each user ideas because each one is very different from another and it's really time consuming.
|
|
|
Post by athellboy on Jul 27, 2018 18:08:54 GMT
That's something that sucks with Inventories, for each game the inventory works on a different way so it's hard to do something very modular for that. We did our inventory as an example for this project based on a specific RPG game which doesn't work very well for shooter games, so you will need to modify the vItemManager to fit your gameplay style, it's like halfway there... but the rest of the way you will need to customize to fit your game design. What you want basically is something that the Inventory as it is out of the box can't do, I will try something here though but I can't promise anything especially because I can't modify the inventory to fit each user ideas because each one is very different from another and it's really time consuming. Yup, you are right. Thanks So do you have any suggestion for starting to modify code according to my design ?
|
|
|
Post by Invector on Jul 27, 2018 20:14:23 GMT
For starters you could comment the line that will remove the currently equipped item when you equip a TwoHand weapon, this will allow you to equip the bow and keep the sword equipped in the equipArea but not int he equipSlot, this also will allow you to switch between the two without having to go to the inventory and equip again.
Go to the vEquipArea and comment the following line:
public void RemoveCurrentItem() { if (!currentEquipedItem) return; lastEquipedItem = currentEquipedItem; //ValidSlots[indexOfEquipedItem].RemoveItem(); onUnequipItem.Invoke(this, lastEquipedItem); }
|
|
|
Post by athellboy on Jul 28, 2018 5:35:45 GMT
For starters you could comment the line that will remove the currently equipped item when you equip a TwoHand weapon, this will allow you to equip the bow and keep the sword equipped in the equipArea but not int he equipSlot, this also will allow you to switch between the two without having to go to the inventory and equip again. Go to the vEquipArea and comment the following line: public void RemoveCurrentItem() { if (!currentEquipedItem) return; lastEquipedItem = currentEquipedItem; //ValidSlots[indexOfEquipedItem].RemoveItem(); onUnequipItem.Invoke(this, lastEquipedItem); } It doesn't work as you mention. By switching the icon doesn't disappear from UI but I can't switch again. Also after switching both bow and sword is in the player hand.
|
|
|
Post by athellboy on Jul 28, 2018 17:11:25 GMT
Give me some suggestions for start point. I really appropriate if you help me to make this particular inventory but if you can tell me what are the most important scripts are, I think I can take my time on it and create something which I want.
|
|
|
Post by athellboy on Jul 30, 2018 14:29:35 GMT
Anything ?
|
|
|
Post by Invector on Jul 30, 2018 15:56:25 GMT
I would definitely start with the vItemManager
|
|