Switch between two 'sets' of 'ItemSets'?

Vlaxep

Active member
Hi,

I'm trying to make it so the player can hit 'G' for example and switch out their 'weapons' for 'gadgets/equipment'

So idea being all Weapons become 'disabled' or 'canswitchto=false', or the 'Gadgets' could be under a separate category and
switch to those item sets.

I'm trying to access the methods to set ItemSetCategory, or even just to disable/enable or change the bool for 'Enabled' on each ItemSet, but I cant access (Bolt visual scripting)

Am I missing an easier way to manage this?
 
I'm not sure with Bolt but there is an Enabled property on the ItemSet which you can use. You can get the ItemSet from the ItemSetManger.

Code:
ItemSetManager.CategoryItemSet[categoryIndex].ItemSetList[itemSetIndex].Enabled
 
@Justin Hi I managed to get some help from the Bolt community on how to access that Parameter and finally got there...

Still have an issue with how this functions though.

So I can now on press 'tab' pressed > Enabled=False to my 'ItemSet 0'

The result though is that the weapon remains in (Active) state and is still fireable. I was hoping disabling it would switch to next available weapon?!

What should I be doing from here to get it to switch ? (see below the weapon is 'disabled' but still active, in player hands, and can fire also

Bolt solution below
1607739971406.png
 
Fyi the result I'm looking for i

Button toggle pressed
ItemSet 0-5 will be disabled
ItemSet 6-9 will be enabled
On toggle pressed the (active) itemSet will automatically switch to next available of those that are now active.

Also wanting weapons to remain in their holstered positions.
 
Or at least is there a command I can call to EquipNextAvailable or Set a specific Item?

Have tried setting Disabled index to the next ItemSet - no effect
Have tried setting ItemSet.Active (set) - to another index, no effect
Tried ItemSetManager.SetActiveIndex (something like that - no effect)

I'd be happy to manually call an equip to a specific ItemSet, or preferred would be to equip to next 'enabled' ItemSet
 
If the active Item Set is disabled it won't automatically switch. I can look into potentially including this for a future enhancement but the disabled index is used if the item set is disabled via a state. For now you can manually switch using EquipUnequip.StartEquipUnequip:

 
Thanks @Justin, I've discovered that the state system does exactly what I need! I don't think I explained my need well enough as I'm sure you would've suggested I need to use it haha! It's actually perfect!

I still have one issue to ask you about, but at least now I have:

- 'WeaponItems' have a state called Weap_CannotEquip
- 'EquipmentItems' enable the state Weap_CannotEquip
- The Weap_CannotEquip simply disables the 'CanSwitchTo' property,
so while an equipment item is active no 'WeaponItems' can be switched to!

Then I did the same in reverse with an Equipment_CannotEquip state.

So only issue now is I need to be able to manually equip 'ItemSet0' or 'ItemSet4' which are the first WeaponItem/ first EquipmentItem in the ItemSetManager - for the purpose of toggling between 'EquipmentSelectableMode' and 'WeaponSelectableMode'.

Trying to approach this using as you suggested, the EquipUnequip.StartEquipUnequip method, but a little stuck. As above, I'm using Bolt, I need to know the root of where this method is getting the input to perform the function.... In Bolt as I'm plugging in I need a 'Target' for the StartEquipUnequip, and appears to be needed from an indexed list from somewhere, I just don't know what?!

I've been trying to get it from various places like 'CategoryItemSet', 'ItemList', 'ItemSetManager'...... Any idea? I think it's just the source of the index that the StartEquipUnequip is needing to identify the item, or something like that!
 
StartEquipUnequip() takes one parameter, the ItemSet index. You can get this directly from the ItemSet (ItemSet.Index).
 
@Andrew thanks I'll try that when I get a chance!

Meantime I think I have this solved,

- I have an 'Update' function monitoring the (Active) item set:
- If a 'weapon' is (Active) it will set the 'default' ItemSet to the first 'Equipment' item (currently ItemSet 3
- Then I can scroll through weapons only based on the state system I've now got.
- The I hit 'tilde' key (Toggle Item Equip) which automatically equips the 'default' item, being the first Equipment item
- The Update function will then set the 'default' ItemSet to ItemSet0, my first weapon.

So far this seems to work, but I haven't yet tested with picking up weapons, ammo changes, dropping weapons, changing loadout etc.

No doubt I'll have an issue at some point - likely when the ItemSet it is trying to set as default is not in Player's inventory.

I'll probably deal with that by checking whether they have it or not.

Cheers Andrew
 
StartEquipUnequip() takes one parameter, the ItemSet index. You can get this directly from the ItemSet (ItemSet.Index).
@Andrew I'm struggling to get that input with Bolt, I can easily find ItemSet.Index(set) but the (get) isn't available.

I'm looking through script to see if I can figure out why but I'm not great with the C#. Is it not public perhaps? I don't know which part of the script sets up this (get) method.

Probably doesn't help but here is the search filter in bolt when trying to find the (get) input......

1608216013264.png
 
And also @Andrew when I eventually manage to get this happening, if I want to manually Unequip and then Equip to another item:

1. Does this StartEquipUnequip method perform everything like animation waits etc.? ie To Unequip and then Equip should I be adding a timer, or does the one method do both in one?

On this problem I've tried methods (which I've been able to find!) from inside the Inventory script like 'unequip' and 'equip' with the item identifiers but it literally just changes to that item in the hand and it is not useable, and the animation doesn't get triggered so everything is weird.

2. Is there a method to find 'first available' item/itemset? I'd like to switch to first item player 'has' rather than a specified ItemSet if possible though not 100% necessary as I can perform a check for 'has' each.
 
SOLVED!

3 days later I've managed to get StartEquipUnequip working with Bolt - tough one lol.

See below for anyone interested in how to 'get' this to work. Problem was I couldn't trace the StartEquipUnequip back, but eventually figured out it roots back to:

UltimateCharacterController.GetAbilities.EquipUnequip.StartEquipUnequip

So final problem to tackle on switching between my 'Sets' (Weapons/Equipment) will be whether the ToggleEquip causes me issues when later on Players can choose their layout and don't necessarily have the ItemSet0 weapon in their inventory.

I think I've come across 'has item' somewhere along the line so I should be able to run a check on which Items they have in a priority order, or probably a better solution will be to run an variable that always records the last selected 'weapon' so when the player changes to 'equipmentMode' then the 'default' item will be set to the last selected weapon. That way when deactivating equipment mode by hitting the 'toggleEquip' it will automatically return to their last selected weapon, due to it having been set to the 'default' item.

Phew! Brain is fried
 
Whoops here is the Bolt flow for anyone this may help (Note this is specifically to force equipping ItemSet0 — I will later future proof this to check what the player's current first weapon or more likely 'last selected' weapon to update the 'ItemSetIndex')

1608267941750.png
 
Top