Can't switch from exhausted grenades to rifle

Cheo

Active member
Hello, in the integration demo scene if you have a rifle equipped in your primary slot, a grenade in your tactical one, and no default Body weapon, if you throw all your grenades the player will automatically switch back to his rifle. However if you remove the grenade related Item Abilities and Item Set elements, the player will then not be able to automatically equip his rifle. Here's a video showing the issue with more details as usual :


The fact that EquipUnequip already accounts for the possibility of an item being removed and the need to switch to another one using forceEquipUnequip and immediateEquipUnequip, and that it didn't work when making the grenade setup on the character lighter makes me think that there is something wrong somewhere in the ability code that prevents it from handling the self removal of an item when it runs out of ammo.

We are currently near a deadline and while we should be able to figure out a workaround, we would really appreciate this being taken a look at. As always if more details are required let me know, thanks.
 
I'm sorry Cheo I completely missed the first post.

This is all as expected. If you want the want the weapon to be equipped once the grenade is fully used, then you must set the ItemSet as "Default true"
1775487523514.png

For context, when a weapon is removed we check the best matching ItemSet to equip next. Example if you have a sword+Shield Item Set and remove the Shield then we try to find if there are other valid ItemSets for the Sword that still exist.

In the case there are no "best matching" item set then we set the default itemSet. This searches for the the first default ItemSet it can find. If there are no Default ItemSet then it will set to -1 (which is what you see in your video)

I hope that makes sense :)
 
Back
Top