Sign In Register

How can we help you today?

Start a new topic
Answered

Help on inventory with new Game Data

Dear Gamesparks Community,

for my game (Android & IOS) I need to have an inventory per player but I have trouble to set it up, I have tried to follow the Tutorial Saving and Loading Data - Player Inventory and Item Management
But because it's using the Spark.runtimeCollection(),.... it does not work with the new Game Data method and I get the Error in the test harness, that runtime Collections are disabled and I should use Spark.getGameDataService instead. I have tried to get it to function for many hours, but with no success...

Alternatively I have tried the method with the Virtual Goods, and that worked, but sadly it's not sufficient for my project, because it can not hold enough information per Slot.
For now I am not even able to get/write to the "inventory" I have created in the Game Data.

Can you please explain to me how I can get a optimal inventory working for my needs?

*The inventory should be able to contain about 100+ different items (with only its shortCode and the amount) p.e. "shortCode: 'x001', amount: 450"


*a complete inventory per player basis or in the accountDetails (like the Virtual Goods but I am not shure if an entry in the acountDetails can hold that big amount of items?).


* a second inventory called "vehicles" (this is where the VGoods is insufficient) because the players should be able to use their collected items from the first inventory to build their own vehicles. So this inventory has to be able to hold the information about the used items, and their transforms (location and rotation). With Unreal Engine I am sending the shortCode of all items used in that vehicle, their corresponding amounts and also their transform information.



Thank you! :) 


Best Answer

you can refer this tutorial to learn the game data service:


https://docs.gamesparks.com/tutorials/social-features/creating-custom-friends-lists-using-game-data-service.html


Although not exactly the same for what you want to achieve, however you can learn how game data service works and use the player tutorial to create your own database, just change everything from runtime collection to game data service and that's all.


no one?

Answer

you can refer this tutorial to learn the game data service:


https://docs.gamesparks.com/tutorials/social-features/creating-custom-friends-lists-using-game-data-service.html


Although not exactly the same for what you want to achieve, however you can learn how game data service works and use the player tutorial to create your own database, just change everything from runtime collection to game data service and that's all.


1 person likes this

thank you very much, helped me alot!

Login to post a comment