Equip Scroll not working on startup - custom character

DankP3

Active member
I have setup a simple character (v3) and given single weapon to the inventory, ie. two item slots one empty and one with pistol.

For me, ScrollEquip doesn't work on startup. If i press another equip button, eg. Q or E or a number, then it is fixed and the scroll works fine thereafter. It appears to work fine in the demo scene, so i assume it is an issue in my setup?...

I'd appreciate some pointers on where to look.

With character set to auto equip first item in loadout on start, these code lines from ScrollEquip, which check whether to start:

Code:
m_ScrollItemSetIndex = m_ItemSetManager.NextActiveItemSetIndex(m_ItemSetGroupIndex, m_EquipUnequipItemAbility.ActiveItemSetIndex, InputAxisValue > 0);
return m_ScrollItemSetIndex != -1 && m_ScrollItemSetIndex != m_EquipUnequipItemAbility.ActiveItemSetIndex;

debug as:

m_ItemSetGroupIndex = 0
m_EquipUnequipItemAbility.ActiveItemSetIndex = 1
InputAxisValue = (+ or -) 0.1
m_ScrollItemSetIndex = 0
m_EquipUnequipItemAbility.ActiveItemSetIndex = 1
(m_ScrollItemSetIndex != -1 && m_ScrollItemSetIndex != m_EquipUnequipItemAbility.ActiveItemSetIndex) = True

Inspite of returning "True" AbilityStarted() doesnt run.

Now if I set the inventory to not autoequip at start, it debugs as:

m_ItemSetGroupIndex = 0
m_EquipUnequipItemAbility.ActiveItemSetIndex = -1
InputAxisValue = (+ or -) 0.1
m_ScrollItemSetIndex = -1
m_EquipUnequipItemAbility.ActiveItemSetIndex = -1
(m_ScrollItemSetIndex != -1 && m_ScrollItemSetIndex != m_EquipUnequipItemAbility.ActiveItemSetIndex) = False

and of course doesn't start with a false return.
 
I'm checking the code but I don't see anything wrong.

Could you send me a screen shot of your ItemSets at runtime? out of curiosity do you have a default ItemSet (we have Body in the demo)?
Also are you scrolling up or down? and is the ItemSet you are trying to scroll to valid?
Do you have an item to scroll to?
1669284600250.png

Also check out ItemAbilities at runtime as you are scrolling, to see if there is anything that could be preventing the EquipUnequip ability to start
1669285349140.png

EDIT: I tried without a default item and scrolling still works so it migh be something else.
 
So, in my inventory, I didn't have a MultiItemSetRule selected as ItemSetRules, just the ItemRule made when I created the inventory (I suspect I havent followed a tutorial (is a MultiItemSetRule essential?).

I duplicated the MultiItemSetRule from the demo, deleted all rules and added one for my handgun (not default) and one for a null (set as default).

Now everything seems to work. Upon start the null itemset is marked green as active and the wheel scroll works.

I guess I missed a tutorial? but it seems I have figured it out based on your prompts above, thanks.
 
No the MultiItemSetRule is no essential, you didn't miss any tutorial.
All it does is combine multiple rules into one scritpable object so that you can easily reuse it over multiple character if you want to.

My guess is that your rules were not set properly to switch between items.
I would recommend you check out the different paramenters of the itemset rules and compare your ItemSets at runtime compared to the ones from the demo scene.

That'll help you have a better understanding of item set rules
 
Top