I am trying to get the exact order of the item slots saved for a chest. I've added the InventoryGridIndexData and InventoryGridIndexDataSaver components. This keeps the order correct during gameplay but throws a nullexception while saving.
Steps to reproduce:
- In the UltimateInventorySystem demo scene, add the InventoryGridIndexData and InventoryGridIndexDataSaver components to a chest
- Add the reference to the Inventory in the InventoryGridIndexData component
- Add the reference to the InventoryGridIndexData component in the InventoryGridIndexDataSaver component
- Try to save the game
Notes:
The main issue is coming from m_InventoryGridIndexData.GridIDTabIndexedItems being null during the SerializeSaveData. That is a dictionary that does start as null, but gets initialized in the SetGridIndexData function on the InventoryGridIndexData. This can also cause issues because SetGridIndexData would need to be called before saving, so a player would have to open a chest to try and initialize it for example.
However, even if a player does open the chest to initilize the GridIndexData, it will still return null and the same saving issue happens
Discussion on Discord with some images:
Steps to reproduce:
- In the UltimateInventorySystem demo scene, add the InventoryGridIndexData and InventoryGridIndexDataSaver components to a chest
- Add the reference to the Inventory in the InventoryGridIndexData component
- Add the reference to the InventoryGridIndexData component in the InventoryGridIndexDataSaver component
- Try to save the game
Notes:
The main issue is coming from m_InventoryGridIndexData.GridIDTabIndexedItems being null during the SerializeSaveData. That is a dictionary that does start as null, but gets initialized in the SetGridIndexData function on the InventoryGridIndexData. This can also cause issues because SetGridIndexData would need to be called before saving, so a player would have to open a chest to try and initialize it for example.
However, even if a player does open the chest to initilize the GridIndexData, it will still return null and the same saving issue happens
Discussion on Discord with some images:
Discord - Group Chat That’s All Fun & Games
Discord is great for playing games and chilling with friends, or even building a worldwide community. Customize your own space to talk, play, and hang out.
discord.com