Loadouts

Puggy

New member
Hello,

I'm wondering how to set up loadouts. I see that there is a loadout option under a collection's purpose property, but the documentation doesn't say much about it.

What I'm looking to do is let my players select a few of their items to bring into a level, and ideally also be able to save several different loadouts that they can quickly switch between. Adding an item to a loadout shouldn't remove it from the main inventory, and it should let the same item be placed into multiple loadouts, if needed, but not more than once in a single loadout.

Is this the sort of thing that the loadout purpose is supposed to enable? and how does it work?
 
The purpose is just a way for you to quickly point to an ItemCollection if you don't know its name. It has no other functionality (we debated whether to remove it and just use names, but we are keeping it for legacy reasons)
In this case loadout is refering the the items you start with. The items in that collection are then ignored by the Inventory.

The functionality you are referenring too, is unfortunatly not something we have taken into account. Items can only be part of a single ItemCollection at the same time. The reason we put this restriction is to avoid bugs with same item being referenced in multiple itemCollections.

There is a work around though.

The ItemHotbar monitors the entire Inventory. It can allow you to reference Items no matter the Collection it is in. So having multiple hotbars allow you to define multiple combination of items.

If you need your loadout to be category based like your ItemSlotCollection for equipment, then you are better off writing some custom code for it.
Nothing complicated.
Simply loop through the items in the ItemSlotCollection and copy the itemInfos in a list. And do so for each loadout.
Then when you switch loadout just replace the items in the ItemSlot Collection by removing and adding those items.

You'll find how to loop through, add and remove items in ItemCollections here

I hope that helps
 
Top