Weapon equip logic / input

gekido

Member
When weapons / items are equipped, it seems to assign them to the equip buttons (1,2,3,4 etc) automatically based on the order they are picked up.

What controls this definition? For example, I always want melee items to be '1', pistols to be '2', etc - I don't see where it specifies what this input is even, let alone how to configure / override this behaviour.

As well, is there any concept of 'only one of a specific type' - for example if I want the player to only be able to pick up one type of pistol. If they choose to pick up another one, it replaces the first, that type of idea. I assume I have to write some custom equip logic, but ... I have no idea where to even start to override the default behaviour.

And yes I did find the 'inventory' documentation which seems straightforward to write some custom logic to equip / drop items etc...but how do I override / disable the default behaviour? or affect it somehow?
 
This is defined within the EquipUnequip ability. In order to override this behavior you'll need to subclass that ability and provide your own logic.
As well, is there any concept of 'only one of a specific type' - for example if I want the player to only be able to pick up one type of pistol. If they choose to pick up another one, it replaces the first, that type of idea. I assume I have to write some custom equip logic, but ... I have no idea where to even start to override the default behaviour.
This will require you to override EquipUnequip or InventoryBase component. With the Ultimate Inventory System integration we did not override EquipUnequip but only implemented a new InventoryBase.
 
Top