Equip weapon slot

polonel

Member
I'm sure there is a way to do what I'm wanting out of the box, but not sure how to handle it. I want my character to be able to Equip 3 different items. At the same time but be able to swap between the 3. As in a Primary, Secondary, and Melee weapon. When the weapon is equipped (Not visible) the player can switch between Primary, Secondary, and Melee. I'm using UIS integration. Using the inventory I want to mark a Rifle as Equipped in the Primary slot, where the player then presses 1 to visibly equip the rifle. Same for if they press 2 for secondary. I want the player to still collect and store other Primary and secondary weapons that they can equip into the slot if they wish which replaces their current primary weapon.

What I'm finding with UIS integration is that every weapon they collect is "Equippable" through Hotkey (1,2,3,4 etc) or by EquipNext, EquipScroll and so. I basically don't want the items that are not in one of the 3 slots (Primary, Secondary, Melee) to go into the Equippable collection, but this seems to happen automatically if the weapon is marked equippable in the item definition.

I have tried to setup ItemSets manually to house the different slots I'm looking to achieve but this had zero effect as UIS Bridge was moving them back to the equippable itemset.

Like I said I'm sure there is a way to handle this already, I'm just looking in the wrong direction I'm sure.
 
Unfortunately I cannot think of a way to do this out of the gate... even though it seems like a reasonably common feature.

The way I would do this is remove the ability to equipNext, EquipScroll and remove the input for the equip hotkeys.
Instead I would do the equipping in a custom script.

In the Inventory UI, I would create a custom Item Action that would keep track of the item that are "Soft Equipped" (soft as in equipped, but not active on the character, used to differentiate from all the item that are in the Equippable item collection)

Knowing which item is soft equipped you can swap through them using the hotkeys.

I think that would require two custom script:
1) component on the character that keeps track of the "soft equipped" items and listens to the input to swap between them
2) Item Action to equip/soft equip items

I will add this feature to my todo list, as I expect other users will want to achieve something similar
 
Another solution Justin mentioned is to disable/enable the Item Sets manually to only be able to equip the one you want.

No matter the solution you go with you will need to write a bit of custom code to manage that.
 
Thanks. I'm working on this now. Is there an event that is fired when the bridge has finished loading / setting up the Item Sets for the equippable items? Something to hook into that I can then disable the given ItemSet.

Also, one thing that I am confused about is the ability to "ExposeItemSet" in the Equippable item Category. If I have a sub-category of this is there any reason to ever expose the subcategory?
 
Last edited:
Currently there is no event for that. There is only an event for when the save data is loaded. But I'll add that to my to do list.
For now I believe you can simply do that in Start as the Bridge is executed a bit before the normal execution order (Let me know if I am wrong)

The ExposeItemSet allows you to have more control over what Items you want to equip and how.

For example in the Demo we separate by "Equippable", "Left Hand Grenade", "Right Hand Grenade" and "Magic". That's because they all behave differently, and having them in different Item Set groups gives us more control
 
I will add this feature to my todo list, as I expect other users will want to achieve something similar
I wanted to achieve something very similar to this and had same issues with UCC+UIS integration. Glad that I found this article.
Just curious - any updates on this feature from your side? Or recommended approaches are still the same as described above?
 
@hexzon There is an event that is executed when the bridge saver has finished loading now:
Code:
IntegrationEventNames.c_GameObject_OnInventoryBridgeSaverLoaded

You can always replace the bridge saver by a custom script if the event is not enough to achieve your use case
 
Top