Equip a few Items, Use them, Switch between them

Klin

Member
EDIT: Please move thread into Integrations/UCC

Hi,
in the "Character Controller / Ultimate Inventory System Integration Part 1" Video at about min. 43:30 the UIS Item gets picked up.

How would I equip that item (automatically when picking it up)? Do I need to write my own code mentioned in the integration doc?

How would I use that weapon and how do I switch between weapons when I have another one picked up? Do I use the UCC Abilities (Use, Equip Next etc.) for the UIS Items? Or do I have to write code?

I do not want to use UI for that if possible, taking care of that later. I only want to perform those simple tasks.

Thanks for helping out!
 
Last edited:
You can use the default UCC abilities to Use, Equip Next, etc. and if you are using the Inventory Item Pickup component for your item pickups, it has an option Equip On Pickup when checked, the item will be auto equip.

Note: If you created your item with the UCC Item creation tool, you will need to convert your items to work with UIC. In the UIS editor window, if you navigate to Integrations, you can use it to setup you pickup items and convert character items to work with UIS and UCC
 
In the "Character Controller / Ultimate Inventory System Integration Part 1" Video at about min. 43:30,
the Item that gets picked up has been allready converted.
How would I get THAT item to pickup automatically? Non of the components has an option "Equip On Pickup"
1629669958254.png

Also, when I create another Item the same way (and put them into the Inventory -> EquippableSlots Item Collection at start to test), I can't use equip next or equip previous on those.
How would I use those abilities on THAT item?
 
The Inventory Pickup (UIS) does not know what "Equipping" means from the UCC side of things, since it is a pure UIS component.
You can use the "Inventory Item Pickup" which is an integration component (uses the Character pickup ability). As Exi-G mentioned that component has a "Equip On Pickup" option in the inspector.
This is shown a bit later in the video tutorial.

If you prefer using the UIS interaction system for pickups and still want to auto equip items, you could create a custom pickup script that inherits the InventoryPickup script.
You can simply call the function:
Code:
bridgeInventory.MoveEquip(itemInfo,true);
where bridgeInventory is the "CharacterInventoryBridge" component and the itemInfo is the itemInfo of the weapon you are trying to Equip. The parameter "True" is to tell to equip, if it was "False" it would be to unequip. Check out the "Inventory Item Pickup" script around line 110 for more context.

the function MoveEquip moves the item from the default itemcollection to the Equippable Item Collection and then tries to Equip that weapon if possible. If the item is already in the Equippable ItemCollection you can simply call the function Equip:
Code:
bridgeInventory.Equip(itemInfo,true);

To get the itemInfo you can get it by searching in the inventory using:
Code:
result = Inventory.GetItemInfo(...);
if(result.HasValue){
    itemInfo = result.Value;
}
GetItemInfo takes has a lot of options, you can search by itemDefinition, Category, name, etc... it will return a nullable itemInfo. So you'll need to check if it has a value before using it.

You can check where your item is at runtime by looking at the Inventory Inspector during runtime, you can also look at the InventoryItemSetManager to see the ItemSet that exist from your soft equipped items and see if they are actually equippable.

Learn more about the integration here:

I hope that helps
 
Top